import { Tool, type ToolContext, type ToolStreamGenerator } from './tool.js'; import type { ToolSpec } from './types.js'; import type { JSONSchema } from '../types/json.js'; import type { McpClient } from '../mcp.js'; export interface McpToolConfig { name: string; description: string; inputSchema: JSONSchema; client: McpClient; } /** * A Tool implementation that proxies calls to a remote MCP server. * * Unlike FunctionTool, which wraps local logic, McpTool delegates execution * to the connected McpClient and translates the SDK's response format * directly into ToolResultBlocks. */ export declare class McpTool extends Tool { readonly name: string; readonly description: string; readonly toolSpec: ToolSpec; private readonly mcpClient; constructor(config: McpToolConfig); stream(toolContext: ToolContext): ToolStreamGenerator; /** * Maps a single MCP content item to an SDK ToolResultContent block. * * @param item - MCP content item from tool result * @returns Mapped content block */ private _mapMcpContent; /** * Maps an MCP image content item to an ImageBlock. * * @param record - MCP image content with data (base64) and mimeType * @returns ImageBlock or TextBlock fallback if format is unsupported */ private _mapMcpImageContent; /** * Maps an MCP embedded resource to an SDK content block. * Text resources become TextBlock, blob resources with image MIME types become ImageBlock. * * @param record - MCP embedded resource content * @returns Mapped content block or undefined if unsupported */ private _mapMcpEmbeddedResource; /** * Type Guard: Checks if value matches the expected MCP SDK result shape. * \{ content: unknown[]; isError?: boolean \} */ private _isMcpToolResult; /** * Type Guard: Checks if a media format is a supported image format. */ private _isImageFormat; } //# sourceMappingURL=mcp-tool.d.ts.map