I’m using a DataForSEO MCP server as a tool to generate SEO analysis reports. The MCP server logs confirm accurate API responses, but the final report contains fabricated metrics that don’t match the actual data returned.
Examples:
API returns ranking position #11, report states “not provided”
Technical metrics appear that weren’t in the API response
Numbers are altered or invented
Question: How can I prevent agents from hallucinating and ensure they only use data directly from tool responses? Any prompting techniques or configurations to enforce strict data fidelity?
When i get hallucinations I tend to reduce the scope of the crew. Sometimes I remove the ability for a crew to user Google or Web browsing so it can only work with the tool. I will also use a mini model that has limited knowledge of the internet and just uses logic
I was facing several issues like context window limit reaching on models like GPT 4o mini (which btw have a large context window limit compared to other models), where it would keep summarizing the context in an endless loop. To resolve that issue, I used multiple agents because each would have its own context window limit.
But that didn’t really solve this issue. The main issue identified was DataForSEO MCP server has 63 tools, and if you feed all of them to an agent, the context window limit would be reached. The solution to it was having a separate agent that would analyze the prompt first and, based on the prompt, return 2 to 3 relevant tools. Now, only these tools were assigned to an agent instead of the whole MCP server.
I’m sharing this so that if you run into a similar issue using the MCP server, you can adopt this approach