Tool Agent: problems with http tool

Describe the problem/error/question

Hello guys,

I have a problem. I am using a tools agent to fetch information about my company from different sources, but it always get an empty response. Checking through the logs, I noticed the search query contains spaces (despite instructions to URL-encode), and I though this breaks the query:

I tried to URL encode using {{ encodeURIComponent($json[“query”]) }} and {{ encodeURIComponent({query}) }}, but I can never get the actual query (keep in mind this is from the agent to the tool, so I cannot intercept the query to modify it).

Then checking more logs, I found some instances of queries that do not contain spaces, and still don’t get any result:

When I use the query in an incognito browser, I get results for that URL (https://community.gainium.io/search.json?q=category:bug-reports%20combo):

So while still useful to know how to get the URL encoding to work, that doesn’t seem to be the issue.

The only way I got this to work is by using a subworkflow tool instead of directly calling the HTTP, in the subworkflow I can use urlencode without issues and more flexibility. However that means creating a lot of other workflows and it’s a little bit messier.

What is the error message (if any)?

Please share your workflow

Thank you for your help.

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.