Repository navigation
Conversation
params fixes one argument, but a tool keeps every other argument it takes, and some of them can widen what the fixed one bounds. A server's schemas are listed while the agent runs, so an argument it adds later would reach the model without anyone declaring it. only names the arguments the model may write, by tool out of allow, as it does for an openapi block. The rest are taken out of the schema the model is shown and dropped from each call even when the model writes them; a params value still rides. validate refuses an argument that is both listed and fixed, and only, like params, needs allow to hold its tool names against. A listed argument the server does not declare is logged and the tool is still offered, since the miss opens nothing up. A fixed one it does not declare still keeps the tool away. 🤖 Generated with Claude Code
# Conflicts: # src/gete/runtime/mcp.py
When only left out an argument the server's schema requires, and params did not fix it, the tool was offered with the argument dropped from its schema. Every call then went out without it, and the server refused each one, while the model kept being shown a tool it could never use. An openapi block refuses the same declaration in validate; an mcp block can only see the schema once the tools are listed, so that is where the tool is now kept away, with a warning that names the tool and the argument. The warning that only names an argument the server does not declare now goes through the same once-per-toolset path as the others, since it would otherwise repeat on every turn as well. 🤖 Generated with Claude Code
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.
Stacked on #105; review that one first.
Why
paramsfixes one argument, but the tool keeps every other argument it takes, and some of them can widen what the fixed one bounds. A server's schemas are also listed while the agent runs, not packed, so an argument the server adds later would reach the model without anyone declaring it.An
openapi:block answers this withonly, which names what the model may write so that the description growing fails safe. This brings the same tomcp:blocks.What changes
onlyon anmcp:block, keyed by tool name, listing the arguments the model may write:Every other argument is taken out of the
inputSchemathe model is shown (propertiesandrequired) and dropped from each call even when the model writes it. Aparamsvalue still rides.Names are top-level arguments, taken literally.
openapi:'s dotted paths into a body are not carried over; nothing has needed them for MCP tools.validate refuses an
onlytool name outsideallow,onlywithoutallow(same reasoning asparams), and an argument that is both listed inonlyand fixed byparams, as foropenapi:.Drift. An argument
onlylists that the listed schema does not declare is logged, and the tool is still offered: the miss opens nothing up, the model just cannot write what the declaration meant it to. A fixed argument the schema does not declare still keeps the tool away, as in the previous PR. So does an argument the schema requires thatonlydoes not list andparamsdoes not fix: every call would go out without it and be refused. Anopenapi:block refuses the same declaration in validate.The previous PR's
PinnedMcpToolbecomesNarrowedMcpTool, holding both the fixed values and the list.README explains why fixing one argument is not enough on its own, and how
onlyrelates toparams.Compatibility
Additive. Blocks without
onlybehave as before.Testing
onlyname outsideallow.onlyleaves out is not sent even when the model writes it (the server answers with its own default), and aparamsvalue is sent althoughonlydoes not list it.onlynames outsideallow,onlywithoutallow, and an argument both listed and fixed are refused.pytest,ruff check,ruff format --checkandmypypass locally.