Module mcp_deferred
Expand description
Deferred MCP tool loading — stubs and activated-tool tracking.
Structs§
- Activated
Tool Set - Per-conversation MCP activation and built-in schema selection.
- Deferred
McpTool Set - Collection of all deferred MCP tool stubs discovered at startup.
Provides keyword search for
tool_search. - Deferred
McpTool Stub - 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
McpToolWrapperon 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 calltool_searchto activate them. - build_
deferred_ tools_ section_ excluding - build_
deferred_ tools_ section_ filtered