MessagePart
A structured part of a message (text, tool call, or tool result).
Properties
Section titled “Properties”
optionalargs?:Record<string,unknown>
Arguments passed to the tool (for “tool-call” parts).
result?
Section titled “result?”
optionalresult?:unknown
Result returned by the tool (for “tool-result” parts).
optionaltext?:string
Text content (for “text” parts).
toolCallId?
Section titled “toolCallId?”
optionaltoolCallId?:string
Tool call ID linking a call to its result.
toolName?
Section titled “toolName?”
optionaltoolName?:string
Name of the tool being called or that produced the result.
type:
"text"|"tool-call"|"tool-result"