Skip to content

search tool description is ~6KB; bloats every MCP initialize handshake #1640

Description

@Widthdom

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions