@cyanheads/mcp-ts-core 0.8.2 → 0.8.4

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.
Files changed (39) hide show
  1. package/CLAUDE.md +14 -4
  2. package/README.md +1 -1
  3. package/changelog/0.8.x/0.8.3.md +43 -0
  4. package/changelog/0.8.x/0.8.4.md +60 -0
  5. package/dist/linter/rules/error-contract-rules.d.ts +3 -1
  6. package/dist/linter/rules/error-contract-rules.d.ts.map +1 -1
  7. package/dist/linter/rules/error-contract-rules.js +40 -2
  8. package/dist/linter/rules/error-contract-rules.js.map +1 -1
  9. package/dist/logs/combined.log +4 -4
  10. package/dist/logs/error.log +4 -4
  11. package/dist/mcp-server/resources/resource-registration.d.ts.map +1 -1
  12. package/dist/mcp-server/resources/resource-registration.js +2 -3
  13. package/dist/mcp-server/resources/resource-registration.js.map +1 -1
  14. package/dist/mcp-server/resources/utils/resourceDefinition.d.ts +3 -3
  15. package/dist/mcp-server/tools/tool-registration.d.ts.map +1 -1
  16. package/dist/mcp-server/tools/tool-registration.js +8 -12
  17. package/dist/mcp-server/tools/tool-registration.js.map +1 -1
  18. package/dist/mcp-server/tools/utils/toolDefinition.d.ts +7 -5
  19. package/dist/mcp-server/tools/utils/toolDefinition.d.ts.map +1 -1
  20. package/dist/mcp-server/tools/utils/toolDefinition.js +5 -2
  21. package/dist/mcp-server/tools/utils/toolDefinition.js.map +1 -1
  22. package/dist/mcp-server/tools/utils/toolHandlerFactory.d.ts +28 -0
  23. package/dist/mcp-server/tools/utils/toolHandlerFactory.d.ts.map +1 -1
  24. package/dist/mcp-server/tools/utils/toolHandlerFactory.js +64 -23
  25. package/dist/mcp-server/tools/utils/toolHandlerFactory.js.map +1 -1
  26. package/dist/types-global/errors.d.ts +27 -25
  27. package/dist/types-global/errors.d.ts.map +1 -1
  28. package/dist/types-global/errors.js +0 -19
  29. package/dist/types-global/errors.js.map +1 -1
  30. package/package.json +11 -11
  31. package/skills/add-resource/SKILL.md +1 -1
  32. package/skills/add-tool/SKILL.md +115 -26
  33. package/skills/api-errors/SKILL.md +40 -14
  34. package/skills/api-linter/SKILL.md +1 -1
  35. package/skills/design-mcp-server/SKILL.md +11 -4
  36. package/skills/field-test/SKILL.md +15 -6
  37. package/templates/AGENTS.md +6 -3
  38. package/templates/CLAUDE.md +6 -3
  39. package/templates/src/mcp-server/tools/definitions/echo.tool.ts +19 -1
package/CLAUDE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Agent Protocol
2
2
 
3
- **Package:** `@cyanheads/mcp-ts-core` · **Version:** 0.8.2
3
+ **Package:** `@cyanheads/mcp-ts-core` · **Version:** 0.8.4
4
4
  **npm:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) · **Docker:** [ghcr.io/cyanheads/mcp-ts-core](https://ghcr.io/cyanheads/mcp-ts-core)
5
5
 
6
6
  > **Developer note:** Never assume. Read related files and docs before making changes. Read full file content for context. Never edit a file before reading it.
@@ -345,12 +345,16 @@ See `api-context` skill for full details.
345
345
 
346
346
  ## Error Handling
347
347
 
348
- **Recommended path: declare a typed error contract.** Add `errors: [{ reason, code, when, retryable? }]` to `tool()` / `resource()`. The handler then receives `ctx.fail(reason, msg?, data?)` typed against the reason union — `ctx.fail('typo')` is a TypeScript error. The runtime auto-populates `data.reason` for observability and the contract is published in `tools/list` under `_meta['mcp-ts-core/errors']` so clients can preview failure modes.
348
+ **Recommended path: declare a typed error contract.** Add `errors: [{ reason, code, when, recovery, retryable? }]` to `tool()` / `resource()`. The handler then receives `ctx.fail(reason, msg?, data?)` typed against the reason union — `ctx.fail('typo')` is a TypeScript error. The runtime auto-populates `data.reason` for observability and the linter enforces conformance against the handler body. The `recovery` field is required, descriptive metadata for the agent's next move; for the wire payload's `data.recovery.hint` (which the framework mirrors into `content[]` text), pass it explicitly at the throw site when dynamic context matters: `ctx.fail('reason', msg, { recovery: { hint: '...' } })`.
349
349
 
350
350
  ```ts
351
351
  errors: [
352
- { reason: 'no_match', code: JsonRpcErrorCode.NotFound, when: 'No PMID returned data' },
353
- { reason: 'queue_full', code: JsonRpcErrorCode.RateLimited, when: 'Queue at capacity', retryable: true },
352
+ { reason: 'no_match', code: JsonRpcErrorCode.NotFound,
353
+ when: 'No PMID returned data',
354
+ recovery: 'Try pubmed_search_articles to discover valid PMIDs first.' },
355
+ { reason: 'queue_full', code: JsonRpcErrorCode.RateLimited,
356
+ when: 'Queue at capacity', retryable: true,
357
+ recovery: 'Wait 30 seconds before retrying or reduce batch size.' },
354
358
  ],
355
359
  async handler(input, ctx) {
356
360
  if (queue.full()) throw ctx.fail('queue_full');
@@ -374,6 +378,12 @@ For HTTP responses from upstream APIs, use `httpErrorFromResponse(response, { se
374
378
 
375
379
  **Auto-classification.** Plain `Error`, `ZodError`, and any other thrown value are caught and classified automatically. Resolution order: `McpError` code (preserved as-is) → JS constructor name (`TypeError` → `ValidationError`) → provider patterns (HTTP status codes, AWS errors, DB errors) → common message patterns → `AbortError` name → `InternalError` fallback.
376
380
 
381
+ **Error-path parity.** Tool errors mirror the success-path `format-parity` invariant — both surfaces clients forward to the agent carry the same payload:
382
+ - `content[]` (read by clients like Claude Desktop) — markdown rendering of the error, with `data.recovery.hint` mirrored into the text when present
383
+ - `structuredContent.error` (read by clients like Claude Code) — JSON `{ code, message, data? }` carrying the error code, message, and any structured data from the thrown `McpError` or `ZodError`
384
+
385
+ `_meta.error` is **not** emitted on tool errors — error data lives on `structuredContent.error`. Resources re-throw to the SDK, which routes them through the JSON-RPC error envelope (no parity wiring needed there).
386
+
377
387
  The startup linter checks handler bodies for `prefer-mcp-error-in-handler`, `prefer-error-factory`, `preserve-cause-on-rethrow`, `no-stringify-upstream-error`, plus contract conformance (`error-contract-conformance` for undeclared non-baseline codes, `error-contract-prefer-fail` for declared codes thrown directly instead of via `ctx.fail`) — all warnings, surfaced in `bun run devcheck`.
378
388
 
379
389
  See `api-errors` skill for the full pattern-matching table, error code reference, and detailed examples.
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  <div align="center">
7
7
 
8
- [![Version](https://img.shields.io/badge/Version-0.8.2-blue.svg?style=flat-square)](./CHANGELOG.md) [![MCP Spec](https://img.shields.io/badge/MCP%20Spec-2025--11--25-8A2BE2.svg?style=flat-square)](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/docs/specification/2025-11-25/changelog.mdx) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^1.29.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE)
8
+ [![Version](https://img.shields.io/badge/Version-0.8.4-blue.svg?style=flat-square)](./CHANGELOG.md) [![MCP Spec](https://img.shields.io/badge/MCP%20Spec-2025--11--25-8A2BE2.svg?style=flat-square)](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/docs/specification/2025-11-25/changelog.mdx) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^1.29.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE)
9
9
 
10
10
  [![TypeScript](https://img.shields.io/badge/TypeScript-^6.0.3-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.3.2-blueviolet.svg?style=flat-square)](https://bun.sh/)
11
11
 
@@ -0,0 +1,43 @@
1
+ ---
2
+ summary: "Tool error responses gain structuredContent.error parity with content[]; recovery hint mirrors into text; _meta.error and _meta['mcp-ts-core/errors'] wire publication dropped"
3
+ breaking: true
4
+ ---
5
+
6
+ # 0.8.3 — 2026-04-29
7
+
8
+ Error-surface cleanup. The success-path `format-parity` invariant — every field in both `structuredContent` and `content[]` — now extends to errors. Closes [#84](https://github.com/cyanheads/mcp-ts-core/issues/84).
9
+
10
+ ## Changed
11
+
12
+ - **Tool error response shape** (`src/mcp-server/tools/utils/toolHandlerFactory.ts`) — replaces `_meta.error: { code, data? }` with `structuredContent.error: { code, message, data? }`. Both surfaces clients forward to the agent now carry the same payload: `content[]` (markdown, read by clients like Claude Desktop) and `structuredContent.error` (JSON, read by clients like Claude Code). `data` propagation rules unchanged — only `McpError.data` and `ZodError.issues` flow through.
13
+ - **Recovery hint mirroring** — when `data.recovery.hint` is a non-empty string, `content[0].text` becomes `Error: <msg>\n\nRecovery: <hint>`. Without a hint, the text remains `Error: <msg>`. Format-only clients now see the same recovery guidance `structuredContent.error`-readers receive.
14
+ - **Auto-task error path** (`src/mcp-server/tools/tool-registration.ts`) — uses the same shaping helpers. Timeout produces `McpError(Timeout, …)` rather than the prior `getErrorMessage` stringification, so timed-out tasks now carry a real JSON-RPC code through to the stored result.
15
+ - **Templates** — `templates/src/mcp-server/tools/definitions/echo.tool.ts` gains a typed `errors[]` contract example (`empty_message → InvalidParams`) demonstrating the `ctx.fail(reason, …)` pattern for new servers.
16
+
17
+ ## Removed
18
+
19
+ - **`_meta.error` on tool error responses.** The pre-parity workaround for giving programmatic clients structured access to error info. `structuredContent.error` does that job correctly.
20
+ - **`_meta['mcp-ts-core/errors']` wire publication in `tools/list` and `resources/list`.** Removed `ERROR_CONTRACT_META_KEY` and `buildMetaWithErrorContract` from `src/types-global/errors.ts`; the registries now pass `def._meta` through unchanged. Contract-based ergonomics — typed `ctx.fail`, conformance lint — are unaffected.
21
+
22
+ ## Added
23
+
24
+ - **`buildToolErrorResult(code, message, data?)`** and **`classifyAndBuildToolErrorResult(error)`** — exported from `src/mcp-server/tools/utils/toolHandlerFactory.ts` for shaping tool error envelopes consistently. Used internally by both the regular and auto-task error paths.
25
+
26
+ ## Docs
27
+
28
+ - `CLAUDE.md` / `AGENTS.md` — added "Error-path parity" paragraph to the Error Handling section.
29
+ - `skills/api-errors/SKILL.md` — replaced `_meta.error` references with `structuredContent.error`, added Error-path parity table, removed stale `tools/list` references.
30
+ - `skills/field-test/SKILL.md` — updated tool error projections from `result._meta.error.{code, data.reason}` → `result.structuredContent.error.{code, message, data?.reason}`.
31
+ - `skills/design-mcp-server/SKILL.md` — updated typed-contract paragraph.
32
+ - `docs/audit/` — empirical helpfulness-patterns audit across 8 reference servers (47 tools, ~133 pattern instances). Foundation referenced in [#81](https://github.com/cyanheads/mcp-ts-core/issues/81).
33
+
34
+ ## Migration
35
+
36
+ | Before | After |
37
+ |:-------|:------|
38
+ | `result._meta.error.code` | `result.structuredContent.error.code` |
39
+ | `result._meta.error.data` | `result.structuredContent.error.data` |
40
+ | `result._meta.error.data.reason` (typed contract) | `result.structuredContent.error.data.reason` |
41
+ | `tool._meta['mcp-ts-core/errors']` (in `tools/list` / `resources/list`) | Not published — read the contract from the source definition or its TypeScript types |
42
+
43
+ `error.message` is now consistently surfaced on both surfaces (was only in `content[]` text before). Code that read `result.content[0].text` continues to work; recovery-hint-aware clients can opt into the markdown form or read `data.recovery.hint` directly.
@@ -0,0 +1,60 @@
1
+ ---
2
+ summary: "ErrorContract.recovery is now required (≥ 5 words, lint-validated). Decoupled from runtime data.recovery.hint — no auto-population, just a forcing function for thoughtful authoring."
3
+ breaking: true
4
+ ---
5
+
6
+ # 0.8.4 — 2026-04-29
7
+
8
+ `recovery: string` joins `code`, `reason`, and `when` as a required field on every `ErrorContract` entry. Closes [#85](https://github.com/cyanheads/mcp-ts-core/issues/85).
9
+
10
+ The contract `recovery` and the throw-site `data.recovery.hint` are **decoupled by design**. The contract field is descriptive metadata read by the linter and scaffolding skills (a forcing function for thoughtful authoring). The wire payload's `data.recovery.hint` — which 0.8.3's error-path parity invariant mirrors into `content[]` text — is populated separately at the throw site by the author when dynamic context matters. No magic, no hidden transformation.
11
+
12
+ ## Changed
13
+
14
+ - **`ErrorContract.recovery: string`** (`src/types-global/errors.ts`) — required at the TypeScript type level. Existing tools that declare `errors[]` won't compile without a `recovery` string per entry.
15
+
16
+ ## Added
17
+
18
+ - **Three lint rules** (`src/linter/rules/error-contract-rules.ts`):
19
+ - `error-contract-recovery-required` — error when `recovery` is missing or non-string
20
+ - `error-contract-recovery-empty` — error when `recovery` is empty or whitespace-only
21
+ - `error-contract-recovery-min-words` — warning when `recovery` has fewer than 5 words (forcing function against placeholders like "Try again.")
22
+
23
+ ## Docs
24
+
25
+ - `CLAUDE.md` / `AGENTS.md` (root + `templates/`) — Error Handling sections updated with the required `recovery` field and the decoupling principle for `data.recovery.hint`.
26
+ - `skills/add-tool/SKILL.md` v2.1 → v2.2 — template scaffolds `recovery` in `errors[]`.
27
+ - `skills/api-errors/SKILL.md` v1.1 → v1.2 — documents the field, lint rules, and decoupling principle.
28
+ - `skills/design-mcp-server/SKILL.md` v2.7 → v2.8 — recovery-hint shape corrected to canonical nested `recovery: { hint: ... }`. Closes [#82](https://github.com/cyanheads/mcp-ts-core/issues/82).
29
+ - `templates/src/mcp-server/tools/definitions/echo.tool.ts` — `empty_message` entry gains a `recovery` string.
30
+
31
+ ## Migration
32
+
33
+ Every existing `errors[]` entry needs a `recovery` string. TypeScript will flag missing entries on upgrade — fix in place.
34
+
35
+ ```ts
36
+ // Before
37
+ errors: [
38
+ { reason: 'no_match', code: JsonRpcErrorCode.NotFound,
39
+ when: 'No item matched.' },
40
+ ],
41
+
42
+ // After
43
+ errors: [
44
+ { reason: 'no_match', code: JsonRpcErrorCode.NotFound,
45
+ when: 'No item matched.',
46
+ recovery: 'Broaden the query or check the spelling and try again.' },
47
+ ],
48
+ ```
49
+
50
+ The `recovery` string is contract metadata, not the wire-payload hint. To surface dynamic recovery guidance at the call site (mirrored into `content[]` text by 0.8.3's parity invariant), pass it explicitly:
51
+
52
+ ```ts
53
+ throw ctx.fail('no_match', `No item ${id}`, {
54
+ recovery: { hint: `No item ${id}; try a different ID.` },
55
+ });
56
+ ```
57
+
58
+ ## Maintenance
59
+
60
+ - Dependencies refreshed via `bun update --latest`. All minor/patch — `@opentelemetry/*` (0.215.0 → 0.216.0, 2.7.0 → 2.7.1), `@cloudflare/workers-types` (4.20260426.1 → 4.20260429.1), `unpdf` (1.6.1 → 1.6.2), and others.
@@ -10,9 +10,11 @@ import type { LintDefinitionType, LintDiagnostic } from '../types.js';
10
10
  * Validates the `errors[]` contract on a tool/resource definition.
11
11
  * Checks:
12
12
  * - `errors` is an array
13
- * - each entry is an object with required `code`, `reason`, `when`
13
+ * - each entry is an object with required `code`, `reason`, `when`, `recovery`
14
14
  * - `code` is a real `JsonRpcErrorCode` value
15
15
  * - `reason` is snake_case and unique within the contract
16
+ * - `recovery` is non-empty and ≥ 5 words (forcing function for thoughtful
17
+ * agent guidance — placeholders like "Try again." get flagged)
16
18
  * - `retryable` (when present) is a boolean
17
19
  */
18
20
  export declare function lintErrorContract(errors: unknown, definitionType: LintDefinitionType, definitionName: string): LintDiagnostic[];
@@ -1 +1 @@
1
- {"version":3,"file":"error-contract-rules.d.ts","sourceRoot":"","sources":["../../../src/linter/rules/error-contract-rules.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAatE;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,OAAO,EACf,cAAc,EAAE,kBAAkB,EAClC,cAAc,EAAE,MAAM,GACrB,cAAc,EAAE,CA8IlB;AAuDD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,4BAA4B,CAC1C,GAAG,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,EAC5C,cAAc,EAAE,kBAAkB,EAClC,cAAc,EAAE,MAAM,GACrB,cAAc,EAAE,CA4FlB"}
1
+ {"version":3,"file":"error-contract-rules.d.ts","sourceRoot":"","sources":["../../../src/linter/rules/error-contract-rules.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAetE;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,OAAO,EACf,cAAc,EAAE,kBAAkB,EAClC,cAAc,EAAE,MAAM,GACrB,cAAc,EAAE,CAmLlB;AAuDD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,4BAA4B,CAC1C,GAAG,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,EAC5C,cAAc,EAAE,kBAAkB,EAClC,cAAc,EAAE,MAAM,GACrB,cAAc,EAAE,CA4FlB"}
@@ -13,13 +13,16 @@ import { stripCommentsAndStrings } from './source-text.js';
13
13
  */
14
14
  const VALID_CODES = new Set(Object.values(JsonRpcErrorCode).filter((v) => typeof v === 'number'));
15
15
  const REASON_RE = /^[a-z][a-z0-9_]*$/;
16
+ const RECOVERY_MIN_WORDS = 5;
16
17
  /**
17
18
  * Validates the `errors[]` contract on a tool/resource definition.
18
19
  * Checks:
19
20
  * - `errors` is an array
20
- * - each entry is an object with required `code`, `reason`, `when`
21
+ * - each entry is an object with required `code`, `reason`, `when`, `recovery`
21
22
  * - `code` is a real `JsonRpcErrorCode` value
22
23
  * - `reason` is snake_case and unique within the contract
24
+ * - `recovery` is non-empty and ≥ 5 words (forcing function for thoughtful
25
+ * agent guidance — placeholders like "Try again." get flagged)
23
26
  * - `retryable` (when present) is a boolean
24
27
  */
25
28
  export function lintErrorContract(errors, definitionType, definitionName) {
@@ -56,7 +59,7 @@ export function lintErrorContract(errors, definitionType, definitionName) {
56
59
  diagnostics.push({
57
60
  rule: 'error-contract-entry-type',
58
61
  severity: 'error',
59
- message: `${definitionType} '${definitionName}' ${path} must be an object with { code, reason, when }.`,
62
+ message: `${definitionType} '${definitionName}' ${path} must be an object with { code, reason, when, recovery }.`,
60
63
  definitionType,
61
64
  definitionName,
62
65
  });
@@ -140,6 +143,41 @@ export function lintErrorContract(errors, definitionType, definitionName) {
140
143
  definitionName,
141
144
  });
142
145
  }
146
+ // recovery
147
+ if (typeof e.recovery !== 'string') {
148
+ diagnostics.push({
149
+ rule: 'error-contract-recovery-required',
150
+ severity: 'error',
151
+ message: `${definitionType} '${definitionName}' ${path}.recovery must be a non-empty string ` +
152
+ 'describing what the agent should do when this failure occurs.',
153
+ definitionType,
154
+ definitionName,
155
+ });
156
+ }
157
+ else if (e.recovery.trim().length === 0) {
158
+ diagnostics.push({
159
+ rule: 'error-contract-recovery-empty',
160
+ severity: 'error',
161
+ message: `${definitionType} '${definitionName}' ${path}.recovery is empty. ` +
162
+ 'Provide actionable guidance for the agent.',
163
+ definitionType,
164
+ definitionName,
165
+ });
166
+ }
167
+ else {
168
+ const wordCount = e.recovery.trim().split(/\s+/).filter(Boolean).length;
169
+ if (wordCount < RECOVERY_MIN_WORDS) {
170
+ diagnostics.push({
171
+ rule: 'error-contract-recovery-min-words',
172
+ severity: 'warning',
173
+ message: `${definitionType} '${definitionName}' ${path}.recovery has ${wordCount} word(s); ` +
174
+ `minimum is ${RECOVERY_MIN_WORDS}. Specific guidance ("Try X with Y") beats ` +
175
+ 'placeholders ("Try again.", "Check input.").',
176
+ definitionType,
177
+ definitionName,
178
+ });
179
+ }
180
+ }
143
181
  // retryable (optional)
144
182
  if (e.retryable !== undefined && typeof e.retryable !== 'boolean') {
145
183
  diagnostics.push({
@@ -1 +1 @@
1
- {"version":3,"file":"error-contract-rules.js","sourceRoot":"","sources":["../../../src/linter/rules/error-contract-rules.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAsB,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAGhF,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAE3D;;;GAGG;AACH,MAAM,WAAW,GAAwB,IAAI,GAAG,CAC9C,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAClF,CAAC;AAEF,MAAM,SAAS,GAA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BAC/E,mFAAmF;YACrF,cAAc;YACd,cAAc;SACf,CAAC,CAAC;IACL,CAAC;IAED,KAAK,MAAM,KAAK,IAAI,iBAAiB,EAAE,CAAC;QACtC,MAAM,UAAU,GACd,KAAK,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC;YACxB,CAAC,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG;YACzB,CAAC,CAAC,UAAU,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACjE,WAAW,CAAC,IAAI,CAAC;YACf,IAAI,EAAE,4BAA4B;YAClC,QAAQ,EAAE,SAAS;YACnB,OAAO,EACL,GAAG,cAAc,KAAK,cAAc,YAAY,KAAK,CAAC,QAAQ,qBAAqB;gBACnF,yCAAyC,UAAU,6BAA6B;gBAChF,cAAc,UAAU,4DAA4D;gBACpF,wDAAwD;YAC1D,cAAc;YACd,cAAc;SACf,CAAC,CAAC;IACL,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC;AAED;;;GAGG;AACH,SAAS,oBAAoB,CAAC,IAAsB;IAClD,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE,CAAC;QAC7D,IAAI,KAAK,KAAK,IAAI;YAAE,OAAO,IAAI,CAAC;IAClC,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;AACtB,CAAC"}
@@ -1,4 +1,4 @@
1
- {"level":50,"time":1777420386266,"env":"testing","version":"0.0.0-test","pid":93036,"requestId":"9SR3Y-96Q5Q","timestamp":"2026-04-28T23:53:06.265Z","operation":"HandleToolRequest","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"b6d7f21343ef3d0098ee5154572d21e4f3453c49f591d9a06424ae7d25e95865","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant"},"errorData":{"sessionId":"b6d7f21343ef3d0098ee5154572d21e4f3453c49f591d9a06424ae7d25e95865","toolName":"scoped_echo","requestId":"9SR3Y-96Q5Q","timestamp":"2026-04-28T23:53:06.265Z","tenantId":"authz-tenant","operation":"HandleToolRequest","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant"},"originalErrorName":"McpError","originalMessage":"Insufficient permissions.","originalStack":"McpError: Insufficient permissions.\n at forbidden (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:84:58)\n at withRequiredScopes (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:61:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:72:17)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Insufficient permissions.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:169:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:107:42)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)","msg":"Error in tool:scoped_echo: Insufficient permissions."}
2
- {"level":50,"time":1777420387550,"env":"testing","version":"0.8.2","pid":93075,"requestId":"EOXXJ-UGLBI","timestamp":"2026-04-28T23:53:07.549Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"POST","errorData":{"path":"/mcp","method":"POST","requestId":"EOXXJ-UGLBI","timestamp":"2026-04-28T23:53:07.549Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Missing or invalid Authorization header. Bearer scheme required.","originalStack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at authMiddleware (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/authMiddleware.js:64:19)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpTransport.js:232:22)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at cors2 (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/middleware/cors/index.js:82:11)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:169:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Missing or invalid Authorization header. Bearer scheme required."}
3
- {"level":50,"time":1777420387567,"env":"testing","version":"0.8.2","pid":93075,"requestId":"H0RA2-3FZ2J","timestamp":"2026-04-28T23:53:07.567Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"POST","errorData":{"path":"/mcp","method":"POST","requestId":"H0RA2-3FZ2J","timestamp":"2026-04-28T23:53:07.567Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Token has expired.","originalStack":"McpError: Token has expired.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at handleJoseVerifyError (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/claimParser.js:56:11)\n at verify (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/strategies/jwtStrategy.js:91:13)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Token has expired.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:169:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Token has expired."}
4
- {"level":50,"time":1777420387570,"env":"testing","version":"0.8.2","pid":93075,"requestId":"GUJJZ-AY2OQ","timestamp":"2026-04-28T23:53:07.570Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"GET","errorData":{"path":"/mcp","method":"GET","requestId":"GUJJZ-AY2OQ","timestamp":"2026-04-28T23:53:07.570Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Missing or invalid Authorization header. Bearer scheme required.","originalStack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at authMiddleware (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/authMiddleware.js:64:19)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpTransport.js:232:22)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at cors2 (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/middleware/cors/index.js:82:11)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:169:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Missing or invalid Authorization header. Bearer scheme required."}
1
+ {"level":50,"time":1777494206031,"env":"testing","version":"0.0.0-test","pid":62030,"requestId":"2DXYH-6OXOG","timestamp":"2026-04-29T20:23:26.030Z","operation":"HandleToolRequest","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"5ab0ea1c5b4e8d62e734a3ffd5bd6a3f01332ecc57a6395af28d53fec5ab98d6","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant"},"errorData":{"sessionId":"5ab0ea1c5b4e8d62e734a3ffd5bd6a3f01332ecc57a6395af28d53fec5ab98d6","toolName":"scoped_echo","requestId":"2DXYH-6OXOG","timestamp":"2026-04-29T20:23:26.030Z","tenantId":"authz-tenant","operation":"HandleToolRequest","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant"},"originalErrorName":"McpError","originalMessage":"Insufficient permissions.","originalStack":"McpError: Insufficient permissions.\n at forbidden (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:84:58)\n at withRequiredScopes (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:61:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:133:17)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Insufficient permissions.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:169:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:168:26)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)","msg":"Error in tool:scoped_echo: Insufficient permissions."}
2
+ {"level":50,"time":1777494206349,"env":"testing","version":"0.8.4","pid":62034,"requestId":"XIJQG-DQNFH","timestamp":"2026-04-29T20:23:26.348Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"POST","errorData":{"path":"/mcp","method":"POST","requestId":"XIJQG-DQNFH","timestamp":"2026-04-29T20:23:26.348Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Missing or invalid Authorization header. Bearer scheme required.","originalStack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at authMiddleware (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/authMiddleware.js:64:19)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpTransport.js:232:22)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at cors2 (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/middleware/cors/index.js:82:11)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:169:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Missing or invalid Authorization header. Bearer scheme required."}
3
+ {"level":50,"time":1777494206364,"env":"testing","version":"0.8.4","pid":62034,"requestId":"8G1K9-6UPKW","timestamp":"2026-04-29T20:23:26.364Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"POST","errorData":{"path":"/mcp","method":"POST","requestId":"8G1K9-6UPKW","timestamp":"2026-04-29T20:23:26.364Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Token has expired.","originalStack":"McpError: Token has expired.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at handleJoseVerifyError (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/claimParser.js:56:11)\n at verify (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/strategies/jwtStrategy.js:91:13)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Token has expired.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:169:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Token has expired."}
4
+ {"level":50,"time":1777494206368,"env":"testing","version":"0.8.4","pid":62034,"requestId":"IXG6T-KFPFJ","timestamp":"2026-04-29T20:23:26.368Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"GET","errorData":{"path":"/mcp","method":"GET","requestId":"IXG6T-KFPFJ","timestamp":"2026-04-29T20:23:26.368Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Missing or invalid Authorization header. Bearer scheme required.","originalStack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at authMiddleware (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/authMiddleware.js:64:19)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpTransport.js:232:22)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at cors2 (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/middleware/cors/index.js:82:11)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:169:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Missing or invalid Authorization header. Bearer scheme required."}
@@ -1,4 +1,4 @@
1
- {"level":50,"time":1777420386266,"env":"testing","version":"0.0.0-test","pid":93036,"requestId":"9SR3Y-96Q5Q","timestamp":"2026-04-28T23:53:06.265Z","operation":"HandleToolRequest","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"b6d7f21343ef3d0098ee5154572d21e4f3453c49f591d9a06424ae7d25e95865","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant"},"errorData":{"sessionId":"b6d7f21343ef3d0098ee5154572d21e4f3453c49f591d9a06424ae7d25e95865","toolName":"scoped_echo","requestId":"9SR3Y-96Q5Q","timestamp":"2026-04-28T23:53:06.265Z","tenantId":"authz-tenant","operation":"HandleToolRequest","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant"},"originalErrorName":"McpError","originalMessage":"Insufficient permissions.","originalStack":"McpError: Insufficient permissions.\n at forbidden (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:84:58)\n at withRequiredScopes (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:61:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:72:17)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Insufficient permissions.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:169:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:107:42)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)","msg":"Error in tool:scoped_echo: Insufficient permissions."}
2
- {"level":50,"time":1777420387550,"env":"testing","version":"0.8.2","pid":93075,"requestId":"EOXXJ-UGLBI","timestamp":"2026-04-28T23:53:07.549Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"POST","errorData":{"path":"/mcp","method":"POST","requestId":"EOXXJ-UGLBI","timestamp":"2026-04-28T23:53:07.549Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Missing or invalid Authorization header. Bearer scheme required.","originalStack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at authMiddleware (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/authMiddleware.js:64:19)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpTransport.js:232:22)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at cors2 (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/middleware/cors/index.js:82:11)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:169:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Missing or invalid Authorization header. Bearer scheme required."}
3
- {"level":50,"time":1777420387567,"env":"testing","version":"0.8.2","pid":93075,"requestId":"H0RA2-3FZ2J","timestamp":"2026-04-28T23:53:07.567Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"POST","errorData":{"path":"/mcp","method":"POST","requestId":"H0RA2-3FZ2J","timestamp":"2026-04-28T23:53:07.567Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Token has expired.","originalStack":"McpError: Token has expired.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at handleJoseVerifyError (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/claimParser.js:56:11)\n at verify (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/strategies/jwtStrategy.js:91:13)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Token has expired.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:169:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Token has expired."}
4
- {"level":50,"time":1777420387570,"env":"testing","version":"0.8.2","pid":93075,"requestId":"GUJJZ-AY2OQ","timestamp":"2026-04-28T23:53:07.570Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"GET","errorData":{"path":"/mcp","method":"GET","requestId":"GUJJZ-AY2OQ","timestamp":"2026-04-28T23:53:07.570Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Missing or invalid Authorization header. Bearer scheme required.","originalStack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at authMiddleware (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/authMiddleware.js:64:19)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpTransport.js:232:22)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at cors2 (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/middleware/cors/index.js:82:11)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:169:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Missing or invalid Authorization header. Bearer scheme required."}
1
+ {"level":50,"time":1777494206031,"env":"testing","version":"0.0.0-test","pid":62030,"requestId":"2DXYH-6OXOG","timestamp":"2026-04-29T20:23:26.030Z","operation":"HandleToolRequest","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"5ab0ea1c5b4e8d62e734a3ffd5bd6a3f01332ecc57a6395af28d53fec5ab98d6","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant"},"errorData":{"sessionId":"5ab0ea1c5b4e8d62e734a3ffd5bd6a3f01332ecc57a6395af28d53fec5ab98d6","toolName":"scoped_echo","requestId":"2DXYH-6OXOG","timestamp":"2026-04-29T20:23:26.030Z","tenantId":"authz-tenant","operation":"HandleToolRequest","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant"},"originalErrorName":"McpError","originalMessage":"Insufficient permissions.","originalStack":"McpError: Insufficient permissions.\n at forbidden (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:84:58)\n at withRequiredScopes (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:61:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:133:17)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Insufficient permissions.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:169:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:168:26)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)","msg":"Error in tool:scoped_echo: Insufficient permissions."}
2
+ {"level":50,"time":1777494206349,"env":"testing","version":"0.8.4","pid":62034,"requestId":"XIJQG-DQNFH","timestamp":"2026-04-29T20:23:26.348Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"POST","errorData":{"path":"/mcp","method":"POST","requestId":"XIJQG-DQNFH","timestamp":"2026-04-29T20:23:26.348Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Missing or invalid Authorization header. Bearer scheme required.","originalStack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at authMiddleware (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/authMiddleware.js:64:19)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpTransport.js:232:22)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at cors2 (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/middleware/cors/index.js:82:11)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:169:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Missing or invalid Authorization header. Bearer scheme required."}
3
+ {"level":50,"time":1777494206364,"env":"testing","version":"0.8.4","pid":62034,"requestId":"8G1K9-6UPKW","timestamp":"2026-04-29T20:23:26.364Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"POST","errorData":{"path":"/mcp","method":"POST","requestId":"8G1K9-6UPKW","timestamp":"2026-04-29T20:23:26.364Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Token has expired.","originalStack":"McpError: Token has expired.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at handleJoseVerifyError (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/claimParser.js:56:11)\n at verify (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/strategies/jwtStrategy.js:91:13)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Token has expired.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:169:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Token has expired."}
4
+ {"level":50,"time":1777494206368,"env":"testing","version":"0.8.4","pid":62034,"requestId":"IXG6T-KFPFJ","timestamp":"2026-04-29T20:23:26.368Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"GET","errorData":{"path":"/mcp","method":"GET","requestId":"IXG6T-KFPFJ","timestamp":"2026-04-29T20:23:26.368Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Missing or invalid Authorization header. Bearer scheme required.","originalStack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at authMiddleware (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/authMiddleware.js:64:19)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpTransport.js:232:22)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at cors2 (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/middleware/cors/index.js:82:11)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:169:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Missing or invalid Authorization header. Bearer scheme required."}
@@ -1 +1 @@
1
- {"version":3,"file":"resource-registration.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/resources/resource-registration.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,KAAK,SAAS,EAAoB,MAAM,yCAAyC,CAAC;AAE3F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oDAAoD,CAAC;AAChG,OAAO,EAEL,KAAK,8BAA8B,EAEpC,MAAM,wDAAwD,CAAC;AAchE,qBAAa,gBAAgB;IAKzB,OAAO,CAAC,YAAY;IACpB,OAAO,CAAC,QAAQ;IALlB,wEAAwE;IACxE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAqB;gBAG3C,YAAY,EAAE,qBAAqB,EAAE,EACrC,QAAQ,EAAE,8BAA8B;IAGlD;;OAEG;IACU,WAAW,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IA2B1D,iFAAiF;IACjF,OAAO,CAAC,gBAAgB;YAUV,gBAAgB;CAqD/B"}
1
+ {"version":3,"file":"resource-registration.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/resources/resource-registration.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,KAAK,SAAS,EAAoB,MAAM,yCAAyC,CAAC;AAE3F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oDAAoD,CAAC;AAChG,OAAO,EAEL,KAAK,8BAA8B,EAEpC,MAAM,wDAAwD,CAAC;AAchE,qBAAa,gBAAgB;IAKzB,OAAO,CAAC,YAAY;IACpB,OAAO,CAAC,QAAQ;IALlB,wEAAwE;IACxE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAqB;gBAG3C,YAAY,EAAE,qBAAqB,EAAE,EACrC,QAAQ,EAAE,8BAA8B;IAGlD;;OAEG;IACU,WAAW,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IA2B1D,iFAAiF;IACjF,OAAO,CAAC,gBAAgB;YAUV,gBAAgB;CAoD/B"}
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import { ResourceTemplate } from '@modelcontextprotocol/sdk/server/mcp.js';
6
6
  import { createResourceHandler, } from '../../mcp-server/resources/utils/resourceHandlerFactory.js';
7
- import { buildMetaWithErrorContract, JsonRpcErrorCode } from '../../types-global/errors.js';
7
+ import { JsonRpcErrorCode } from '../../types-global/errors.js';
8
8
  import { ErrorHandler } from '../../utils/internal/error-handler/errorHandler.js';
9
9
  import { logger } from '../../utils/internal/logger.js';
10
10
  import { requestContextService } from '../../utils/internal/requestContext.js';
@@ -64,7 +64,6 @@ export class ResourceRegistry {
64
64
  const handler = createResourceHandler(def, this.services, notifiers);
65
65
  const title = def.title ?? resourceName;
66
66
  const mimeType = def.mimeType ?? 'application/json';
67
- const mergedMeta = buildMetaWithErrorContract(def._meta, def.errors);
68
67
  const metadata = {
69
68
  title,
70
69
  description: def.description,
@@ -72,7 +71,7 @@ export class ResourceRegistry {
72
71
  ...(def.size != null && { size: def.size }),
73
72
  ...(def.examples && { examples: def.examples }),
74
73
  ...(def.annotations && { annotations: def.annotations }),
75
- ...(mergedMeta && { _meta: mergedMeta }),
74
+ ...(def._meta && { _meta: def._meta }),
76
75
  };
77
76
  if (hasUriTemplateVariables(def.uriTemplate)) {
78
77
  const template = new ResourceTemplate(def.uriTemplate, {
@@ -1 +1 @@
1
- {"version":3,"file":"resource-registration.js","sourceRoot":"","sources":["../../../src/mcp-server/resources/resource-registration.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OA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C;CACF"}
1
+ {"version":3,"file":"resource-registration.js","sourceRoot":"","sources":["../../../src/mcp-server/resources/resource-registration.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAkB,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAG3F,OAAO,EACL,qBAAqB,GAGtB,MAAM,wDAAwD,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,gDAAgD,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAM3E,SAAS,uBAAuB,CAAC,WAAmB;IAClD,OAAO,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,OAAO,gBAAgB;IAKjB;IACA;IALV,wEAAwE;IACvD,eAAe,GAAG,IAAI,GAAG,EAAU,CAAC;IAErD,YACU,YAAqC,EACrC,QAAwC;QADxC,iBAAY,GAAZ,YAAY,CAAyB;QACrC,aAAQ,GAAR,QAAQ,CAAgC;IAC/C,CAAC;IAEJ;;OAEG;IACI,KAAK,CAAC,WAAW,CAAC,MAAiB;QACxC,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC;QAE7B,sEAAsE;QACtE,qEAAqE;QACrE,qEAAqE;QACrE,MAAM,SAAS,GAA6B;YAC1C,yBAAyB,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,uBAAuB,EAAE;YACjE,qBAAqB,EAAE,CAAC,GAAW,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,EAAE,GAAG,EAAE,CAAC;SACnF,CAAC;QAEF,MAAM,OAAO,GAAG,qBAAqB,CAAC,oBAAoB,CAAC;YACzD,SAAS,EAAE,8BAA8B;SAC1C,CAAC,CAAC;QAEH,MAAM,CAAC,KAAK,CAAC,eAAe,IAAI,C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E,IAAI;SACf,CACF,CAAC;IACJ,CAAC;CACF"}
@@ -58,9 +58,9 @@ export interface ResourceDefinition<TParams extends ZodObject<ZodRawShape> = Zod
58
58
  description: string;
59
59
  /**
60
60
  * Declarative contract describing the failure modes this resource can surface.
61
- * See `ToolDefinition.errors` for full semantics. Surfaces in `resources/list`
62
- * under `_meta['mcp-ts-core/errors']`. When declared, `ctx.fail(reason, …)` is
63
- * typed against the reason union — see the example on `tool()`.
61
+ * See `ToolDefinition.errors` for full semantics. When declared,
62
+ * `ctx.fail(reason, …)` is typed against the reason union — see the example
63
+ * on `tool()`.
64
64
  */
65
65
  errors?: TErrors;
66
66
  /** Optional examples for discoverability. */
@@ -1 +1 @@
1
- {"version":3,"file":"tool-registration.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/tools/tool-registration.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,SAAS,EAAgB,MAAM,yCAAyC,CAAC;AAGvF,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AAIlD,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,gDAAgD,CAAC;AACxD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AACpF,OAAO,EAEL,KAAK,sBAAsB,EAE5B,MAAM,gDAAgD,CAAC;AAqBxD,oDAAoD;AACpD,MAAM,MAAM,UAAU,GAClB,iBAAiB,GACjB,kBAAkB,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC;AAMvE,qBAAa,YAAY;IAKrB,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,QAAQ,CAAC;IALnB,oEAAoE;IACpE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAqB;gBAG3C,QAAQ,EAAE,UAAU,EAAE,EACtB,QAAQ,CAAC,EAAE,sBAAsB,YAAA;IAG3C;;;;OAIG;IACU,WAAW,CAAC,M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;;;OAIG;YACW,kBAAkB;IAwGhC;;;;;OAKG;YACW,gBAAgB;CA8C/B"}
@@ -1,12 +1,11 @@
1
1
  import { config } from '../../config/index.js';
2
2
  import { attachTypedFail, createContext } from '../../core/context.js';
3
3
  import { isTaskToolDefinition, } from '../../mcp-server/tasks/utils/taskToolDefinition.js';
4
- import { createToolHandler, } from '../../mcp-server/tools/utils/toolHandlerFactory.js';
4
+ import { buildToolErrorResult, classifyAndBuildToolErrorResult, createToolHandler, } from '../../mcp-server/tools/utils/toolHandlerFactory.js';
5
5
  import { authContext } from '../../mcp-server/transports/auth/lib/authContext.js';
6
6
  import { withRequiredScopes } from '../../mcp-server/transports/auth/lib/authUtils.js';
7
- import { buildMetaWithErrorContract, JsonRpcErrorCode } from '../../types-global/errors.js';
7
+ import { JsonRpcErrorCode } from '../../types-global/errors.js';
8
8
  import { ErrorHandler } from '../../utils/internal/error-handler/errorHandler.js';
9
- import { getErrorMessage } from '../../utils/internal/error-handler/helpers.js';
10
9
  import { logger } from '../../utils/internal/logger.js';
11
10
  import { requestContextService } from '../../utils/internal/requestContext.js';
12
11
  /** Default TTL for auto-task tools when config doesn't specify one. */
@@ -97,14 +96,13 @@ export class ToolRegistry {
97
96
  const handler = createToolHandler(tool, this.services, notifiers);
98
97
  const title = tool.title ?? tool.annotations?.title ?? this.deriveTitleFromName(tool.name);
99
98
  // Type assertion required: SDK's conditional types don't resolve with erased generics
100
- const mergedMeta = buildMetaWithErrorContract(tool._meta, tool.errors);
101
99
  server.registerTool(tool.name, {
102
100
  title,
103
101
  description: tool.description,
104
102
  inputSchema: tool.input,
105
103
  outputSchema: tool.output,
106
104
  ...(tool.annotations && { annotations: tool.annotations }),
107
- ...(mergedMeta && { _meta: mergedMeta }),
105
+ ...(tool._meta && { _meta: tool._meta }),
108
106
  }, handler);
109
107
  logger.debug(`Tool '${tool.name}' registered successfully.`, registrationContext);
110
108
  }, {
@@ -136,14 +134,13 @@ export class ToolRegistry {
136
134
  const formatter = (result) => tool.format
137
135
  ? tool.format(result)
138
136
  : [{ type: 'text', text: JSON.stringify(result, null, 2) }];
139
- const mergedAutoTaskMeta = buildMetaWithErrorContract(tool._meta, tool.errors);
140
137
  server.experimental.tasks.registerToolTask(tool.name, {
141
138
  title,
142
139
  description: tool.description,
143
140
  inputSchema: tool.input,
144
141
  outputSchema: tool.output,
145
142
  ...(tool.annotations && { annotations: tool.annotations }),
146
- ...(mergedAutoTaskMeta && { _meta: mergedAutoTaskMeta }),
143
+ ...(tool._meta && { _meta: tool._meta }),
147
144
  execution: { taskSupport: 'optional' },
148
145
  }, {
149
146
  createTask: async (args, extra) => {
@@ -252,11 +249,10 @@ export class ToolRegistry {
252
249
  });
253
250
  try {
254
251
  const isTimeout = abortController.signal.reason === TIMEOUT_SENTINEL;
255
- const errorMessage = isTimeout ? `Task timed out after ${ttlMs}ms` : getErrorMessage(error);
256
- await taskStore.storeTaskResult(taskId, 'failed', {
257
- content: [{ type: 'text', text: `Error: ${errorMessage}` }],
258
- isError: true,
259
- });
252
+ const result = isTimeout
253
+ ? buildToolErrorResult(JsonRpcErrorCode.Timeout, `Task timed out after ${ttlMs}ms`, undefined)
254
+ : classifyAndBuildToolErrorResult(error);
255
+ await taskStore.storeTaskResult(taskId, 'failed', result);
260
256
  }
261
257
  catch {
262
258
  // Task may already be in terminal state