@cyanheads/mcp-ts-core 0.13.2 → 0.13.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AGENTS.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # Developer Protocol
2
2
 
3
3
  **Package:** `@cyanheads/mcp-ts-core`
4
- **Version:** 0.13.2
4
+ **Version:** 0.13.3
5
5
  **Engines:** Bun ≥1.4.0, Node ≥24.0.0
6
6
  **MCP SDK:** `@modelcontextprotocol/server` ^2.0.0 (protocol revisions 2026-07-28 and 2025-*)
7
- **Zod:** ^4.6.2
7
+ **Zod:** ^4.6.5
8
8
  **GitHub:** [cyanheads/mcp-ts-core](https://github.com/cyanheads/mcp-ts-core)
9
9
  **npm:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core)
10
10
  **Docker:** [ghcr.io/cyanheads/mcp-ts-core](https://ghcr.io/cyanheads/mcp-ts-core)
@@ -22,7 +22,7 @@ This package serves two consumer paths. When making changes, know which audience
22
22
  | **Direct package import** — existing project pulls in the package | `bun add @cyanheads/mcp-ts-core` → `import { createApp, tool, z } from '@cyanheads/mcp-ts-core'` | Public API surface (`src/`) — existing consumers feel changes immediately on upgrade |
23
23
  | **Init-scaffolded server** — fresh project bootstrapped from this repo's templates | `bunx @cyanheads/mcp-ts-core init [name]` copies `templates/` into the new directory | `templates/` — only affects newly scaffolded servers, not existing ones |
24
24
 
25
- Both paths share the same public API. Init copies starter `package.json`, configs (`tsconfig`, `biome.json`, `vitest.config.ts`, `devcheck.config.json`, `bunfig.toml`), `.env.example`, `Dockerfile`, `LICENSE`, `.gitattributes`, `CLAUDE.md`/`AGENTS.md`, `.github/` (issue forms, `CONTRIBUTING.md`, `CODE_OF_CONDUCT.md`, `SECURITY.md`), example definitions and tests, framework `scripts/`, and external-audience `framework-skills/`. `_`-prefixed files (e.g. `_.gitignore`) drop the prefix on copy. Existing files are never overwritten; `init` without a name scaffolds in place (upgrade flow). After init, consult the `setup` skill.
25
+ Both paths share the same public API. Init copies starter `package.json`, configs (`tsconfig`, `biome.json`, `vitest.config.ts`, `devcheck.config.json`, `bunfig.toml`), `.env.example`, `Dockerfile`, `LICENSE`, `.gitattributes`, `CLAUDE.md`/`AGENTS.md`, `.github/` (issue forms, `CONTRIBUTING.md`, `CODE_OF_CONDUCT.md`, `SECURITY.md`, `workflows/codeql.yml`), example definitions and tests, framework `scripts/`, and external-audience `framework-skills/`. `_`-prefixed files (e.g. `_.gitignore`) drop the prefix on copy. Existing files are never overwritten; `init` without a name scaffolds in place (upgrade flow). After init, consult the `setup` skill.
26
26
 
27
27
  ---
28
28
 
@@ -414,9 +414,9 @@ Available factories: `invalidParams`, `invalidRequest`, `notFound`, `forbidden`,
414
414
 
415
415
  For HTTP responses from upstream APIs, use `httpErrorFromResponse(response, { service, data })` from `/utils` — maps the full status table (401/403/408/422/429/5xx) and captures body + `Retry-After`.
416
416
 
417
- **Auto-classification.** Plain `Error`, `ZodError`, and any other thrown value are caught and classified automatically. Resolution order: `McpError` code (preserved as-is) → SDK `ConnectionClosed` (→ `RequestCancelled`) → JS constructor name (`TypeError` → `ValidationError`) → provider patterns (HTTP status codes, AWS errors, DB errors) → common message patterns → `AbortError` name (→ `Timeout`) → `InternalError` fallback.
417
+ **Auto-classification.** Plain `Error`, `ZodError`, and any other thrown value are caught and classified automatically. Resolution order: request signal already aborted (→ `RequestCancelled`, outranking the thrown value's own code, `McpError` included) → `McpError` code (preserved as-is) → SDK `ConnectionClosed` (→ `RequestCancelled`) → JS constructor name (`TypeError` → `ValidationError`) → provider patterns (HTTP status codes, AWS errors, DB errors) → common message patterns → `AbortError` name (→ `Timeout`) → `InternalError` fallback.
418
418
 
419
- **Error-path parity.** Tool errors: `content[]` carries markdown with `data.recovery.hint`; `structuredContent.error` carries `{ code, message, data? }`. No `_meta.error`. Resources re-throw via JSON-RPC error envelope.
419
+ **Error-path parity.** Tool errors: `content[]` carries markdown with `data.recovery.hint`; `structuredContent.error` carries `{ code, message, data? }`. No `_meta.error`. Resources re-throw via JSON-RPC error envelope. An argument rejection is one of them: `-32602` with `data.issues`, plus `data.reason: 'invalid_arguments'` and a hint synthesized from the issues and the root schema — never a tool-declared `reason`, since the handler never ran.
420
420
 
421
421
  **Lint rules** (all warnings, surfaced in `devcheck`): `prefer-mcp-error-in-handler`, `prefer-error-factory`, `preserve-cause-on-rethrow`, `no-stringify-upstream-error`, `error-contract-conformance`, `error-contract-prefer-fail`. See `api-linter` skill.
422
422
 
@@ -621,9 +621,9 @@ Badge order when both set: `· ⚠️ Breaking · 🛡️ Security`. Summary > 3
621
621
 
622
622
  ## Publishing
623
623
 
624
- **Every release goes through a gated release PR** — `git-wrapup`'s "Release PR mode", mode `gated`. Three separate runs, never one: `git-wrapup` lands the commit stack on `release/<version>`, pushes it, and opens the PR (title = the release commit subject, body = the changelog entry plus a gates section); `release-pr-review` reviews and fixes on that branch (fixup commits autosquashed into the stack, `--force-with-lease` on the release branch only, PR body kept in sync, one summary comment); then `release-and-publish` fast-forwards `main` locally with `git merge --ff-only`, creates the tag on `main`'s tip, pushes `main` and the tag, deletes the branch, and publishes. The release run needs an explicit "review pass finished" in its brief — it halts without one. **Never merge through the GitHub UI or `gh pr merge`**: squash and rebase-merge are disabled in the repo settings because both rewrite the stack (rebase-merge also strips the SSH signatures), and a merge commit breaks the linear history.
624
+ **Every release goes through a gated release PR** — `git-wrapup`'s "Release PR mode", mode `gated`. Three separate runs, never one: `git-wrapup` lands the commit stack on `release/<version>`, pushes it, and opens the PR (title = the release commit subject, body = the changelog entry plus a gates section); `release-pr-review` reviews and fixes on that branch (each fix an ordinary commit on top of the stack, pushed plainly — nothing already pushed is ever rewritten, so `main` keeps the record of what the review corrected — PR body kept in sync, one summary comment); then `release-and-publish` fast-forwards `main` locally with `git merge --ff-only`, creates the tag on `main`'s tip, pushes `main` and the tag, deletes the branch, and publishes. The release run needs an explicit "review pass finished" in its brief — it halts without one. **Never merge through the GitHub UI or `gh pr merge`**: squash and rebase-merge are disabled in the repo settings because both rewrite the stack (rebase-merge also strips the SSH signatures), and a merge commit breaks the linear history.
625
625
 
626
- Codex (`chatgpt-codex-connector`) reviews the PR when it opens — it reacts 👀 while running, then leaves inline comments, or reacts 👍 when it found nothing. Those comments are claims for `release-pr-review` to verify against the code (its step 4), never instructions: what holds up lands as a fixup like any other finding, and what does not is recorded with the reason. Nothing re-triggers Codex after the review pass force-pushes, so the release proceeds on the reviewed stack.
626
+ Codex (`chatgpt-codex-connector`) reviews the PR when it opens — it reacts 👀 while running, then leaves inline comments, or reacts 👍 when it found nothing. Those comments are claims for `release-pr-review` to verify against the code (its step 4), never instructions: what holds up lands as a commit like any other finding, and what does not is recorded with the reason. Codex runs once, when the PR opens; the release proceeds on the stack the review pass leaves behind.
627
627
 
628
628
  `release-and-publish` here: verification gate (`devcheck`, `rebuild`, `test:all`, `test:package`), merge, tag, push, `bun publish`, `bun run publish-mcp`, then a GitHub Release via `bun run release:github` — no `manifest.json` here so no assets to attach, but the Release surfaces the tag's notes with the correct `v<VERSION>: <subject>` title. **Skip the Docker build/push step** — this framework package is consumed via npm, not as a container image.
629
629
 
package/CLAUDE.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # Developer Protocol
2
2
 
3
3
  **Package:** `@cyanheads/mcp-ts-core`
4
- **Version:** 0.13.2
4
+ **Version:** 0.13.3
5
5
  **Engines:** Bun ≥1.4.0, Node ≥24.0.0
6
6
  **MCP SDK:** `@modelcontextprotocol/server` ^2.0.0 (protocol revisions 2026-07-28 and 2025-*)
7
- **Zod:** ^4.6.2
7
+ **Zod:** ^4.6.5
8
8
  **GitHub:** [cyanheads/mcp-ts-core](https://github.com/cyanheads/mcp-ts-core)
9
9
  **npm:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core)
10
10
  **Docker:** [ghcr.io/cyanheads/mcp-ts-core](https://ghcr.io/cyanheads/mcp-ts-core)
@@ -22,7 +22,7 @@ This package serves two consumer paths. When making changes, know which audience
22
22
  | **Direct package import** — existing project pulls in the package | `bun add @cyanheads/mcp-ts-core` → `import { createApp, tool, z } from '@cyanheads/mcp-ts-core'` | Public API surface (`src/`) — existing consumers feel changes immediately on upgrade |
23
23
  | **Init-scaffolded server** — fresh project bootstrapped from this repo's templates | `bunx @cyanheads/mcp-ts-core init [name]` copies `templates/` into the new directory | `templates/` — only affects newly scaffolded servers, not existing ones |
24
24
 
25
- Both paths share the same public API. Init copies starter `package.json`, configs (`tsconfig`, `biome.json`, `vitest.config.ts`, `devcheck.config.json`, `bunfig.toml`), `.env.example`, `Dockerfile`, `LICENSE`, `.gitattributes`, `CLAUDE.md`/`AGENTS.md`, `.github/` (issue forms, `CONTRIBUTING.md`, `CODE_OF_CONDUCT.md`, `SECURITY.md`), example definitions and tests, framework `scripts/`, and external-audience `framework-skills/`. `_`-prefixed files (e.g. `_.gitignore`) drop the prefix on copy. Existing files are never overwritten; `init` without a name scaffolds in place (upgrade flow). After init, consult the `setup` skill.
25
+ Both paths share the same public API. Init copies starter `package.json`, configs (`tsconfig`, `biome.json`, `vitest.config.ts`, `devcheck.config.json`, `bunfig.toml`), `.env.example`, `Dockerfile`, `LICENSE`, `.gitattributes`, `CLAUDE.md`/`AGENTS.md`, `.github/` (issue forms, `CONTRIBUTING.md`, `CODE_OF_CONDUCT.md`, `SECURITY.md`, `workflows/codeql.yml`), example definitions and tests, framework `scripts/`, and external-audience `framework-skills/`. `_`-prefixed files (e.g. `_.gitignore`) drop the prefix on copy. Existing files are never overwritten; `init` without a name scaffolds in place (upgrade flow). After init, consult the `setup` skill.
26
26
 
27
27
  ---
28
28
 
@@ -414,9 +414,9 @@ Available factories: `invalidParams`, `invalidRequest`, `notFound`, `forbidden`,
414
414
 
415
415
  For HTTP responses from upstream APIs, use `httpErrorFromResponse(response, { service, data })` from `/utils` — maps the full status table (401/403/408/422/429/5xx) and captures body + `Retry-After`.
416
416
 
417
- **Auto-classification.** Plain `Error`, `ZodError`, and any other thrown value are caught and classified automatically. Resolution order: `McpError` code (preserved as-is) → SDK `ConnectionClosed` (→ `RequestCancelled`) → JS constructor name (`TypeError` → `ValidationError`) → provider patterns (HTTP status codes, AWS errors, DB errors) → common message patterns → `AbortError` name (→ `Timeout`) → `InternalError` fallback.
417
+ **Auto-classification.** Plain `Error`, `ZodError`, and any other thrown value are caught and classified automatically. Resolution order: request signal already aborted (→ `RequestCancelled`, outranking the thrown value's own code, `McpError` included) → `McpError` code (preserved as-is) → SDK `ConnectionClosed` (→ `RequestCancelled`) → JS constructor name (`TypeError` → `ValidationError`) → provider patterns (HTTP status codes, AWS errors, DB errors) → common message patterns → `AbortError` name (→ `Timeout`) → `InternalError` fallback.
418
418
 
419
- **Error-path parity.** Tool errors: `content[]` carries markdown with `data.recovery.hint`; `structuredContent.error` carries `{ code, message, data? }`. No `_meta.error`. Resources re-throw via JSON-RPC error envelope.
419
+ **Error-path parity.** Tool errors: `content[]` carries markdown with `data.recovery.hint`; `structuredContent.error` carries `{ code, message, data? }`. No `_meta.error`. Resources re-throw via JSON-RPC error envelope. An argument rejection is one of them: `-32602` with `data.issues`, plus `data.reason: 'invalid_arguments'` and a hint synthesized from the issues and the root schema — never a tool-declared `reason`, since the handler never ran.
420
420
 
421
421
  **Lint rules** (all warnings, surfaced in `devcheck`): `prefer-mcp-error-in-handler`, `prefer-error-factory`, `preserve-cause-on-rethrow`, `no-stringify-upstream-error`, `error-contract-conformance`, `error-contract-prefer-fail`. See `api-linter` skill.
422
422
 
@@ -621,9 +621,9 @@ Badge order when both set: `· ⚠️ Breaking · 🛡️ Security`. Summary > 3
621
621
 
622
622
  ## Publishing
623
623
 
624
- **Every release goes through a gated release PR** — `git-wrapup`'s "Release PR mode", mode `gated`. Three separate runs, never one: `git-wrapup` lands the commit stack on `release/<version>`, pushes it, and opens the PR (title = the release commit subject, body = the changelog entry plus a gates section); `release-pr-review` reviews and fixes on that branch (fixup commits autosquashed into the stack, `--force-with-lease` on the release branch only, PR body kept in sync, one summary comment); then `release-and-publish` fast-forwards `main` locally with `git merge --ff-only`, creates the tag on `main`'s tip, pushes `main` and the tag, deletes the branch, and publishes. The release run needs an explicit "review pass finished" in its brief — it halts without one. **Never merge through the GitHub UI or `gh pr merge`**: squash and rebase-merge are disabled in the repo settings because both rewrite the stack (rebase-merge also strips the SSH signatures), and a merge commit breaks the linear history.
624
+ **Every release goes through a gated release PR** — `git-wrapup`'s "Release PR mode", mode `gated`. Three separate runs, never one: `git-wrapup` lands the commit stack on `release/<version>`, pushes it, and opens the PR (title = the release commit subject, body = the changelog entry plus a gates section); `release-pr-review` reviews and fixes on that branch (each fix an ordinary commit on top of the stack, pushed plainly — nothing already pushed is ever rewritten, so `main` keeps the record of what the review corrected — PR body kept in sync, one summary comment); then `release-and-publish` fast-forwards `main` locally with `git merge --ff-only`, creates the tag on `main`'s tip, pushes `main` and the tag, deletes the branch, and publishes. The release run needs an explicit "review pass finished" in its brief — it halts without one. **Never merge through the GitHub UI or `gh pr merge`**: squash and rebase-merge are disabled in the repo settings because both rewrite the stack (rebase-merge also strips the SSH signatures), and a merge commit breaks the linear history.
625
625
 
626
- Codex (`chatgpt-codex-connector`) reviews the PR when it opens — it reacts 👀 while running, then leaves inline comments, or reacts 👍 when it found nothing. Those comments are claims for `release-pr-review` to verify against the code (its step 4), never instructions: what holds up lands as a fixup like any other finding, and what does not is recorded with the reason. Nothing re-triggers Codex after the review pass force-pushes, so the release proceeds on the reviewed stack.
626
+ Codex (`chatgpt-codex-connector`) reviews the PR when it opens — it reacts 👀 while running, then leaves inline comments, or reacts 👍 when it found nothing. Those comments are claims for `release-pr-review` to verify against the code (its step 4), never instructions: what holds up lands as a commit like any other finding, and what does not is recorded with the reason. Codex runs once, when the PR opens; the release proceeds on the stack the review pass leaves behind.
627
627
 
628
628
  `release-and-publish` here: verification gate (`devcheck`, `rebuild`, `test:all`, `test:package`), merge, tag, push, `bun publish`, `bun run publish-mcp`, then a GitHub Release via `bun run release:github` — no `manifest.json` here so no assets to attach, but the Release surfaces the tag's notes with the correct `v<VERSION>: <subject>` title. **Skip the Docker build/push step** — this framework package is consumed via npm, not as a container image.
629
629
 
package/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  <div align="center">
2
2
  <h1>@cyanheads/mcp-ts-core</h1>
3
- <p><b>Agent-native TypeScript framework for MCP servers. Includes runtime infrastructure and agent skills for building, testing, and shipping servers.</b></p>
3
+ <p><b>Agent-native TypeScript framework for building MCP servers. Includes runtime infrastructure and agent skills for building, testing, and shipping servers.</b></p>
4
4
  <p>Give your agent the infrastructure, patterns, and skills to build and ship your server.</p>
5
5
  </div>
6
6
 
7
7
  <div align="center">
8
8
 
9
- [![Version](https://img.shields.io/badge/Version-0.13.2-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![MCP Spec](https://img.shields.io/badge/MCP%20Spec-2026--07--28-8A2BE2.svg?style=flat-square)](https://modelcontextprotocol.io/specification/2026-07-28)
9
+ [![Version](https://img.shields.io/badge/Version-0.13.3-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![MCP Spec](https://img.shields.io/badge/MCP%20Spec-2026--07--28-8A2BE2.svg?style=flat-square)](https://modelcontextprotocol.io/specification/2026-07-28)
10
10
 
11
11
  [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^2.0.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![TypeScript](https://img.shields.io/badge/TypeScript-^7.0.2-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.4.0%2B-blueviolet.svg?style=flat-square)](https://bun.sh/)
12
12
 
@@ -0,0 +1,44 @@
1
+ ---
2
+ summary: "Argument rejections carry a reason and a schema-derived recovery hint, and render an omitted required field as missing rather than as a wrong choice. A handler unwound after its request was cancelled classifies RequestCancelled whatever it threw."
3
+ breaking: false
4
+ security: false
5
+ agent-notes: |
6
+ Two adoption steps for a consumer upgrading from 0.13.2.
7
+
8
+ 1. Every argument rejection's `content[0].text` now ends with a
9
+ `\n\nRecovery: <hint>` suffix, and its `data` carries
10
+ `reason: "invalid_arguments"`. `runToolContract` routes through the
11
+ production rejection path, so a test pinning that text byte-exact fails on
12
+ upgrade — assert that it *contains* the offending field instead.
13
+ `toolContractSuite` asserts only the `Error:` prefix and is unaffected.
14
+ 2. A cancelled call now logs at `info` with `metrics.errorCode: "-32011"`. A
15
+ dashboard or alert keyed on `UNKNOWN_ERROR` / `InternalError` to count
16
+ client disconnects no longer matches — key it on `-32011`.
17
+ ---
18
+
19
+ # 0.13.3 — 2026-09-17
20
+
21
+ ## Added
22
+
23
+ - **`data.reason: "invalid_arguments"` and a synthesized `data.recovery.hint` on every argument rejection** ([#445](https://github.com/cyanheads/mcp-ts-core/issues/445)). The hint is derived from the Zod issues, the arguments as sent, and the root schema: an unknown key names the root properties the tool does accept, a wrong type names the type to send instead, and missing fields collapse into one `Provide …` sentence. It rides `content[]` as `Recovery: …` like any handler-thrown hint. A `z.discriminatedUnion()` root omits the accepted-key list, since no single call accepts the union of every variant's keys.
24
+ - **`.github/workflows/codeql.yml`, at the repo root and in the scaffold** — the one workflow a server carries, copied by `init`. It runs only while the repo's CodeQL *default setup* is off.
25
+
26
+ ## Changed
27
+
28
+ - **A required field omitted from an enum or literal renders as missing** ([#378](https://github.com/cyanheads/mcp-ts-core/issues/378)) — `what: Missing required field. Expected one of "os"|"cpu"|"memory"`, where an omission and a wrong choice were previously byte-identical. A value outside the set keeps Zod's invalid-option sentence. Absence is resolved from the arguments in-process, so no value a caller sent is copied onto `data.issues`.
29
+ - **A union rejection renders its branch messages** ([#417](https://github.com/cyanheads/mcp-ts-core/issues/417)) joined by ` or `, instead of Zod's `Invalid input` placeholder. A branch whose only issue is a single-valued `invalid_value` — the `z.literal('')` blank-field sentinel — is skipped.
30
+ - **The scaffold's `instructions` comment shows the shape to write** — two to three cohesive sentences in one string literal, addressed to the calling agent, with operator configuration left to the README. `tool-defs-analysis` checks the same shape on `description` and `instructions`.
31
+ - Skill versions: `api-errors` 1.10 → 1.12, `git-wrapup` 1.17 → 1.18, `orchestrations` 1.9 → 1.10, `release-and-publish` 2.17 → 2.18, `release-pr-review` 1.1 → 1.3, `tool-defs-analysis` 1.5 → 1.6.
32
+
33
+ ## Fixed
34
+
35
+ - **A handler unwound after its request's abort signal fired classifies `RequestCancelled` (`-32011`)** ([#421](https://github.com/cyanheads/mcp-ts-core/issues/421)) whatever it threw — a `notifications/cancelled` `reason` string, the `AbortError` `DOMException` a reason-less cancellation leaves, a service's own `McpError`. It is resolved inside the measured region of both handler factories, so the completion log's `metrics.errorCode` and the execution span carry `-32011` too, and the record logs at `info` with neither a stack nor a cause chain. A throw raised while the signal is still live is untouched.
36
+ - **`git-wrapup` step 7 and `release-pr-review` step 5 commit by pathspec** ([#444](https://github.com/cyanheads/mcp-ts-core/issues/444)) — `git commit --only <paths>`, so anything staged before the run (a migration's `git mv`, a hook's output, a concurrent session) cannot ride into the first concern's commit. `release-pr-review` step 5 lands each review fix as an ordinary commit on top of the release branch and pushes plainly, so nothing already pushed is rewritten and `main` keeps the record of what the review corrected. `git-wrapup` step 1 also diffs against `HEAD` rather than the index, so a pre-staged group is reviewed rather than skipped.
37
+
38
+ ## Dependencies
39
+
40
+ - `zod` ^4.6.2 → ^4.6.5
41
+ - `@duckdb/node-api` ^1.5.5-r.4 → ^1.5.5-r.5 (dev)
42
+ - `fast-check` ^4.9.0 → ^4.10.0 (dev)
43
+ - `js-yaml` ^5.4.1 → ^5.4.2 (dev)
44
+ - `tsc-alias` ^1.9.4 → ^1.9.5 (dev; scaffold pin ^1.9.2 → ^1.9.5, alongside `ignore` ^7.0.7 → ^7.0.9)
@@ -1 +1 @@
1
- {"version":3,"file":"resourceHandlerFactory.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/utils/resourceHandlerFactory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,EACb,SAAS,EACV,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAEL,KAAK,eAAe,EAGrB,MAAM,gCAAgC,CAAC;AAExC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oDAAoD,CAAC;AAWhG,gEAAgE;AAChE,YAAY,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACtE,YAAY,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAiBrE;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,OAAO,EACf,IAAI,EAAE;IAAE,GAAG,EAAE,GAAG,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACnC,kBAAkB,CAAC,UAAU,CAAC,CAShC;AAkBD;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,qBAAqB,EAC1B,QAAQ,EAAE,eAAe,EACzB,SAAS,EAAE,eAAe,GACzB,CACD,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,aAAa,KACf,OAAO,CAAC,kBAAkB,GAAG,mBAAmB,CAAC,CAsErD"}
1
+ {"version":3,"file":"resourceHandlerFactory.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/utils/resourceHandlerFactory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,EACb,SAAS,EACV,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAEL,KAAK,eAAe,EAGrB,MAAM,gCAAgC,CAAC;AAExC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oDAAoD,CAAC;AAWhG,gEAAgE;AAChE,YAAY,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACtE,YAAY,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAiBrE;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,OAAO,EACf,IAAI,EAAE;IAAE,GAAG,EAAE,GAAG,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACnC,kBAAkB,CAAC,UAAU,CAAC,CAShC;AAkBD;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,qBAAqB,EAC1B,QAAQ,EAAE,eAAe,EACzB,SAAS,EAAE,eAAe,GACzB,CACD,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,aAAa,KACf,OAAO,CAAC,kBAAkB,GAAG,mBAAmB,CAAC,CA6ErD"}
@@ -7,7 +7,7 @@ import { buildHandlerContext, handlerParentContext, resolveHandlerRequest, } fro
7
7
  import { isInputRequiredSignal } from '../../inputRequired.js';
8
8
  import { withRequiredScopes } from '../../transports/auth/lib/authUtils.js';
9
9
  import { McpError } from '../../../types-global/errors.js';
10
- import { ErrorHandler } from '../../../utils/internal/error-handler/errorHandler.js';
10
+ import { asRequestCancelled, ErrorHandler } from '../../../utils/internal/error-handler/errorHandler.js';
11
11
  import { measureResourceExecution } from '../../../utils/internal/performance.js';
12
12
  import { requestContextService } from '../../../utils/internal/requestContext.js';
13
13
  // ---------------------------------------------------------------------------
@@ -94,14 +94,22 @@ export function createResourceHandler(def, services, notifiers) {
94
94
  // the handler returned recorded those as successes (#346).
95
95
  return await measureResourceExecution(async (spanContext, recordOutput) => {
96
96
  const ctx = buildHandlerContext(request, services, spanContext, def.errors, uri);
97
- // Handler may return sync or async.
98
- const handlerResult = await def.handler(validatedParams, ctx);
99
- // The domain value is what `mcp.resource.output_bytes` measures — not
100
- // the assembled `contents` this callback returns.
101
- recordOutput(handlerResult);
102
- // Validate output against schema when defined
103
- const validatedResult = def.output ? def.output.parse(handlerResult) : handlerResult;
104
- return { contents: formatter(validatedResult, { uri, mimeType }) };
97
+ try {
98
+ // Handler may return sync or async.
99
+ const handlerResult = await def.handler(validatedParams, ctx);
100
+ // The domain value is what `mcp.resource.output_bytes` measures not
101
+ // the assembled `contents` this callback returns.
102
+ recordOutput(handlerResult);
103
+ // Validate output against schema when defined
104
+ const validatedResult = def.output ? def.output.parse(handlerResult) : handlerResult;
105
+ return { contents: formatter(validatedResult, { uri, mimeType }) };
106
+ }
107
+ catch (error) {
108
+ // Inside the measurement on purpose: the completion log's
109
+ // `metrics.errorCode` and the span's error-code attribute are
110
+ // derived from what leaves this callback (#421).
111
+ throw asRequestCancelled(error, request.signal);
112
+ }
105
113
  }, { ...appContext, resourceName }, { uri: resourceUri, mimeType });
106
114
  }
107
115
  catch (error) {
@@ -1 +1 @@
1
- {"version":3,"file":"resourceHandlerFactory.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/utils/resourceHandlerFactory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,EACL,mBAAmB,EAEnB,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAGtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACnF,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,gDAAgD,CAAC;AAC9E,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAU3E,8EAA8E;AAC9E,oBAAoB;AACpB,8EAA8E;AAE9E,SAAS,cAAc,CAAC,QAAgB;IACtC,MAAM,kBAAkB,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,C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E,QAAQ,EAAE,CAC/B,CAAC;QACJ,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,oEAAoE;YACpE,uEAAuE;YACvE,IAAI,qBAAqB,CAAC,KAAK,CAAC;gBAAE,OAAO,KAAK,CAAC,MAAM,CAAC;YAEtD,4EAA4E;YAC5E,IAAI,KAAK,YAAY,QAAQ,EAAE,CAAC;gBAC9B,MAAM,KAAK,CAAC;YACd,CAAC;YACD,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,YAAY,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;YACjE,MAAM,IAAI,QAAQ,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;QAC5D,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
@@ -45,13 +45,19 @@ export declare function buildToolErrorResult(code: JsonRpcErrorCode, message: st
45
45
  * is unchanged for clients that read `content[]` text. The framework owns this
46
46
  * rejection (see `deferInputValidation`) purely so it can also carry
47
47
  * `structuredContent.error`.
48
+ *
49
+ * `args` are the caller's raw arguments, read only through
50
+ * {@link readArgumentAt}; see {@link renderIssueMessage} for what that decides.
48
51
  */
49
- export declare function formatInputValidationMessage(toolName: string, error: ZodError): string;
52
+ export declare function formatInputValidationMessage(toolName: string, error: ZodError, args: unknown): string;
50
53
  /**
51
54
  * Validates raw tool arguments against the definition's `input` schema, or
52
55
  * throws the rejection a client receives on the wire: `InvalidParams`
53
- * (`-32602`), the message {@link formatInputValidationMessage} renders, and the
54
- * Zod issues as `data.issues`.
56
+ * (`-32602`), the message {@link formatInputValidationMessage} renders, the Zod
57
+ * issues as `data.issues`, and — as with any other declared failure —
58
+ * `data.reason` plus a `data.recovery.hint` {@link buildArgumentRecoveryHint}
59
+ * synthesizes (#445). {@link buildToolErrorResult} mirrors that hint into
60
+ * `content[]`, so it reaches format()-only clients with no extra work.
55
61
  *
56
62
  * The single argument-rejection path. {@link createToolHandler} and the
57
63
  * `runToolContract` test helper both route through it, so a test written to
@@ -1 +1 @@
1
- {"version":3,"file":"toolHandlerFactory.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/utils/toolHandlerFactory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,YAAY,EACZ,mBAAmB,EACnB,aAAa,EACd,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,QAAQ,EAAE,KAAK,SAAS,EAAE,KAAK,WAAW,EAAgB,CAAC,EAAE,MAAM,KAAK,CAAC;AAElF,OAAO,KAAK,EAAE,OAAO,EAAmB,MAAM,mBAAmB,CAAC;AAElE,OAAO,EAEL,KAAK,eAAe,EAGrB,MAAM,gCAAgC,CAAC;AAExC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAErE,OAAO,EAAiB,gBAAgB,EAAY,MAAM,0BAA0B,CAAC;AAKrF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAM7D,oEAAoE;AACpE,YAAY,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACtE,YAAY,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAUrE;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,iBAAiB,EACtB,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACxC,GAAG,EAAE,OAAO,GACX,YAAY,EAAE,CAahB;AAiBD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,gBAAgB,EACtB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GACxC,cAAc,CAchB;AAED;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,GAAG,MAAM,CASt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CAAC,KAAK,EAAE,OAAO,GAAG,cAAc,CAO9E;AAMD;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,iBAAiB,GAAG,SAAS,CAAC,WAAW,CAAC,CAGpF;AAmDD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,iBAAiB,GAAG,SAAS,CAAC,WAAW,CAAC,CAkCrF;AA0GD;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,iBAAiB,EACtB,GAAG,EAAE,OAAO,EACZ,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACxC,aAAa,EAAE,YAAY,EAAE,GAC5B,IAAI,CAAC,cAAc,EAAE,SAAS,GAAG,mBAAmB,CAAC,CAkBvD;AAMD;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,iBAAiB,EACtB,QAAQ,EAAE,eAAe,EACzB,SAAS,EAAE,eAAe,GACzB,CACD,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,GAAG,EAAE,aAAa,KACf,OAAO,CAAC,cAAc,GAAG,mBAAmB,CAAC,CAmFjD"}
@@ -9,10 +9,11 @@ import { buildHandlerContext, handlerParentContext, resolveHandlerRequest, } fro
9
9
  import { isInputRequiredSignal } from '../../inputRequired.js';
10
10
  import { withRequiredScopes } from '../../transports/auth/lib/authUtils.js';
11
11
  import { internalError, JsonRpcErrorCode, McpError } from '../../../types-global/errors.js';
12
- import { ErrorHandler } from '../../../utils/internal/error-handler/errorHandler.js';
12
+ import { asRequestCancelled, ErrorHandler } from '../../../utils/internal/error-handler/errorHandler.js';
13
13
  import { measureToolExecution } from '../../../utils/internal/performance.js';
14
14
  import { requestContextService } from '../../../utils/internal/requestContext.js';
15
15
  import { ATTR_MCP_TOOL_ENRICHED } from '../../../utils/telemetry/attributes.js';
16
+ import { isZodObjectSchema } from './schemaShape.js';
16
17
  // ---------------------------------------------------------------------------
17
18
  // Default formatter
18
19
  // ---------------------------------------------------------------------------
@@ -82,26 +83,193 @@ export function buildToolErrorResult(code, message, data) {
82
83
  },
83
84
  };
84
85
  }
86
+ /** The framework-owned `data.reason` on every argument rejection (#445). */
87
+ const INVALID_ARGUMENTS_REASON = 'invalid_arguments';
88
+ /** What {@link readArgumentAt} returns when the raw arguments carry no value there. */
89
+ const ABSENT = Symbol('absent');
90
+ /**
91
+ * The value the raw arguments carry at `path`, or {@link ABSENT}.
92
+ *
93
+ * The one resolver behind #378's missing-vs-wrong rendering and #445's
94
+ * missing-required hint, which ask the same question of the same arguments.
95
+ * Zod's `invalid_value` issue names an expected set and nothing else, so an
96
+ * omitted field and a wrong choice are otherwise indistinguishable. Resolving
97
+ * it here keeps the caller's value in-process: only the absent/present bit and
98
+ * the arriving *type* reach a rendered sentence, unlike Zod's `reportInput`
99
+ * option, which would copy every rejected value onto `data.issues`.
100
+ *
101
+ * A key present with an explicit `null` is present — the caller supplied a
102
+ * value, it was the wrong one. A key present with `undefined` is absent, which
103
+ * is how Zod itself reads it.
104
+ */
105
+ function readArgumentAt(args, path) {
106
+ let cursor = args;
107
+ for (const segment of path) {
108
+ if (cursor === null || typeof cursor !== 'object')
109
+ return ABSENT;
110
+ if (!Object.hasOwn(cursor, segment))
111
+ return ABSENT;
112
+ cursor = cursor[segment];
113
+ }
114
+ return cursor === undefined ? ABSENT : cursor;
115
+ }
116
+ /** The accepted-value half of an `invalid_value` sentence, from the issue's own values. */
117
+ function expectedValuesText(values) {
118
+ const rendered = values.map((value) => JSON.stringify(value)).join('|');
119
+ return values.length === 1 ? `Expected ${rendered}` : `Expected one of ${rendered}`;
120
+ }
121
+ /**
122
+ * The union branches worth rendering: every branch except one whose only issue
123
+ * is a single-valued `invalid_value`.
124
+ *
125
+ * That shape is the `z.literal('')` blank-field sentinel of the form-client
126
+ * convention — never the branch that says what would have been accepted. The
127
+ * filter reads issue shape only, never message text, so a one-entry
128
+ * `z.enum([...])` (which Zod reports identically) is filtered too and the
129
+ * caller falls back to the union's own message.
130
+ */
131
+ function selectUnionBranches(branches) {
132
+ return branches.filter((branch) => {
133
+ const only = branch.length === 1 ? branch[0] : undefined;
134
+ return !(only?.code === 'invalid_value' && only.values.length === 1);
135
+ });
136
+ }
137
+ /**
138
+ * The readable half of one issue's rendered line.
139
+ *
140
+ * Two rewrites, both keeping `data.issues` and the envelope shape untouched:
141
+ *
142
+ * - **#417** — Zod reports a union whose every branch aborted as one
143
+ * `invalid_union` issue whose own message is the placeholder `Invalid input`;
144
+ * what would have been accepted lives on the nested branch issues. Render the
145
+ * selected branches instead, joined by ` or `. (When exactly one branch
146
+ * matched the base type and failed only a check, Zod returns that branch's
147
+ * issues directly and this never fires.)
148
+ * - **#378** — an `invalid_value` issue (`z.enum`, `z.literal`) names an
149
+ * expected set without naming what arrived, so an omitted field and a wrong
150
+ * choice render identically. When the key is `absent`, say so and keep the
151
+ * expected set, which is the guidance a caller needs to fill the field in on
152
+ * one retry.
153
+ *
154
+ * On a required union field both compose: the branch is selected first, then
155
+ * the absence check decides how that branch's message renders.
156
+ */
157
+ function renderIssueMessage(issue, absent) {
158
+ if (issue.code === 'invalid_union') {
159
+ const branches = selectUnionBranches(issue.errors);
160
+ if (branches.length === 0)
161
+ return issue.message;
162
+ const rendered = branches.map((branch) => branch.map((branchIssue) => renderIssueMessage(branchIssue, absent)).join(', '));
163
+ return [...new Set(rendered)].join(' or ');
164
+ }
165
+ if (absent && issue.code === 'invalid_value') {
166
+ return `Missing required field. ${expectedValuesText(issue.values)}`;
167
+ }
168
+ return issue.message;
169
+ }
85
170
  /**
86
171
  * Renders an argument-validation failure the way the MCP SDK renders its own,
87
172
  * so the readable diagnostic — the offending key or field, and why it failed —
88
173
  * is unchanged for clients that read `content[]` text. The framework owns this
89
174
  * rejection (see `deferInputValidation`) purely so it can also carry
90
175
  * `structuredContent.error`.
176
+ *
177
+ * `args` are the caller's raw arguments, read only through
178
+ * {@link readArgumentAt}; see {@link renderIssueMessage} for what that decides.
91
179
  */
92
- export function formatInputValidationMessage(toolName, error) {
180
+ export function formatInputValidationMessage(toolName, error, args) {
93
181
  const detail = error.issues
94
- .map((issue) => issue.path.length > 0
95
- ? `${issue.path.map(String).join('.')}: ${issue.message}`
96
- : issue.message)
182
+ .map((issue) => {
183
+ const message = renderIssueMessage(issue, readArgumentAt(args, issue.path) === ABSENT);
184
+ return issue.path.length > 0 ? `${issue.path.map(String).join('.')}: ${message}` : message;
185
+ })
97
186
  .join(', ');
98
187
  return `Input validation error: Invalid arguments for tool ${toolName}: ${detail}`;
99
188
  }
189
+ /** `a number`, `an array` — the indefinite article a type name reads with. */
190
+ function withArticle(typeName) {
191
+ return `${/^[aeiou]/.test(typeName) ? 'an' : 'a'} ${typeName}`;
192
+ }
193
+ /** How a raw argument's JS type reads in the wrong-type sentence. */
194
+ function arrivedTypeText(value) {
195
+ if (value === null)
196
+ return 'null';
197
+ return withArticle(Array.isArray(value) ? 'array' : typeof value);
198
+ }
199
+ /** `lat`, `lat and lon`, `lat, lon and alt`. */
200
+ function joinNames(names) {
201
+ if (names.length < 2)
202
+ return names.join('');
203
+ return `${names.slice(0, -1).join(', ')} and ${names.at(-1)}`;
204
+ }
205
+ /**
206
+ * The root property names a tool advertises, in schema order — the accepted-key
207
+ * list of an unknown-key hint.
208
+ *
209
+ * Empty for a `z.discriminatedUnion()` root: `strictenInput` strictens each
210
+ * variant, so `unrecognized_keys` does fire there, but the issue carries no way
211
+ * to know which variant matched, and the union of every variant's keys would
212
+ * claim the tool accepts a set no single call does.
213
+ */
214
+ function rootPropertyNames(input) {
215
+ return isZodObjectSchema(input) ? Object.keys(input.shape) : [];
216
+ }
217
+ /**
218
+ * Synthesizes `data.recovery.hint` from the Zod issues, the raw arguments, and
219
+ * the root schema (#445) — so the one failure a weaker model hits most often
220
+ * carries the same next step every handler-thrown error does, instead of
221
+ * costing a round trip for the schema.
222
+ *
223
+ * One sentence per issue, joined into a single hint, except that every missing
224
+ * required field collapses into one `Provide …` sentence at the first of their
225
+ * positions. An issue no bucket claims contributes its rendered message
226
+ * unchanged, which keeps the hint nonempty for any rejection Zod can produce.
227
+ */
228
+ function buildArgumentRecoveryHint(def, error, args) {
229
+ const sentences = [];
230
+ const missing = [];
231
+ let missingSlot = -1;
232
+ for (const issue of error.issues) {
233
+ const path = issue.path.map(String).join('.');
234
+ const arrived = readArgumentAt(args, issue.path);
235
+ if (issue.code === 'unrecognized_keys') {
236
+ const label = issue.keys.length === 1 ? 'Unknown key' : 'Unknown keys';
237
+ const accepted = rootPropertyNames(def.input);
238
+ sentences.push(accepted.length > 0
239
+ ? `${label} ${issue.keys.join(', ')}. This tool accepts: ${accepted.join(', ')}.`
240
+ : `${label} ${issue.keys.join(', ')}.`);
241
+ continue;
242
+ }
243
+ if (path.length > 0 && arrived === ABSENT) {
244
+ if (missingSlot < 0) {
245
+ missingSlot = sentences.length;
246
+ sentences.push('');
247
+ }
248
+ missing.push(path);
249
+ continue;
250
+ }
251
+ if (issue.code === 'invalid_type') {
252
+ const subject = path.length > 0 ? path : 'the arguments';
253
+ const expected = withArticle(issue.expected);
254
+ sentences.push(arrived === ABSENT
255
+ ? `Send ${subject} as ${expected}.`
256
+ : `Send ${subject} as ${expected}, not ${arrivedTypeText(arrived)}.`);
257
+ continue;
258
+ }
259
+ sentences.push(renderIssueMessage(issue, false));
260
+ }
261
+ if (missingSlot >= 0)
262
+ sentences[missingSlot] = `Provide ${joinNames(missing)}.`;
263
+ return sentences.join(' ');
264
+ }
100
265
  /**
101
266
  * Validates raw tool arguments against the definition's `input` schema, or
102
267
  * throws the rejection a client receives on the wire: `InvalidParams`
103
- * (`-32602`), the message {@link formatInputValidationMessage} renders, and the
104
- * Zod issues as `data.issues`.
268
+ * (`-32602`), the message {@link formatInputValidationMessage} renders, the Zod
269
+ * issues as `data.issues`, and — as with any other declared failure —
270
+ * `data.reason` plus a `data.recovery.hint` {@link buildArgumentRecoveryHint}
271
+ * synthesizes (#445). {@link buildToolErrorResult} mirrors that hint into
272
+ * `content[]`, so it reaches format()-only clients with no extra work.
105
273
  *
106
274
  * The single argument-rejection path. {@link createToolHandler} and the
107
275
  * `runToolContract` test helper both route through it, so a test written to
@@ -113,7 +281,11 @@ export function formatInputValidationMessage(toolName, error) {
113
281
  export function parseToolArguments(def, input) {
114
282
  const parsed = def.input.safeParse(input);
115
283
  if (!parsed.success) {
116
- throw new McpError(JsonRpcErrorCode.InvalidParams, formatInputValidationMessage(def.name, parsed.error), { issues: parsed.error.issues });
284
+ throw new McpError(JsonRpcErrorCode.InvalidParams, formatInputValidationMessage(def.name, parsed.error, input), {
285
+ issues: parsed.error.issues,
286
+ reason: INVALID_ARGUMENTS_REASON,
287
+ recovery: { hint: buildArgumentRecoveryHint(def, parsed.error, input) },
288
+ });
117
289
  }
118
290
  return parsed.data;
119
291
  }
@@ -428,16 +600,24 @@ export function createToolHandler(def, services, notifiers) {
428
600
  return await measureToolExecution(async (spanContext, recordOutput) => {
429
601
  const handlerCtx = buildHandlerContext(request, services, spanContext, def.errors);
430
602
  ctx = handlerCtx;
431
- // Handler may return sync or async.
432
- const handlerResult = await def.handler(validatedInput, handlerCtx);
433
- // The domain value is what `mcp.tool.output_bytes` and
434
- // partial-success detection measure not the assembled result this
435
- // callback returns, which re-renders it into content[].
436
- recordOutput(handlerResult);
437
- // Render content[] from the domain payload only (Resolution B), then
438
- // merge enrichment into structuredContent and append the content[] trailer.
439
- const validatedResult = def.output.parse(handlerResult);
440
- return buildToolSuccessResult(def, handlerCtx, validatedResult, renderToolContent(def, validatedResult, handlerCtx));
603
+ try {
604
+ // Handler may return sync or async.
605
+ const handlerResult = await def.handler(validatedInput, handlerCtx);
606
+ // The domain value is what `mcp.tool.output_bytes` and
607
+ // partial-success detection measure not the assembled result this
608
+ // callback returns, which re-renders it into content[].
609
+ recordOutput(handlerResult);
610
+ // Render content[] from the domain payload only (Resolution B), then
611
+ // merge enrichment into structuredContent and append the content[] trailer.
612
+ const validatedResult = def.output.parse(handlerResult);
613
+ return buildToolSuccessResult(def, handlerCtx, validatedResult, renderToolContent(def, validatedResult, handlerCtx));
614
+ }
615
+ catch (error) {
616
+ // Inside the measurement on purpose: the completion log's
617
+ // `metrics.errorCode` and the span's error-code attribute are
618
+ // derived from what leaves this callback (#421).
619
+ throw asRequestCancelled(error, request.signal);
620
+ }
441
621
  }, { ...appContext, toolName: def.name }, validatedInput, () => {
442
622
  const store = ctx ? readEnrichmentStore(ctx) : undefined;
443
623
  return store && Object.keys(store.values).length > 0
@@ -1 +1 @@
1
- {"version":3,"file":"toolHandlerFactory.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/utils/toolHandlerFactory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,EAAE,QAAQ,EAAkD,CAAC,EAAE,MAAM,KAAK,CAAC;AAGlF,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EACL,mBAAmB,EAEnB,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,gDAAgD,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAWzE,8EAA8E;AAC9E,oBAAoB;AACpB,8EAA8E;AAE9E,MAAM,wBAAwB,GAAG,CAAC,MAAe,EAAkB,EAAE,CAAC;IACpE,EAAE,IAAI,EAAE,MAAM,EA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