Skip to main content

Module tool

Module tool 

Source
Expand description

One configured MCP server’s tool, as a ToolExecutor (#5428).

Why: a tool discovered over tools/list has to sit in the same crate::tools::ToolRegistry as every in-process tool so the agent loop dispatches it identically — the seam trusty_agents::tools::mcp_live uses for the same job. What: McpBridgeTool holds the composed registry name, the tool’s REAL name on the server, and a shared client handle. execute forwards to tools/call and renders the MCP content frames as text. Every failure is a recoverable ToolResult::err, never fatal: one broken server must not end a task run. Test: super::tests::tool_tests, mcp_loader_e2e::end_to_end_dispatch_echoes_through_the_registry.

Structs§

McpBridgeTool
A ToolExecutor bridging one tool on one configured MCP server.

Constants§

MAX_INPUT_SCHEMA_BYTES
Upper bound on a passed-through inputSchema, in bytes.

Functions§

build_schema
Build the OpenAI-shape function descriptor for one discovered tool.
composed_name
Compose the registry name for one server’s tool.
is_mcp_error
Whether an MCP result carries the in-band isError flag.
render_result
Render an MCP tools/call result as the text the model sees.