Skip to content

Feature Request: Deferred MCP Tool Loading + Tool Search Tool #979

@jasonct05

Description

@jasonct05

Problem

When an agent is configured with a large number of MCP tools — for example, one tool per 3rd-party Graph connector registered in an organization (Jira, Salesforce, ServiceNow, Azure DevOps, and potentially 100+ others) — sending every tool schema to the model upfront causes significant context window bloat.

Each MCP tool schema typically occupies several hundred tokens. At 100+ connectors, this consumes a meaningful fraction of the context budget before any user message or grounding work has begun. It also degrades model performance: the model attends to a long list of tools it will never need for a given request.

What we need

  1. Deferred (lazy) MCP tool loading
    Tools should be registerable without their schemas being eagerly included in the model's context. A deferred tool is declared to the runtime but its full schema (name, description, input spec) is withheld until the model explicitly requests it. Claude's agent SDK already implements this via an isMcp: true flag on tool registrations. When set, the tool is held back from the initial tool list. The GHCP SDK has no equivalent.

  2. ToolSearch — a tool for discovering deferred tools at runtime
    The model needs a first-class tool to query the deferred tool registry by keyword or semantic description and retrieve matching schemas on demand. Claude's agent SDK exposes this as a ToolSearch tool with a query parameter and a max_results cap; matched tool schemas are injected into the model's context only when needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions