Agents - Custom MCP Server not working

I've configured an Agent with my own custom MCP server, but I'm getting unhelpful errors from the chat agent after I ask it to use an exposed tool. I've checked multiple times with the MCP Inspector that my tools are working as expected, and I've even reduced the response output to a single line to see if it would work with no luck. Any help would be appreciated.


Hi @syardumi !

Thanks for giving this a trial run. I see that the error is coming from the LLM, Llama, itself -- have you tried using this MCP server against a different LLM to see if you get the same result?

I haven't taken a test run with MCP and Llama together yet myself but this looks like a good excuse to try and reproduce if you're still having issues.

1 Like

I did a quick trial run of this -- setup a custom MCP server that wrapped a public REST API and hooked it up to ngrok to make it accessible to Retool.

I setup a Retool agent to use the MCP server as a tool and llama-4 as the LLM.

The agent was able to handle the situation well from what I can tell.

The one note I'll add -- I had to make sure the MCP server address was set to: https://my-host-name.ngrok-free.app/sse -- the path component was important to get it working.

Oh, good question. I hadn't even thought of Llama being the issue here. When I switch to a different LLM, it works as expected. Any idea why Llama is the problem?

It looks like from my tests that Llama works fine theoretically with MCP, so it's not just that flat out.

My feeling is that there's something in the prompt itself that isn't helping the LLM translate "last 7 days" into a "number" that lastXdays is looking for in user-interaction-report. Some LLMs figure out what to do better than others at some tasks.

In this case it might help to add something like this to the prompt:

When a user enters a phrase like last 7 days, extract the # of days and present it as an integer to the user-interaction-report within the IDM MCP Server tool available to you.