Class References
Function References
- text
- textOptions
- combineStrategies
- convertMessagesToModelMessages
- convertZodToJsonSchema
- createReplayStream
- embedding
- generateMessageId
- maxIterations
- messages
- modelMessageToUIMessage
- modelMessagesToUIMessages
- normalizeToUIMessage
- parsePartialJSON
- summarize
- toServerSentEventsStream
- toServerSentEventsResponse
- toolDefinition
- uiMessageToModelMessages
- realtimeToken
- untilFinishReason
Interface References
- AIAdapter
- AIAdapterConfig
- AgentLoopState
- AudioPart
- AudioVisualization
- BaseStreamChunk
- TextCompletionChunk
- TextOptions
- ChunkRecording
- ChunkStrategy
- ClientTool
- ContentPartSource
- ContentStreamChunk
- DefaultMessageMetadataByModality
- DocumentPart
- DoneStreamChunk
- EmbeddingOptions
- EmbeddingResult
- ErrorStreamChunk
- ImagePart
- InternalToolCallState
- JSONParser
- ModelMessage
- ProcessorResult
- ProcessorState
- RealtimeAdapter
- RealtimeClientOptions
- RealtimeConnection
- RealtimeMessage
- RealtimeSessionConfig
- RealtimeToken
- RealtimeTokenAdapter
- RealtimeTokenOptions
- ResponseFormat
- ServerTool
- StreamProcessorEvents
- StreamProcessorHandlers
- StreamProcessorOptions
- SummarizationOptions
- SummarizationResult
- TextPart
- ThinkingPart
- ThinkingStreamChunk
- Tool
- ToolCall
- ToolCallPart
- ToolCallStreamChunk
- ToolConfig
- ToolDefinition
- ToolDefinitionConfig
- ToolDefinitionInstance
- ToolInputAvailableStreamChunk
- ToolResultPart
- ToolResultStreamChunk
- UIMessage
- VideoPart
Type Alias References
- AgentLoopStrategy
- AnyClientTool
- TextStreamOptionsForModel
- TextStreamOptionsUnion
- ConstrainedContent
- ConstrainedModelMessage
- ContentPart
- ContentPartForModalities
- ExtractModalitiesForModel
- ExtractModelsFromAdapter
- InferToolInput
- InferToolName
- InferToolOutput
- MessagePart
- RealtimeEvent
- RealtimeMessagePart
- RealtimeMode
- RealtimeStatus
- ModalitiesArrayToUnion
- Modality
- StreamChunk
- ToolCallState
- ToolResultState
Variable References
MCPToolSource
Defined in: packages/ai/src/activities/chat/mcp/types.ts:25
Minimal structural shape that chat({ mcp }) needs from an MCP client.
@tanstack/ai-mcp's MCPClient and MCPClients satisfy this interface by shape — the core @tanstack/ai package does NOT import @tanstack/ai-mcp (ai-mcp depends on ai, not the reverse).
Properties#
close#
close: () => Promise<void>;Defined in: packages/ai/src/activities/chat/mcp/types.ts:30
Returns#
Promise<void>
readResource?#
optional readResource?: (uri) => Promise<McpResourceReadResult>;Defined in: packages/ai/src/activities/chat/mcp/types.ts:38
Reads an MCP resource by URI. Used by the chat manager to eagerly fetch ui:// resource widgets (MCP Apps) after a tool result resolves.
Optional — sources that do not serve ui:// resources need not implement this method. ai-mcp's MCPClient satisfies this structurally.
Parameters#
uri#
string
Returns#
Promise<McpResourceReadResult>
tools#
tools: (options?) => Promise<AnyServerTool[]>;Defined in: packages/ai/src/activities/chat/mcp/types.ts:29
Parameters#
options?#
lazy?#
boolean
Returns#
Promise<AnyServerTool[]>