Summary
The search tool description in McpToolDefinitions.cs is very long (multiple KB of prose covering tokenization, ranking, examples, and edge cases). MCP clients receive the full tool list on every initialize handshake, so this multiplies session-startup token cost across all clients regardless of whether they ever call search. Other tools (e.g., references) keep descriptions terse — search is the outlier.
Where
src/CodeIndex/Mcp/McpToolDefinitions.cs (search tool description block)
Suggested approach
(1) Audit each tool description for length and trim search down to a 1-2 paragraph summary plus a "see USER_GUIDE.md#search for details" pointer. (2) Move ranking/tokenizer/example detail to USER_GUIDE.md where it belongs. (3) Establish an informal cap (e.g., 1KB per tool description) and call it out in AGENT_GUIDE.md for future tools.
Summary
The
searchtool description inMcpToolDefinitions.csis very long (multiple KB of prose covering tokenization, ranking, examples, and edge cases). MCP clients receive the full tool list on everyinitializehandshake, so this multiplies session-startup token cost across all clients regardless of whether they ever callsearch. Other tools (e.g.,references) keep descriptions terse — search is the outlier.Where
src/CodeIndex/Mcp/McpToolDefinitions.cs(search tool description block)Suggested approach
(1) Audit each tool description for length and trim search down to a 1-2 paragraph summary plus a "see USER_GUIDE.md#search for details" pointer. (2) Move ranking/tokenizer/example detail to
USER_GUIDE.mdwhere it belongs. (3) Establish an informal cap (e.g., 1KB per tool description) and call it out inAGENT_GUIDE.mdfor future tools.