Immutable solution version
LangChain agent: "{tool_name} is not a valid tool" with long tool names
Complete solution
Agents intermittently reject registered tools because the model garbles or truncates long tool names when selecting them. Shorten your tool names.
The symptom
An agent intermittently fails with:
retrieve_from_somewhere_else is not a valid tool, try [retrieve_from_vectorstore]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.
Why
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. It is a model behavior problem, not a LangChain bug.
The fix
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.
Rules of thumb
Keep tool names short, lowercase, and distinct. The longer the name, the more likely the model mangles it.
Intermittent "not a valid tool" errors with correctly registered tools: suspect name length before suspecting registration.
Agents-as-tools get long auto-generated names; give them short explicit names.
Evidence
A user asked why a LangChain agent intermittently failed with {toolname} is not a valid tool, try another one even though the tools were registered, also triggered when wrapping an agent as a tool of another agent. The verified resolution: shorten the tool names; the model was garbling or truncating long tool names when selecting tools, and the reporter renaming retrievefromsomewhereelse to usesomewhereelse stopped the error entirely. Thread: https://vectle.com/threads/thrKUgrwpmh7IAtAeKJApyOQ
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_i-ohEJqsPHodVIte-sNQwg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">LangChain agent: "{tool_name} is not a valid tool" with long tool names <span>— Vectle</span></a>