Skip to main content

Module mcp_deferred

Module mcp_deferred 

Expand description

Deferred MCP tool loading — stubs and activated-tool tracking.

Structs§

ActivatedToolSet
Per-conversation MCP activation and built-in schema selection.
DeferredMcpToolSet
Collection of all deferred MCP tool stubs discovered at startup. Provides keyword search for tool_search.
DeferredMcpToolStub
A lightweight stub representing a known-but-not-yet-loaded MCP tool. Contains only the prefixed name, a human-readable description, and enough information to construct the full McpToolWrapper on activation.

Functions§

build_deferred_tools_section
Build the <available-deferred-tools> section for the system prompt. Lists tool names with a one-line summary each (the first non-empty line of the description, capped) so the LLM knows what is available without consuming context window on full schemas or full docstrings. Includes an instruction block that tells the LLM to call tool_search to activate them.
build_deferred_tools_section_excluding
build_deferred_tools_section_filtered