https://retellai.com/?utm_source=discord&utm_medium=seo logo
MCP TOOL CALLING ISSUE
# ❓・bug-report
i
When using MCP tools, the agent is unable to trigger the mcp tools properly. I have had my infrastructure checked everything looks in place on the MCP server side. The issue has just started coming in the last 2 days. The frequency of this error has increased in last 1 day. Attaching the error, this is not hitting my end in my logs- tool_call_id: 1aa0c715ffb14a65 "Error POSTing to endpoint (HTTP 404): {\"error\":{\"code\":-32001,\"message\":\"Session not found\"},\"id\":\"\",\"jsonrpc\":\"2.0\"}" call_035b30a50cf200899e0273d1ade, call_02b400ea1742185c7cd20278dfc worked for this call, same agent no change to prompt - call_39fd58962e1cdd820f25aeba139 @Shehroze -Support @Retell @Omar Ashraf | Community Lead @Colin - Integrations @ Retell AI
@AG - LeadsCo
s
Hi @IS - LeadsCo
This error (HTTP 404: {"error":{"code":-32001,"message":"Session not found"}}) appears to be related to MCP session management on your server side
i
@Shehroze -Support @Retell I am not generating any error logs, nothing is hitting my endpoint. Basis which i reached out to you guys. My agent is down. Looking for some help/guidance on this?
s
Ok I sent this to team to look
Hi @IS - LeadsCo The HTTP 404 / "Session not found" error usually means the MCP session created at the start of the call can't be found when a later tool request comes in. This might happen if the you have multiple MCP servers behind a load balancer and the follow-up request gets routed to a different server, or your MCP session is expiring quickly. Suggested debug: • If you run multiple MCP server instances, make sure requests for the same call consistently hit the same MCP server. • Check MCP session timeout/expiration settings This issue likely isn't on our side.
i
@Shehroze -Support @Retell - I shared your response with my dev and got this reply from. Please forward to your team and see if this makes sense and we can somehow fix this. ——— the “Session not found” error, it is coming from the Retell platform rather than our application. The response {"error":{"code":-32001,"message":"Session not found"},"jsonrpc":"2.0"} is a JSON-RPC message returned by Retell when the call session on their side is no longer available. This can happen if the Retell session expires or times out, if the call ends before the tool execution completes, or if there is a temporary network issue between our server and Retell. In such situations Retell tries to post the tool response back to the call, but the session has already been cleaned up on their end, resulting in the 404/session not found message. From our side, we have increased the ActiveSessionCacheDuration from 30 to 60 minutes and added a sliding expiration of 30 minutes so each access refreshes the TTL for active sessions. That said, if Retell internally closes or expires the session, we cannot restore it from our system, as this depends on Retell’s platform limits and lifecycle policies. Please let us know if the timeout can be extended or if there is a recommended approach for long-running tool executions.
s
Ok @IS - LeadsCo
i
@Shehroze -Support @Retell any update ?
s
Hi @IS - LeadsCo
This is the reply from the team : For call_035b30a50cf200899e0273d1ade: the customer has this backwards. The log shows Error POSTing to endpoint (HTTP 404): {"error":{"code":-32001,"message":"Session not found"}} - this is their MCP server returning that error to us, not the other way around. We don't have a "Retell session" for MCP. We connect to their server at call start, but there was a 2+ minute idle gap before the first tool call, so their server expired the session. They need to increase their MCP session timeout or run stateless.
i
@Shehroze -Support @Retell thansk alot for the support. Let me get this sorted with my devs