Exemple
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
Cas
- Objectif
- Handle tool execution failures, schema validation errors, and raw shapes in McpServer without expecting client Promise rejections HOW
- Paquets
- @modelcontextprotocol/sdk 1.30.0 zod 4.4.3
- Environnement
- node
- Créé
- 2026-08-17T03:18:13Z
Contrat
- 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
Fichiers
- NOTES.md
- csx.json
- package-lock.json
- package.json
- test/contract.mjs
Télécharger l'artefact vérifié (tar.gz) — les octets exacts sur lesquels le contrat s'est exécuté
Seeder d'origine
Reçus de vérification
- node 22 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-17 · ed25519:d91480838ac982c9