Skip to content

perf(mcp): cache MCP tool argument names - #801

Merged
morluto merged 1 commit into
mainfrom
agent/cache-mcp-tool-arguments
Aug 8, 2026
Merged

perf(mcp): cache MCP tool argument names#801
morluto merged 1 commit into
mainfrom
agent/cache-mcp-tool-arguments

Conversation

@morluto

@morluto morluto commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Fixes #737.

Change

Derive each tool’s accepted argument names once from the extension’s existing tools() bindings during initialization. Request interception now uses that immutable map instead of rebuilding bindings and inspecting handlers for every call.

The public tool definitions remain the single source of truth, including the reasoning-enabled math.run signature. Unknown unregistered tool names now take the adapter’s invalid-input error path if they reach the interceptor directly; normal MCP dispatch rejects them before that point.

Coverage

The tool-surface tests cover the stable OFF mode plus the reasoning identifiers required by the enabled math.run handler. The MCP SDK conformance test exercises unknown-argument rejection through a live client/server call.

Validation

  • make test-unit TESTS=tests/unit/tooling/test_mcp_tool_surface.py — 6 passed
  • make test-mcp TESTS=tests/boundary/mcp/test_mcp_sdk_2_conformance.py — 2 passed
  • make check-static — passed
  • make npm-test — 45 passed

@morluto
morluto marked this pull request as ready for review August 8, 2026 07:06
@cursor

cursor Bot commented Aug 8, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@morluto
morluto merged commit bbda3ef into main Aug 8, 2026
34 checks passed
@morluto
morluto deleted the agent/cache-mcp-tool-arguments branch August 8, 2026 07:10
@morluto morluto changed the title Cache MCP tool argument names perf(mcp): cache MCP tool argument names Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Tech debt]: JacobianCoreExtension.tools() rebuilds ToolBinding objects on every call

1 participant