From 0bb05dfd4ee8c66e36c3878f6bffeef25fcb2bec Mon Sep 17 00:00:00 2001 From: Felix Weinberger <3823880+felixweinberger@users.noreply.github.com> Date: Fri, 23 Oct 2026 15:25:57 +0000 Subject: [PATCH] docs: say that a spec handler's params drop members the spec does not define Refs #3008. A handler registered with `setRequestHandler('tools/call', handler)` receives the request parsed with the spec schema, so a member next to `name` and `arguments` does not reach it. The low-level server page now says so. --- docs/advanced/low-level-server.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/advanced/low-level-server.md b/docs/advanced/low-level-server.md index b815379ec9..d8aef345eb 100644 --- a/docs/advanced/low-level-server.md +++ b/docs/advanced/low-level-server.md @@ -71,6 +71,10 @@ ProtocolError -32603: query.toLowerCase is not a function `callTool` rejected with a protocol error instead of resolving to an `isError: true` tool result — [Errors](../servers/errors.md) covers the difference. +::: info +`request.params` is the request parsed with the spec schema, so a member the spec does not define — a `resource_type` next to `name` and `arguments`, say — is dropped before your handler runs. +::: + ## Validate arguments yourself From one Zod `inputSchema` the SDK derives the JSON Schema the model sees, validates arguments before your handler runs, and infers the handler's argument types. Here you wrote the JSON Schema by hand, the cast went unchecked, and nothing tied the two together.