Skip to content

docs(ai): load a deferred MCP tool's parameters before its first call, for every MCP server #1277

Backlog

Description

@steward-warden

Problem

Agents often call an MCP tool before they have loaded its parameters. In sessions where the client lists MCP tools by name only and loads a tool's schema on request (a tool-search tool), the first call goes out with no arguments or with guessed parameter names, fails, and is retried once the error has shown the schema.

The instructions already cover this, but only in two narrow places: the GitHub CLI instructions say to look up the cfwf MCP tools before the first cfwf command, and the CodeGraph instructions say to load that one tool by name when deferred. Nothing says it for MCP tools in general (the build, changelog and git servers), and the cfwf rule is worded as a step before a command, so it doesn't stop an agent from calling a mcp__cfwf__ tool it has never loaded.

Evidence

Orchestrator agent transcripts, last 3 days, both owners: 51 errored MCP tool results (deduplicated by tool call), and 40 of them were calls made before the tool's schema was loaded. By server: workflow (cfwf) 31, changelog 4, git 3, build 2. The most common one by far was posting a comment (25 times). In almost every case the agent did not call the tool-search tool for that tool before the failing call. The next call nearly always succeeded, so the cost is one wasted turn and a misleading error in the transcript each time, but it happens in about one session in three.

Where to look: ai/global/github-cli.instructions.md line 41 (the cfwf-only lookup rule) and ai/global/codegraph.instructions.md line 17 (the CodeGraph-only one).

Proposed change

Add one general rule to the global instructions (where tool use in general is covered), and point the two existing rules at it:

  • Any mcp__<server>__<tool> that is listed by name only must have its schema loaded (by exact name, through the tool-search tool) before its first call in a session; one load covers the rest of the session.
  • Load all the tools you expect to need from one server in a single search, rather than one at a time.
  • Never call an MCP tool with empty or guessed arguments to discover its parameters.

Acceptance criteria

  • The global instructions carry one rule for loading deferred MCP tools that applies to every MCP server.
  • The cfwf and CodeGraph sections refer to it rather than restating it.
  • After the sync reaches the orchestrator repositories, the share of MCP errors caused by unloaded schemas drops well below the current four in five (measured by the daily MCP error scan).

Activity

  1. added
    AI-Work
    Medium
    Enhancement
    Blocked
    on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    AI-WorkBlockedEnhancementMedium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions