Skip to content

fix(mcp): preserve nested schema references in tool signatures - #2261

Draft
aryasaatvik wants to merge 1 commit into
UsefulSoftwareCo:v2from
aryasaatvik:fix/cloudflare-schema-signatures
Draft

aryasaatvik wants to merge 1 commit into
UsefulSoftwareCo:v2from
aryasaatvik:fix/cloudflare-schema-signatures

Conversation

@aryasaatvik

Copy link
Copy Markdown
Contributor

Account-routed imported tools currently advertise unknown for referenced input fields and responses because their JSON Schema references point into account branches. Project those local references into distinct root definitions before rendering signatures, preserving each account's types and recursive references.

// Before
{ path: { app_id: unknown; account_id: unknown } }
// After
{ path: { app_id: string; account_id: string } }

The projection changes only the schemas passed to CodeMode; original tool schemas and validation remain intact. Existing account-routing coverage now requires distinct account literals, escaped definition names, recursive sibling fields, and a typed output consumer.

Four focused self-host scenarios pass. The regression fails against the original renderer at the expected value: "work" assertion. Full bun run check remains blocked by twelve existing implicit-any errors in the desktop E2E support and release scenario; core typechecking, formatting, linting, dependency patches, and the remaining contract checks pass.

template-accounts.spec.ts
mcp-catalog.spec.ts
mcp-search-concise.spec.ts
framework-discovery.spec.ts
framework-authoring.spec.ts

This branch has not been deployed

No deployments
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