/** * LLM Platform Detection and Formatting * * Detects LLM platform from clientInfo and formats tools/results accordingly. */ import type { Tool as McpTool, CallToolResult } from '@frontmcp/protocol'; import type { LLMPlatform, ClientInfo } from './client.types'; /** * Client info presets for each LLM platform. * Used by LLM-specific connect helpers. */ export declare const PLATFORM_CLIENT_INFO: Record; /** * Detect LLM platform from clientInfo. * * @param clientInfo - MCP client info from handshake * @returns Detected LLM platform * * @example * ```typescript * detectPlatform({ name: 'openai-agent', version: '1.0.0' }); // 'openai' * detectPlatform({ name: 'claude', version: '1.0.0' }); // 'claude' * detectPlatform({ name: 'my-agent', version: '1.0.0' }); // 'raw' * ``` */ export declare function detectPlatform(clientInfo: ClientInfo): LLMPlatform; /** OpenAI function calling tool format */ export interface OpenAITool { type: 'function'; function: { name: string; description?: string; parameters: Record; strict: boolean; }; } /** Anthropic Claude tool format */ export interface ClaudeTool { name: string; description?: string; input_schema: Record; } /** LangChain tool schema format */ export interface LangChainTool { name: string; description: string; schema: Record; } /** Vercel AI SDK tool format */ export interface VercelAITool { description: string; parameters: Record; } /** Vercel AI tools map */ export type VercelAITools = Record; /** * Union of all platform-specific tool formats. * Returned by formatToolsForPlatform based on detected platform. */ export type FormattedTools = OpenAITool[] | ClaudeTool[] | LangChainTool[] | VercelAITools | McpTool[]; /** * Union of all platform-specific tool result formats. * Returned by formatResultForPlatform based on detected platform. */ export type FormattedToolResult = string | Record | Array<{ type: string; text: string; }> | CallToolResult | CallToolResult['content'] | { text?: string[]; images?: Array<{ data: string; mimeType: string; }>; }; /** * Format MCP tools for the specified LLM platform. * * @param tools - MCP tools from listTools() * @param platform - Target LLM platform * @returns Tools formatted for the platform */ export declare function formatToolsForPlatform(tools: McpTool[], platform: LLMPlatform): FormattedTools; /** * Format MCP CallToolResult for the specified LLM platform. * * Handles both content-based responses (standard CallToolResult) and * toolResult-based responses (newer MCP SDK versions). * * @param result - MCP tool result from callTool() * @param platform - Target LLM platform * @returns Result formatted for the platform */ export declare function formatResultForPlatform(result: CallToolResult, platform: LLMPlatform): FormattedToolResult; //# sourceMappingURL=llm-platform.d.ts.map