You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Share with a friend shows raw "MCP error -32602: Tool grant_bot_to_friend not found" instead of the unavailable message #563
Two isolated homes (@selftesta2.home / @selftestb2.home), mutual friends with live grants. After one side revokes its Bot grant, Sharing → Share with a friend fails with the raw MCP error:
flybot/social/share-with-friend: MCP error -32602: Tool grant_bot_to_friend not found
Expected
The handler already intends older Bot Social servers to degrade cleanly: grantBotToFriend should return { unavailable: true } and the UI should say "Bot Social needs an update to share with a friend. Invite links still work." (the #500/#516 contract). The REST fallback (POST /v1/bots/:id/grants/to-friend) should be attempted first; when it also 404s, the unavailable path should win.
Actual
The MCP tool-not-found error is not classified as unknown-tool, so no fallback runs and the raw MCP string is shown. isUnknownTool() matches unknown tool, no tool, method not found, unrecognized tool — but the server says MCP error -32602: Tool <name> not found, which matches none.
Evidence from this round:
production tools/list has no grant_bot_to_friend (it has list_bot_grants / revoke_bot_grant);
direct REST POST /v1/bots/bot_…/grants/to-friend returns 404 Route … not found;
isUnknownTool(new Error("MCP error -32602: Tool grant_bot_to_friend not found")) → false.
Steps to reproduce
Start two isolated homes on latest main; make them friends so both have a grant (invite A→B, then B→A).
Revoke A's Bot grant to B (social/revoke-grant), so B appears in A's share list again.
plugins/social/src/mcp-client.js: isUnknownTool should also treat Tool <name> not found and -32602 (JSON-RPC invalid params used by the production MCP server for a missing tool) as unknown-tool, so tryTool reaches the REST fallback and { unavailable: true }.
plugins/social/src/social.js: mapShareFriendError can map the same wording to the friendly unavailable message as a belt-and-braces guard.
Test: the existing Share a Bot with an existing friend without an invite link #500 test for a server without grant_bot_to_friend uses new Error("unknown tool"); add a case with the production wording MCP error -32602: Tool grant_bot_to_friend not found.
Note: the production Bot Social server still lacks the companion capability itself, so the share action cannot succeed until it ships; the FlyBot-side defect is the fallback/error path. No issue opened in the upstream repo.
Triaged agent-ready (bug, area:social, from self-test). Reproduced the classification bug at the root: isUnknownTool() knows unknown tool / no tool / method not found / unrecognized tool, but the production server answers a missing tool with MCP error -32602: Tool <name> not found, so tryTool never takes the REST fallback and the raw MCP string reaches the UI.
plugins/social/src/mcp-client.js — isUnknownTool also accepts Tool <name> not found, and -32602 only when the text names a missing tool (so an invalid params error that is not a missing tool still surfaces).
plugins/social/test/social.test.js — a minimal repro with the production wording: the REST fallback runs, an absent route reports unavailable, and social/share-with-friend shows the "needs an update … Invite links still work" sentence, not the raw error.
docs/subsystems/social.md + a changelog.d/563-…fixed.md fragment.
I am not touching mapShareFriendError: once isUnknownTool recognises the wording, grantBotToFriend returns { unavailable: true } and the handler already maps that to the actionable sentence, so a second mapping would be unreachable code. The production server still lacks the capability itself, so sharing stays unavailable until it ships; this fixes the FlyBot-side fallback and message.
Activity
Birfy commentedon Oct 21, 2026
Triaged
agent-ready(bug,area:social, from self-test). Reproduced the classification bug at the root:isUnknownTool()knowsunknown tool/no tool/method not found/unrecognized tool, but the production server answers a missing tool withMCP error -32602: Tool <name> not found, sotryToolnever takes the REST fallback and the raw MCP string reaches the UI.Branch:
fix/563-share-with-friend-missing-tool(frommain4f6a53d7). Scope:plugins/social/src/mcp-client.js—isUnknownToolalso acceptsTool <name> not found, and-32602only when the text names a missing tool (so aninvalid paramserror that is not a missing tool still surfaces).plugins/social/test/social.test.js— a minimal repro with the production wording: the REST fallback runs, an absent route reportsunavailable, andsocial/share-with-friendshows the "needs an update … Invite links still work" sentence, not the raw error.docs/subsystems/social.md+ achangelog.d/563-…fixed.mdfragment.I am not touching
mapShareFriendError: onceisUnknownToolrecognises the wording,grantBotToFriendreturns{ unavailable: true }and the handler already maps that to the actionable sentence, so a second mapping would be unreachable code. The production server still lacks the capability itself, so sharing stays unavailable until it ships; this fixes the FlyBot-side fallback and message.Share with a friend degrades cleanly when the server lacks the tool (#…
Share with a friend degrades cleanly when the server lacks the tool (T…