@tanstack/ai-mcp
Version:
Host-side Model Context Protocol client for TanStack AI: discover and run MCP server tools, resources, and prompts in any adapter's chat() loop, with generated end-to-end types.
15 lines (14 loc) • 523 B
TypeScript
import { ContentPart } from '@tanstack/ai';
/**
* Converts a single MCP resource content block to a TanStack `ContentPart`.
*
* - `text` field present → `{ type: 'text', content: text }`
* - `blob` field present → `{ type: 'text', content: '[binary resource <uri>]' }`
* - otherwise → `{ type: 'text', content: JSON.stringify(content) }`
*/
export declare function mcpResourceToContentPart(content: {
uri?: string;
text?: string;
blob?: string;
[key: string]: unknown;
}): ContentPart;