list_mcp_tools()

Convert raw MCP tool dicts into MCPToolInfo objects.

Usage

Source

list_mcp_tools(
    tools_data,
    *,
    server_url="",
)

This is a synchronous helper for when you already have the tool list (e.g. from a cached list_tools() response). For live discovery, use discover_mcp_tools().

Parameters

tools_data: list[dict[str, Any]]

A list of dicts, each with name, description, and inputSchema keys (matching mcp.types.Tool).

server_url: str = ""
Optional server URL to attach to each tool info.

Returns

list[MCPToolInfo]
Parsed tool descriptors.

Examples

import talk_box as tb

raw = [
    {
        "name": "greet",
        "description": "Say hello",
        "inputSchema": {"type": "object", "properties": {"name": {"type": "string"}}},
    }
]
tools = tb.list_mcp_tools(raw)
tools[0].name  # "greet"