fix(mcp): register call_tool as the handler (every MCP tool call was crashing)#2
Open
sbhooley wants to merge 1 commit into
Open
fix(mcp): register call_tool as the handler (every MCP tool call was crashing)#2sbhooley wants to merge 1 commit into
sbhooley wants to merge 1 commit into
Conversation
…yload The @server.call_tool() decorator was attached to the 0-arg helper _ainl_unavailable_payload() instead of the async dispatcher call_tool(name, arguments). The SDK registered the helper as the handler and called it with (name, arguments), so every MCP tool call crashed with "_ainl_unavailable_payload() takes 0 positional arguments but 2 were given". Hooks and direct DB writes were unaffected since they bypass the dispatcher. Move the decorator onto call_tool; _ainl_unavailable_payload stays a plain helper called with 0 args from the ainl_* fallback branches. Closes #1 Co-Authored-By: Claude Opus 4.8 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the misplaced
@server.call_tool()decorator that made every MCP tool call crash.Problem
All
memory_*,ainl_*, anda2a_*tools fail with:In
mcp_server/server.pythe@server.call_tool()decorator was attached to the 0-arg helper_ainl_unavailable_payload()instead of the async dispatchercall_tool(name, arguments). The SDK registered the helper as the handler and invoked it with(name, arguments)→TypeErroron every call. Hooks and direct DB writes were unaffected (they bypass the dispatcher), which masks the breakage.Fix
Move the decorator onto
call_tool._ainl_unavailable_payloadremains a plain helper, still called with 0 args from theainl_*fallback branches.Verified
py_compileclean.call_tool("memory_store_semantic", {...})→ returned anode_id(no TypeError).mcp_server.serverprocess and reloading.Note for applying the fix
/reload-pluginsdoes not restart an already-running MCP server subprocess — the existingmcp_server.serverprocess must be killed (or Claude Code fully restarted) for the patch to load.Closes #1
🤖 Generated with Claude Code