Reduce MCP tool output context bloat by ~85%#177
Merged
Conversation
- extract_symbols: exclude code by default (90% reduction, 22K→2K tokens) - Add include_code param (default false) to control code inclusion - AI can request code when needed via include_code=true - get_file_tree: compact mode by default (82% reduction, 18K→3K tokens) - Add compact param (default true) for newline-separated paths - Add include_dirs param to optionally include directory entries - New get_symbol_code tool for lazy code loading - Fetch specific symbol's code on-demand - Enables efficient "browse then drill down" workflows These defaults significantly reduce context usage while maintaining full functionality through optional parameters.
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
Reduces context usage from two MCP tool outputs:
extract_symbolsget_file_treeChanges
extract_symbols: Add
include_codeparam (defaultfalse)include_code=truewhen code is neededget_file_tree: Add
compactmode (defaulttrue)include_dirsparam to optionally include directoriesNew
get_symbol_codetool: Lazy load specific symbol codeTest plan