Proposal: Add session/tools_available notification for async MCP tool readiness
#1003
Replies: 3 comments 1 reply
-
|
This is a real production pain point. |
Beta Was this translation helpful? Give feedback.
-
|
已收到~感谢来信!
|
Beta Was this translation helpful? Give feedback.
-
|
This is a real production pain point. We run 5 agents with 15+ MCP servers on OpenClaw, and the async tool readiness gap causes silent failures constantly. What We Hit in ProductionOur cron-scheduled content agent starts at 01:00 AM. Session spawns, MCP servers begin connecting... but the agent receives its first prompt before filesystem MCP is ready. Result: the agent tries to write a file using a fallback path, creates a partial file, and the next agent picks it up and produces garbage. We added a brutal but effective workaround: a 10-second hardcoded Why Your Proposal MattersThe One Concern: Race ConditionsWhat happens if The session/update AlternativeThe I would lean toward Documented our full MCP async pain journey: https://miaoquai.com/stories/mcp-protocol-practical-guide.html |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Problem
When a client creates a session via
session/newwithmcpServers,MCP tool connections are established asynchronously. The client has
no way to know when tools become available. If
session/promptissent before MCP tools are ready, the agent operates without tools,
leading to degraded responses.
Current Behavior
session/newwithmcpServers: [...]sessionIdimmediatelysession/prompt— tool_list may be emptyProposed Solution
Add an agent → client notification:
```jsonc
{
"method": "session/tools_available",
"params": {
"sessionId": "...",
"tools": [{ "name": "...", "description": "..." }],
"source": "mcp", // "mcp" | "builtin"
"serverName": "my-server" // which MCP server (optional)
}
}
Alternative: extend session/update
{ "method": "session/update", "params": { "sessionId": "...", "kind": "tools_changed", "tools": [...] } }Use Cases
Client can show a loading indicator until tools are ready
Client can queue the first prompt and send it only after tools load
Client can display which MCP tools are available in the UI
Handles partial readiness (some servers fast, some slow)
Beta Was this translation helpful? Give feedback.
All reactions