Pass the parsed tool ref to the deployment tool caller, not the raw body - #519
Merged
Conversation
davidmckayv
requested review from
MikeRyanDev,
guidovizoso,
mxmzb and
tylerslaton
as code owners
September 13, 2026 15:03
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.
What this changes
Restores
mainto a clean typecheck. The agent-tool-call route validates its input intoparsedCall(from #510), but the deployment-tool-caller call still read the rawbody(name: body.name,args: body.args ?? {}) — wherebodyis possibly null andbody.namepossibly undefined, and the narrowing guard that used to cover it was removed. That leftserver/src/app.ts:1333failingbun run typecheckandbun run buildon main.The call now passes the validated, store-shaped values:
name: parsedCall.value.ref(themcp__server__tool→server/toolmapping the parser already performs) andargs: parsedCall.value.args. Same runtime behavior the mapping always produced; the raw, unnarrowedbodyis no longer read.Where it runs
Server route wiring only. No behavior change beyond restoring the intended validated path.
Proof
bun run typecheck,bun run build,bun run lint,bun run format:checkall clean;server/tests/agent-tool-call-input.test.ts26/0.