Skip to content

Splice observed shapes into the MCP result envelope - #1765

Closed
RhysSullivan wants to merge 1 commit into
mainfrom
mcp-shape-splice
Closed

Splice observed shapes into the MCP result envelope#1765
RhysSullivan wants to merge 1 commit into
mainfrom
mcp-shape-splice

Conversation

@RhysSullivan

Copy link
Copy Markdown
Collaborator

Follow-up to #1759, covering the case the Blacksmith post actually benchmarked: MCP tools whose servers declare no output schema. Those tools were excluded from muscle memory because the MCP plugin always synthesizes a CallToolResult envelope schema — declared as far as the serve rule could tell, but with an untyped structuredContent placeholder.

Slot mechanism (generic, in the serving layer)SHAPE_SLOT_KEY (x-executor-shape-slot) marks a placeholder subschema inside a declared schema. tools.schema now has a second serve path: when a declared output schema carries marked slots, the observed shape's counterpart at the same path is spliced into exactly those slots, keeping the declared structure around them. Markers are stripped before serving either way; outputSchemaSource: "observed" is set only when a slot was actually filled. Kept out of plugin internals deliberately so it ports through the planned plugin-system removal.

MCP plugin — implements the previously-unused projectToolSchema hook: when the persisted envelope's structuredContent is the synthesized placeholder (identified by required not listing it, which only happens when the server declared nothing), the slot is marked at read time. No persisted-row change, so every existing catalog row gets the behavior immediately, no refresh needed.

Evidence — new integration test (real MCP server over streamable-http through a real executor): cold describe shows the envelope with an untyped slot and no marker leakage; one call; warm describe serves structuredContent: { value: string; length: number; ok: boolean } with outputSchemaSource: observed. New e2e scenario (selfhost + cloud, both passing) drives the same journey through the public surfaces with the provenance note asserted. 6 new splice unit tests. New makeUndeclaredStructuredMcpServer testing fixture.

Known limitation — servers that return their payload as JSON text inside a content block (rather than structuredContent) still teach only text: string; shape inference does not parse string contents. Typing those would require bounded JSON-in-string inference (contentSchema) — a possible follow-up, noted here so the warm-describe win isn't overstated for text-only servers.

Local note: full unit suite green per package; the fully-parallel local run hit 5s-timeout/port-cross-talk flakes in unrelated OAuth-flow tests (pass in isolation) — CI shards are the gate.

@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Cloudflare preview

Torn down — the PR is closed.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
executor-marketing 4566b5a Commit Preview URL

Branch Preview URL
Aug 27 2026, 06:38 AM

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
executor-cloud 4566b5a Aug 27 2026, 06:39 AM

@pkg-pr-new

pkg-pr-new Bot commented Aug 27, 2026

Copy link
Copy Markdown

Open in StackBlitz

@executor-js/cli

npm i https://pkg.pr.new/@executor-js/cli@1765

@executor-js/config

npm i https://pkg.pr.new/@executor-js/config@1765

@executor-js/execution

npm i https://pkg.pr.new/@executor-js/execution@1765

@executor-js/sdk

npm i https://pkg.pr.new/@executor-js/sdk@1765

@executor-js/codemode-core

npm i https://pkg.pr.new/@executor-js/codemode-core@1765

@executor-js/runtime-quickjs

npm i https://pkg.pr.new/@executor-js/runtime-quickjs@1765

@executor-js/plugin-file-secrets

npm i https://pkg.pr.new/@executor-js/plugin-file-secrets@1765

@executor-js/plugin-graphql

npm i https://pkg.pr.new/@executor-js/plugin-graphql@1765

@executor-js/plugin-keychain

npm i https://pkg.pr.new/@executor-js/plugin-keychain@1765

@executor-js/plugin-mcp

npm i https://pkg.pr.new/@executor-js/plugin-mcp@1765

@executor-js/plugin-onepassword

npm i https://pkg.pr.new/@executor-js/plugin-onepassword@1765

@executor-js/plugin-openapi

npm i https://pkg.pr.new/@executor-js/plugin-openapi@1765

executor

npm i https://pkg.pr.new/executor@1765

commit: 4566b5a

@RhysSullivan

Copy link
Copy Markdown
Collaborator Author

Superseded by the MCP data-contract change (semantic data + core-owned result encoding): with data unwrapped to the payload, MCP tools fall under the plain undefined-schema serve rule and the slot splice is unnecessary. Test fixture and e2e journey carry over to the new PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant