Skip to content

MessagePart

A structured part of a message (text, tool call, or tool result).

optional args?: Record<string, unknown>

Arguments passed to the tool (for “tool-call” parts).


optional result?: unknown

Result returned by the tool (for “tool-result” parts).


optional text?: string

Text content (for “text” parts).


optional toolCallId?: string

Tool call ID linking a call to its result.


optional toolName?: string

Name of the tool being called or that produced the result.


type: "text" | "tool-call" | "tool-result"