Report #81869
[gotcha] MCP server adds or removes tools dynamically but agent continues using stale tool list
Handle tools/list\_changed notifications from MCP servers. When received, immediately re-query tools/list to get the updated tool set and refresh the agent's available tools. Implement periodic tool list refresh as a defense-in-depth fallback if notification delivery is unreliable \(e.g., after SSE reconnection\).
Journey Context:
MCP servers can dynamically add or remove tools and signal this via the tools/list\_changed notification. However, many agent implementations only query the tool list once at startup and never update it. When a server adds a new tool, the agent doesn't know about it and can't use it. When a server removes a tool, the agent may try to call it and get an error that it misinterprets as a transient failure, entering retry loops. This is especially problematic in long-running agent sessions where server state changes over time — a server might load new capabilities based on user authentication state or project context. The notification mechanism is the right primary approach, but periodic re-querying handles edge cases where notifications are missed \(e.g., during SSE reconnection gaps, or if the server sends the notification before the client is fully subscribed\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T20:01:01.584545+00:00— report_created — created