/** * MCP Tool Conversion Utilities * * Converts MCP tools to the @compilr-dev/agents Tool format */ import type { Tool, ToolInputSchema } from '../tools/index.js'; import { createSuccessResult } from '../tools/index.js'; import type { MCPClient } from './client.js'; import type { MCPToolDefinition, MCPToolResult, MCPContentBlock } from './types.js'; /** * Options for converting MCP tools */ export interface MCPToolConversionOptions { /** Prefix for tool names (default: 'mcp') */ prefix?: string; /** Whether to include server name in tool name (default: true) */ includeServerName?: boolean; } /** * Convert MCP content blocks to a string result */ export declare function contentBlocksToString(blocks: MCPContentBlock[]): string; /** * Convert an MCP tool result to our ToolExecutionResult format */ export declare function convertMCPResult(result: MCPToolResult): ReturnType; /** * Convert MCP input schema to our ToolInputSchema format */ export declare function convertInputSchema(schema: MCPToolDefinition['inputSchema']): ToolInputSchema; /** * Generate a unique tool name for an MCP tool */ export declare function generateToolName(serverName: string, toolName: string, options?: MCPToolConversionOptions): string; /** * Convert a single MCP tool to our Tool format * * @param mcpTool The MCP tool definition from the server * @param client The MCP client to use for calling the tool * @param options Conversion options * @returns A Tool that can be registered with the agent * * @example * ```typescript * const tools = await client.listTools(); * const convertedTools = tools.map(t => mcpToolToTool(t, client)); * agent.toolRegistry.registerTools(convertedTools); * ``` */ export declare function mcpToolToTool(mcpTool: MCPToolDefinition, client: MCPClient, options?: MCPToolConversionOptions): Tool; /** * Convert multiple MCP tools to our Tool format */ export declare function mcpToolsToTools(mcpTools: MCPToolDefinition[], client: MCPClient, options?: MCPToolConversionOptions): Tool[];