Skip to content

Progressive MCP tool disclosure (search_tools / use_tool) #34

Description

@aakashrajput

Why

Attaching a fat MCP server (some expose 50+ tools) floods the model's context with tool schemas it mostly won't use — slower, costlier, and it degrades tool selection.

What

Progressive MCP tool disclosure:

  • When total MCP tool count exceeds a threshold (config, default ~15), stop inlining all MCP schemas. Instead expose two meta-tools:
    • search_tools(query) — fuzzy-search attached MCP tools by name/description, returns top matches with their schemas
    • use_tool(name, arguments) — invoke a discovered tool by its namespaced name
  • Below the threshold, keep current inline behavior
  • Permission prompts must show the real underlying tool name, not use_tool

Where to start

  • MCP client + tool registration: src/mcp/client.ts, tool schema assembly in src/tools/index.ts
  • Namespacing is already server__tool

Acceptance criteria

  • With a many-tool MCP server attached, request payload shrinks (assert schema count), and the agent can still discover + invoke a tool end-to-end
  • Threshold configurable; typecheck + tests green

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions