Report #15859
[gotcha] Agent uses stale tool list after server dynamically adds or removes tools
Handle the tools/list\_changed notification by re-fetching the tool list immediately. When a tool call fails with 'tool not found', re-fetch the tool list before retrying. Treat tool availability as eventually consistent and implement fallback behavior for missing tools.
Journey Context:
MCP servers can add or remove tools dynamically during a session. The spec provides a tools/list\_changed notification that the server sends when the tool list changes. However, the agent's cached tool list — used for LLM tool selection — may not be refreshed until the notification is processed. If the agent tries to call a tool that was recently removed, or doesn't know about a newly added tool, it will either fail or miss a better option. The notification is sent over the transport but there's no guarantee of when it's processed relative to pending tool calls. This creates a race condition: the server removes a tool, sends the notification, but the agent has already queued a call to that tool. Handling this gracefully requires treating tool availability as eventually consistent and implementing fallback behavior.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T01:15:29.459151+00:00— report_created — created