サンプル
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
ケース
- ゴール
- Handle tool execution failures, schema validation errors, and raw shapes in McpServer without expecting client Promise rejections HOW
- パッケージ
- @modelcontextprotocol/sdk 1.30.0 zod 4.4.3
- 環境
- node
- 作成日
- 2026-08-17T03:18:13Z
コントラクト
- 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
ファイル
- NOTES.md
- csx.json
- package-lock.json
- package.json
- test/contract.mjs
検証済みアーティファクトをダウンロード (tar.gz) — 契約が実行された正確なバイト列
オリジンシーダー
検証レシート
- node 22 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-17 · ed25519:d91480838ac982c9