Skip to content

Register all tools with registerTool - #26

Merged
imbenrabi merged 1 commit into
mainfrom
claude/project-thread-dmygud
Oct 10, 2026
Merged

imbenrabi merged 1 commit into
mainfrom
claude/project-thread-dmygud

Conversation

@imbenrabi

@imbenrabi imbenrabi commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Ben · project thread

Follows #25 (merged), which bumped the SDK to ^1.32.1 and keeps JSON Schema tools working.

Before: Zod tools, and the meta-tools, still register through the deprecated server.tool() overloads. annotations.title reaches clients only inside annotations.

After: every tool, meta-tools included, registers through McpServer.registerTool. Zod raw shapes and Zod schemas go through as they are. JSON Schema inputs keep #25's passthrough object, so their behaviour is unchanged. annotations.title is also sent as the tool's top-level title (spec 2025-06-18+).

How: DynamicToolManager.registerSingleTool has a single registerTool call, and isZodInputSchema() (which also recognizes Zod v4 and full Zod schemas) picks the schema. The zod floor moves to ^3.25 to match the SDK's peer range. README examples, the demo and the tests now use Zod shapes, with a README note on what JSON Schema inputs lose. New real-SDK tests check that a Zod tool advertises its properties, title and annotations and receives its arguments, and that a JSON Schema tool receives its arguments.

Verified locally: typecheck, 328/328 tests, build, and npm audit --audit-level=critical. Financial-Modeling-Prep-MCP-Server passed typecheck and 850/850 tests against this registration code on SDK 1.32.1.

🤖 Generated with Claude Code

https://claude.ai/code/session_01BieFQPQqC2JGUck3HRPJJC

@imbenrabi imbenrabi self-assigned this Oct 10, 2026
Builds on the dependency fix branch. Zod raw shapes and Zod schemas now go
through McpServer.registerTool instead of the deprecated server.tool()
overloads, and meta-tools do too. JSON Schema inputs keep the passthrough
registration. annotations.title is also sent as the tool's top-level title.

Raise the zod floor to ^3.25 to match the SDK's peer range, move README
examples, the demo and tests to Zod input schemas, and add real-SDK tests
for argument delivery and the advertised schema, title and annotations.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BieFQPQqC2JGUck3HRPJJC
@imbenrabi
imbenrabi force-pushed the claude/project-thread-dmygud branch from 7166c87 to c18356e Compare October 10, 2026 07:20
@imbenrabi imbenrabi changed the title Upgrade MCP SDK to 1.32.1 and register tools with registerTool Register tools with registerTool (stacked on #25) Oct 10, 2026
@imbenrabi
imbenrabi changed the base branch from main to claude/project-thread-0itqrt October 10, 2026 07:20
@imbenrabi imbenrabi changed the title Register tools with registerTool (stacked on #25) Register all tools with registerTool Oct 10, 2026
@imbenrabi
imbenrabi changed the base branch from claude/project-thread-0itqrt to main October 10, 2026 09:16
@imbenrabi
imbenrabi marked this pull request as ready for review October 10, 2026 09:17

Copy link
Copy Markdown
Contributor Author

Server compatibility review (Financial-Modeling-Prep-MCP-Server): GO

Reviewed head c18356e against the FMP MCP server, which is this package's main consumer.

What I ran

  • The server's verify:toolception harness (server PR Move the server to toolception 0.7.0 imbenrabi/Financial-Modeling-Prep-MCP-Server#109) with --source git:c18356e. It packs this branch, installs it into the server, then runs typecheck, lint, build and the unit tests, and boots the real server in ALL_TOOLS, STATIC_TOOL_SETS and DYNAMIC_TOOL_DISCOVERY modes. Every required check passed: 253 tools are advertised with Zod-derived inputSchemas, invalid arguments are rejected with Input validation error, and a client without a token gets FMP_ACCESS_TOKEN is required. The 5 tracked checks that fail are the same 5 that fail on 0.6.3. They are the existing issues fixed by fix: give every STATIC-mode client its own server #27 and server #108, so nothing regressed.
  • Server main with this branch and SDK 1.32.1, deduped to a single copy: typecheck passes and 850/850 tests pass.
  • Server #108 (prompts registered in createServer) with this branch: typecheck passes and 852/852 tests pass.

Server call sites this touches

  • All 253 server tools pass Zod raw shapes as inputSchema. isZodInputSchema() accepts every one of them, so they now go through registerTool with real validation. A server unit test in #109 checks this for every module.
  • The server doesn't use JSON Schema inputs or annotations.title, so the passthrough path and the top-level title change don't affect it.
  • zod ^3.25.76 and SDK ^1.32.1 match what the server pins in #109, so npm still dedupes to one copy.

Merge notes

  • No rebase is needed. main (2f15dfe) has the same tree as 08c00b6, which this commit is based on.
  • This verdict holds while the head stays at c18356e. If the head changes, I'll re-run the checks.
  • Release: because consumers on ^0.6.x would pick this up automatically, please publish it as 0.7.0 rather than 0.6.4. If the release also includes fix: give every STATIC-mode client its own server #27, server #108 has to merge first.

Generated by Claude Code

@imbenrabi imbenrabi mentioned this pull request Oct 10, 2026
imbenrabi pushed a commit that referenced this pull request Oct 10, 2026
The next release carries #25, #26 and #27. #27 changes STATIC mode to a
server per client, so it ships as a minor version: consumers pinned to
^0.6.x keep 0.6.3 until they opt in.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pqcus1BTWLVAJaPavwdkGX
@imbenrabi
imbenrabi merged commit 8da6a82 into main Oct 10, 2026
1 check passed
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.

2 participants