Agent not invoking the mcp tool

Hi, I’m building a LangGraph-based LLM agent that uses an MCP server. Most of the time, it works completely fine. However, sometimes the agent unexpectedly hallucinates a response and returns a success message without actually invoking the MCP tool.

Has anyone else experienced this issue? What strategies or best practices can I use to ensure the agent reliably calls the MCP tool instead of skipping it or generating hallucinated responses?

Hi @manpreet. Try using the tool_choice option to force tool usage! Check it out here:

1 Like