fix(agent-runtime): preserve MCP tool schema properties - #921
Open
santhiprakash wants to merge 2 commits into
Open
fix(agent-runtime): preserve MCP tool schema properties#921santhiprakash wants to merge 2 commits into
santhiprakash wants to merge 2 commits into
Conversation
Problem: README.md links to evals/README.md, which does not exist. Fix: point the 'our evals' link to evals/buffbench/README.md, the existing evaluation documentation. Verification: confirmed with a local markdown link scan that only the evals/README.md link is broken, and 'ls -l evals/buffbench/README.md' confirms the target exists.
- Problem: MCP tool definitions were being normalized through Zod, which could drop nested JSON Schema details like properties before registration. - Fix: keep the original MCP JSON Schema object on the tool definition and add a regression test that verifies properties.uri survives getToolSet(). - Verification: /home/ubuntu/.bun/bin/bun test packages/agent-runtime/src/__tests__/prompts-schema-handling.test.ts (pass).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
MCP tools registered through the runtime could lose nested JSON Schema details like
propertiesbefore they reached the model-facing tool definition. That breaks parameterized tools such asmarionette__connectfrom issue #912.Triage / Root cause
packages/agent-runtime/src/tools/prompts.tswas round-tripping additional tool definitions through Zod and then re-emitting a sanitized schema. That conversion path was unnecessary for MCP tools and could discard schema shape that callers already supplied.Fix
properties.urisurvivesgetToolSet().Verification
/home/ubuntu/.bun/bin/bun test packages/agent-runtime/src/__tests__/prompts-schema-handling.test.tsNotes / Risks
upstream/mainwith the required preflight script before editing.sdk/src/tools/run-terminal-command.tsandsdk/src/__tests__/run-terminal-command.test.ts; I left those untouched.Model Used
Checklist