[GH-ISSUE #5063] MCP tool schemas rejected: array parameters missing required items #3105

Closed
opened 2026-10-31 00:36:41 +00:00 by bsakaguchi · 2 comments
Owner

Originally created by @Bigpla24 on GitHub (Oct 18, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/5063

Summary

VS Code reports MCP tool registration failures for REA tools with this validation error:

Failed to validate tool mcp_rea_build_reconstruction_obligation_ledger:
Error: tool parameters array type must have items.

A second tool reports the same error:

Failed to validate tool mcp_rea_build_call_path:
Error: tool parameters array type must have items.

Environment

  • Client: VS Code MCP configuration
  • Server package: rea-agents
  • Local registration launches the installed package's scripts/rea.mjs mcp entry point.
  • The user's previously reported CLI version is 6.5.0; please confirm against the affected package before reproducing.

Expected behavior

All tools register successfully when their input schemas conform to the JSON Schema dialect expected by the MCP client.

Actual behavior

At least the two named tools fail validation with an error indicating that an array schema is missing its items declaration. This occurs during tool/schema validation, before an invocation of those tools.

Request

Please inspect the source schemas and schema-generation/registration path for both tools. Ensure every array-valued parameter includes the correct items schema based on its intended data contract, and add regression tests covering tool schemas so similar failures are caught before release.

The correct item type is not inferred here; it should be established from the implementation and intended contract rather than replacing arrays with an arbitrary type.

Reproduction details

Configure VS Code MCP to launch the installed REA package with the mcp argument, then inspect the tool registration output for the two tool names above. The complete input schema and exact array property were not available in the client error, so additional source-level investigation is needed to identify the offending property.

This report is based on the observed client error; it does not assert that either tool's underlying functionality has been executed or tested.

Originally created by @Bigpla24 on GitHub (Oct 18, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/5063 ## Summary VS Code reports MCP tool registration failures for REA tools with this validation error: ``` Failed to validate tool mcp_rea_build_reconstruction_obligation_ledger: Error: tool parameters array type must have items. ``` A second tool reports the same error: ``` Failed to validate tool mcp_rea_build_call_path: Error: tool parameters array type must have items. ``` ## Environment - Client: VS Code MCP configuration - Server package: `rea-agents` - Local registration launches the installed package's `scripts/rea.mjs mcp` entry point. - The user's previously reported CLI version is 6.5.0; please confirm against the affected package before reproducing. ## Expected behavior All tools register successfully when their input schemas conform to the JSON Schema dialect expected by the MCP client. ## Actual behavior At least the two named tools fail validation with an error indicating that an array schema is missing its `items` declaration. This occurs during tool/schema validation, before an invocation of those tools. ## Request Please inspect the source schemas and schema-generation/registration path for both tools. Ensure every array-valued parameter includes the correct `items` schema based on its intended data contract, and add regression tests covering tool schemas so similar failures are caught before release. The correct item type is not inferred here; it should be established from the implementation and intended contract rather than replacing arrays with an arbitrary type. ## Reproduction details Configure VS Code MCP to launch the installed REA package with the `mcp` argument, then inspect the tool registration output for the two tool names above. The complete input schema and exact array property were not available in the client error, so additional source-level investigation is needed to identify the offending property. This report is based on the observed client error; it does not assert that either tool's underlying functionality has been executed or tested.
Author
Owner

@akushonkamen commented on GitHub (Oct 19, 2026):

I'm picking this up: will add a full tool-schema scan regression test (assert every type:"array" JSON Schema node has items for all registered MCP tools' input/output schemas) and fix the offending fields in build_reconstruction_obligation_ledger / build_call_path. Will report back with a draft PR.

<!-- gh-comment-id:6272838817 --> @akushonkamen commented on GitHub (Oct 19, 2026): I'm picking this up: will add a full tool-schema scan regression test (assert every `type:"array"` JSON Schema node has `items` for all registered MCP tools' input/output schemas) and fix the offending fields in `build_reconstruction_obligation_ledger` / `build_call_path`. Will report back with a draft PR.
Author
Owner

@akushonkamen commented on GitHub (Oct 19, 2026):

Root-cause analysis (source-level, current main @ 0e62094b6 plus the published packages):

Reproduced the offending schema in the released 6.5.0 package. Inspecting the rea-agents@6.5.0 dist, both reported tools (and 21 others) advertise this input node:

...relationship_coverage.anyOf[0].oneOf[1].properties.limited_directions.anyOf[0]:
{"type":"array","prefixItems":[{"type":"string","const":"callers"}],"minItems":1,"maxItems":1}

A fixed-length tuple renders as prefixItems only; VS Code's MCP client requires items for any type: "array" (exactly the reported "tool parameters array type must have items"), so registration of build_reconstruction_obligation_ledger and build_call_path fails. I counted 23 affected tools in 6.5.0's advertised input schemas with the client-side rule (any array-bearing type without a truthy items).

Already fixed on main and in the latest release. Commit 204b9f3ac ("fix(contracts): preserve array guidance across MCP schema profiles", included in rea-agents@6.7.0, currently the latest published version) replaces bare z.tuple([...]) with fixedTupleSchema (src/domain/fixedTupleSchema.ts), which adds a union rest schema so the projected tuple carries an items declaration alongside prefixItems. limited_directions now uses it in src/domain/relationshipCoverage.ts:18. Scanning every registered tool's real SDK-advertised tools/list input and output schemas on current main with the same client rule reports zero violations, including both tools named here.

Regression coverage already in place. tests/boundary/mcp/toolSchemaValidity.test.ts validates the full tool catalog against Ajv plus the VS Code array-items and boolean-literal client constraints, and tests/boundary/mcp/toolInputAdmission.test.ts / src/contracts/tupleSchemaParity.test.ts cover tuple rendering parity.

So no source change is needed on main: the fix shipped in 6.7.0. Users on 6.5.0 should upgrade the installed rea-agents package to >= 6.7.0 (VS Code caches the registered tool list per server process, so restart the MCP server after upgrading). I'm leaving this open for maintainers to confirm/close; happy to help verify against 6.7.0 if anything still reproduces.

<!-- gh-comment-id:6273077179 --> @akushonkamen commented on GitHub (Oct 19, 2026): Root-cause analysis (source-level, current `main` @ 0e62094b6 plus the published packages): **Reproduced the offending schema in the released 6.5.0 package.** Inspecting the `rea-agents@6.5.0` dist, both reported tools (and 21 others) advertise this input node: ```json ...relationship_coverage.anyOf[0].oneOf[1].properties.limited_directions.anyOf[0]: {"type":"array","prefixItems":[{"type":"string","const":"callers"}],"minItems":1,"maxItems":1} ``` A fixed-length tuple renders as `prefixItems` only; VS Code's MCP client requires `items` for any `type: "array"` (exactly the reported "tool parameters array type must have items"), so registration of `build_reconstruction_obligation_ledger` and `build_call_path` fails. I counted 23 affected tools in 6.5.0's advertised input schemas with the client-side rule (any array-bearing type without a truthy `items`). **Already fixed on main and in the latest release.** Commit 204b9f3ac ("fix(contracts): preserve array guidance across MCP schema profiles", included in `rea-agents@6.7.0`, currently the latest published version) replaces bare `z.tuple([...])` with `fixedTupleSchema` (`src/domain/fixedTupleSchema.ts`), which adds a union rest schema so the projected tuple carries an `items` declaration alongside `prefixItems`. `limited_directions` now uses it in `src/domain/relationshipCoverage.ts:18`. Scanning every registered tool's real SDK-advertised `tools/list` input and output schemas on current `main` with the same client rule reports zero violations, including both tools named here. **Regression coverage already in place.** `tests/boundary/mcp/toolSchemaValidity.test.ts` validates the full tool catalog against Ajv plus the VS Code array-`items` and boolean-literal client constraints, and `tests/boundary/mcp/toolInputAdmission.test.ts` / `src/contracts/tupleSchemaParity.test.ts` cover tuple rendering parity. So no source change is needed on `main`: the fix shipped in 6.7.0. Users on 6.5.0 should upgrade the installed `rea-agents` package to >= 6.7.0 (VS Code caches the registered tool list per server process, so restart the MCP server after upgrading). I'm leaving this open for maintainers to confirm/close; happy to help verify against 6.7.0 if anything still reproduces.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#3105
No description provided.