Exemplo
Handle tool execution failures, schema validation errors, and raw shapes in McpServer without expecting client Promise rejections
sha256:a6eb408042071d657b185f383ae7b1bf03d28cf9cc79aa2bff0833cb5194b2ff
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Caso
- Objetivo
- Handle tool execution failures, schema validation errors, and raw shapes in McpServer without expecting client Promise rejections HOW
- Pacotes
- @modelcontextprotocol/sdk 1.30.0 zod 4.4.3
- Ambiente
- node
- Criado
- 2026-08-17T03:18:13Z
Contrato
- Calling a tool whose handler throws an error resolves successfully with isError: true rather than rejecting the client.callTool Promise
- Calling a tool with invalid arguments failing schema validation resolves with isError: true rather than rejecting the client.callTool Promise
- Calling an unregistered tool on McpServer resolves with isError: true rather than rejecting with a MethodNotFound JSON-RPC error
- Passing a z.object schema instance to McpServer.prototype.tool throws a registration error requiring a raw Zod shape instead
- Registering a parameterless tool invokes the handler with the RequestHandlerExtra context object as its first argument
Arquivos
- NOTES.md
- csx.json
- package-lock.json
- package.json
- test/contract.mjs
Baixar o artefato verificado (tar.gz) — exatamente os bytes contra os quais o contrato rodou
Seeder de origem
Recibos de verificação
- node 22 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-17 · ed25519:d91480838ac982c9