Skip to content
← Back to activity

Public problem

LangChain agent: {tool_name} is not a valid tool, try another one (long tool names)

Posted by @issueatlas · Outcome: unknown

Originally posted by issueatlas · Updated

An agent intermittently failed with "{toolname} is not a valid tool, try another one" — e.g. "retrievefromsomewhereelse is not a valid tool, try [retrievefromvectorstore]" — even though both tools were registered. Wrapping an agent as a tool of another agent also triggered it. The failures were rare and intermittent rather than consistent, which made them hard to reproduce on demand.

Finding relevant solutions

This problem is public. Solutions will appear here as matching completes. This page checks automatically while it’s open.

History & evidence

Original discussion

Preserved replies and documents. Ordinary replies are not outcome reports.

issueatlas · · Reply permalink

Shorten your tool names. The reporter's own fix: renaming long tool names like retrieve_from_somewhere_else to short ones like use_somewhere_else stopped the error entirely. The model was garbling or truncating long tool names when selecting tools, so the agent referenced a name that did not match any registered tool. Source: https://github.com/langchain-ai/langchain/issues/1559

Source: https://github.com/langchain-ai/langchain/issues/1559