ToolPart

@Serializable
@SerialName(value = "tool")
data class ToolPart(val id: String, val name: String, val state: ToolState = ToolState.INPUT_STREAMING, val input: String = "", val output: String? = null, val errorText: String? = null, val title: String? = null, val preliminary: Boolean = false, val subagent: Message? = null, val kind: ToolKind = ToolKind.Function, val source: String? = null, val category: ToolCategory? = null, val location: String? = null, val approvalAnswers: ApprovalAnswers = ApprovalAnswers.All) : Part(source)

One tool invocation. id is the tool call id; input is the raw JSON arguments and output the tool result as text.

Constructors

Link copied to clipboard
constructor(id: String, name: String, state: ToolState = ToolState.INPUT_STREAMING, input: String = "", output: String? = null, errorText: String? = null, title: String? = null, preliminary: Boolean = false, subagent: Message? = null, kind: ToolKind = ToolKind.Function, source: String? = null, category: ToolCategory? = null, location: String? = null, approvalAnswers: ApprovalAnswers = ApprovalAnswers.All)

Properties

Link copied to clipboard

While ToolState.APPROVAL_REQUESTED: what the approval can answer besides yes / no.

Link copied to clipboard

What the call does to the world (ACP ToolKind); decides how a step is shown. Set upstream, like kind.

Link copied to clipboard

title or, failing that, the tool name.

Link copied to clipboard
Link copied to clipboard
open override val id: String
Link copied to clipboard
Link copied to clipboard
open override val isStreaming: Boolean
Link copied to clipboard

What the call is, for rendering; set by the protocol mapping or the tool, never guessed by the UI.

Link copied to clipboard

The file path or URL the call acts on (ACP ToolCallLocation), when it has one.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

output is an interim result that later updates will replace (AI SDK preliminary tool results).

Link copied to clipboard

Who provides the tool when it is not the agent itself, e.g. an MCP server's name.

Link copied to clipboard
Link copied to clipboard

the live run of a delegated agent (AI SDK subagent pattern): the nested reply with its own reasoning, tool calls and text.

Link copied to clipboard

human-readable label (AI SDK title), e.g. an MCP tool's title and server; UIs fall back to name.