[PR #1062] [MERGED] fix(mcp): flatten root union input schemas #2615

Closed
opened 2026-10-17 21:08:16 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1062
Author: @cevieiras
Created: 10/8/2026
Status: ✅ Merged
Merged: 10/8/2026
Merged by: @N0zoM1z0

Base: main ← Head: fix/mcp-root-union-schemas


📝 Commits (4)

  • cc7ae65 fix(mcp): flatten root union input schemas
  • 5ac0d2f Merge remote-tracking branch 'origin/main' into maintain/pr-1062
  • c2d9386 Merge remote-tracking branch 'origin/main' into maintain/pr-1062
  • c0c316d fix(mcp): preserve minimum input requirements in object schemas

📊 Changes

2 files changed (+68 additions, -8 deletions)

View changed files

📝 src/contracts/toolSchemaMetadata.ts (+56 -4)
📝 tests/boundary/mcp/toolSchemaValidity.test.ts (+12 -4)

📄 Description

Summary

Fixes the MCP projection for the three schemas whose anyOf appeared at the root. The projection now exposes type: "object" and root-level properties, merging properties across branches; the canonical Zod parser still enforces the full input rules when a tool is called.

For project_managed_application_graph, the advertised schema cannot express the “at least one source” rule without a root union, which is incompatible with the affected strict clients. The server-side parser continues to reject invalid inputs.

Closes #1052

Verification

  • npm run build:cached
  • npm run test:focused -- tests/boundary/mcp/toolSchemaValidity.test.ts src/contracts/toolSchemaMetadata.test.ts — 9 tests passed
  • npm run check:fast

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/1062 **Author:** [@cevieiras](https://github.com/cevieiras) **Created:** 10/8/2026 **Status:** ✅ Merged **Merged:** 10/8/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `fix/mcp-root-union-schemas` --- ### 📝 Commits (4) - [`cc7ae65`](https://github.com/morluto/rea/commit/cc7ae65b9e1c54a98c18caf06cbfc349c528ea45) fix(mcp): flatten root union input schemas - [`5ac0d2f`](https://github.com/morluto/rea/commit/5ac0d2f4fc852c8f7e542078a969da38a105cb28) Merge remote-tracking branch 'origin/main' into maintain/pr-1062 - [`c2d9386`](https://github.com/morluto/rea/commit/c2d9386eb666ac95cd6237bb758a7cd07db33d52) Merge remote-tracking branch 'origin/main' into maintain/pr-1062 - [`c0c316d`](https://github.com/morluto/rea/commit/c0c316d80f40242a17577ecae45ecb9e748ec0e0) fix(mcp): preserve minimum input requirements in object schemas ### 📊 Changes **2 files changed** (+68 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `src/contracts/toolSchemaMetadata.ts` (+56 -4) 📝 `tests/boundary/mcp/toolSchemaValidity.test.ts` (+12 -4) </details> ### 📄 Description ## Summary Fixes the MCP projection for the three schemas whose `anyOf` appeared at the root. The projection now exposes `type: "object"` and root-level properties, merging properties across branches; the canonical Zod parser still enforces the full input rules when a tool is called. For `project_managed_application_graph`, the advertised schema cannot express the “at least one source” rule without a root union, which is incompatible with the affected strict clients. The server-side parser continues to reject invalid inputs. Closes #1052 ## Verification - `npm run build:cached` - `npm run test:focused -- tests/boundary/mcp/toolSchemaValidity.test.ts src/contracts/toolSchemaMetadata.test.ts` — 9 tests passed - `npm run check:fast` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-17 21:08:16 +00:00
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#2615
No description provided.