ToolCall

@Composable
fun ToolCall(part: ToolPart, modifier: Modifier = Modifier, onApproval: (Boolean) -> Unit? = null, onDecision: (ToolDecision) -> Unit? = LocalToolDecision.current?.let { cb -> { decision -> cb(part.id, decision) } })(source)

A tool invocation card (AI Elements <Tool>): tool name, a status pill, and an expandable section with the JSON input and the output / error. While the call awaits approval it shows a Confirmation with approve / deny actions.

Parameters

onApproval

legacy yes/no callback.

onDecision

full decision callback; takes precedence over onApproval. Both callbacks null makes the card read-only.