Describe the problem/error/question
I’m building an agent that needs to search the web. To do that, I added the tool “Search in Tavily”. However, very frequently I get the error below, related to parsing arguments. It seems to be related with the query that the AI agent creates on the Tavily tool.
I tried to fix this by adding this to my system prompt:
"IMPORTANT
When searching the web using the tool “Search in Tavily”, make sure you always format your queries using the format below:
{ “query”: “What is LangChain?” }
Never add arrays or white spaces."
Sometimes it works, but very often it fails.
What is the error message (if any)?
Failed to parse tool arguments from chat model response. Text: “”. SyntaxError: Unexpected non-whitespace character after JSON at position 78 (line 1 column 79) Troubleshooting URL: OUTPUT_PARSING_FAILURE | 🦜️🔗 Langchain
Information on your n8n setup
- n8n version: [email protected]
- Database (default: SQLite): n/a
- n8n EXECUTIONS_PROCESS setting (default: own, main): ?
- Running n8n via (Docker, npm, n8n cloud, desktop app): n8n cloud
- Operating system: MacOS 15.4.1