Bound MCP tool discovery payload - #5071
Merged
Merged
Conversation
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.
Summary
tools/listreturn a deterministic compact catalog for all enabled tools while retaining authoritative invocation schemas.format: "full", exactnames, and standard cursor pagination.changelog.d/unreleased/5059.fixed.md, including regression coverage related to Audit MCP, LSP, JSON-RPC, and rate-limit protocol boundaries #4336.Root cause and impact
The default MCP catalog serialized long bilingual descriptions, examples, capability metadata, and recursive output schemas for every tool, while initialization repeated workflow guidance. That consumed a large part of an agent context before its first query.
The final real stdio exchange measures 3,016 UTF-8 bytes for
initializeand 57,561 UTF-8 bytes for the defaulttools/listresponse, below the documented 64-KiB catalog budget. All 25 tool names and complete call-time input constraints remain discoverable; clients can request selected full definitions on demand.Validation
dotnet build CodeIndex.sln -c Release --no-restore -p:UseSharedCompilation=false— 0 warnings, 0 errorsdotnet run --project tools/CodeIndex.Changelog -p:UseSharedCompilation=false -- check— 8 fragments validtools/list57,561 bytes; compact safety/authority guidance presentgit diff --check origin/main...HEADAdversarial review
Two mandatory Codex adversarial-review rounds were completed. The first found two issues (the suggestion source-code warning and filtered prompt guidance); both were fixed. The second found missing bounded authority caveats for analysis tools; the compact catalog now retains and tests those caveats.
Follow-up candidates
None identified within the requested scope.
Fixes #5059