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
ChatMCPOptions
Defined in: packages/ai/src/activities/chat/mcp/types.ts:55
Options controlling MCP tool discovery and lifecycle for a chat() call.
Properties#
clients#
clients: MCPToolSource[];Defined in: packages/ai/src/activities/chat/mcp/types.ts:59
The MCP clients or client pools to discover tools from and manage.
connection?#
optional connection?: MCPConnectionPolicy;Defined in: packages/ai/src/activities/chat/mcp/types.ts:66
Connection lifecycle policy applied to all clients when the run ends.
Defaults to 'close'.
lazyTools?#
optional lazyTools?: boolean;Defined in: packages/ai/src/activities/chat/mcp/types.ts:74
When true, tool schemas are fetched lazily (forwarded to tools({ lazy: true })).
Defaults to false.
onDiscoveryError?#
optional onDiscoveryError?: (error, source) => void | Promise<void>;Defined in: packages/ai/src/activities/chat/mcp/types.ts:85
Called when tool discovery fails for a single source.
- Throw (or re-throw) from this handler to fail the entire chat call fast.
- Return normally to skip that source and continue with remaining clients.
- Omit this handler entirely to rethrow the error (fail-fast by default).
Async handlers are awaited, so a rejected promise also fails fast.
Parameters#
error#
unknown
source#
Returns#
void | Promise<void>