Get Tool Information
tool_infoRetrieve complete information about a specific tool, including all details about its input schema and purpose.
Instructions
Get complete information about a specific tool including all details.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tool_name | Yes | Name of the tool to get complete information for. |
Implementation Reference
- index.ts:178-195 (handler)TypeScript implementation of the 'tool_info' tool handler. Fetches tool details from the UTCP client's tool repository by name and returns them as JSON.
mcp.registerTool("tool_info", { title: "Get Tool Information", description: "Get complete information about a specific tool including all details.", inputSchema: { tool_name: z.string().describe("Name of the tool to get complete information for."), }, }, async (input) => { const client = await initializeUtcpClient(); try { const tool = await client.config.tool_repository.getTool(input.tool_name); if (!tool) { return { content: [{ type: "text", text: JSON.stringify({ success: false, error: `Tool '${input.tool_name}' not found` }) }] }; } return { content: [{ type: "text", text: JSON.stringify({ success: true, tool: tool }) }] }; } catch (e: any) { return { content: [{ type: "text", text: JSON.stringify({ success: false, error: e.message }) }] }; } }); - index.ts:178-195 (registration)Registration of the 'tool_info' tool on the MCP server via mcp.registerTool().
mcp.registerTool("tool_info", { title: "Get Tool Information", description: "Get complete information about a specific tool including all details.", inputSchema: { tool_name: z.string().describe("Name of the tool to get complete information for."), }, }, async (input) => { const client = await initializeUtcpClient(); try { const tool = await client.config.tool_repository.getTool(input.tool_name); if (!tool) { return { content: [{ type: "text", text: JSON.stringify({ success: false, error: `Tool '${input.tool_name}' not found` }) }] }; } return { content: [{ type: "text", text: JSON.stringify({ success: true, tool: tool }) }] }; } catch (e: any) { return { content: [{ type: "text", text: JSON.stringify({ success: false, error: e.message }) }] }; } }); - index.ts:181-183 (schema)Input schema for 'tool_info' - requires a 'tool_name' string parameter validated with Zod.
inputSchema: { tool_name: z.string().describe("Name of the tool to get complete information for."), }, - Python implementation of the 'tool_info' tool handler using FastMCP decorator. Fetches tool details using model_dump().
@mcp.tool() async def tool_info(tool_name: str) -> Dict[str, Any]: """Get complete information about a specific tool including all details using model_dump(). Args: tool_name: Name of the tool to get complete information for Returns: Dictionary with success status and complete tool information with model_dump() """ client = await initialize_utcp_client() try: # Search for the specific tool tool = await client.config.tool_repository.get_tool(tool_name) if not tool: return { "success": False, "error": f"Tool '{tool_name}' not found" } # Return complete tool information with model_dump() return { "success": True, "tool": tool.model_dump() } except Exception as e: return { "success": False, "error": str(e) } - python_mcp_bridge/utcp-client-mcp.py:191-192 (registration)Registration of the 'tool_info' tool via the @mcp.tool() decorator in the Python bridge.
@mcp.tool() async def tool_info(tool_name: str) -> Dict[str, Any]: