Skip to content

ToolCallCard

A card that renders one tool/function call — name, status, arguments, and output — as a single transcript entry.

Import: package:fleury/fleury.dart, or package:fleury/fleury_core.dart in browser code.

ToolCallCard(
record: ToolCallRecord(
id: 't1',
name: 'benchmark.run',
title: 'Run benchmark',
status: ToolCallStatus.succeeded,
description: 'Capture peer comparison output.',
arguments: const <String, Object?>{
'scenario': 'sb6_data_table',
'peers': <String>['ratatui', 'bubbletea'],
},
),
)

Tool text is sanitized before it reaches the screen. The card shows a Copy button when copyEnabled is true (the default), and a Cancel button while the call is queued or running if onCancel is set.

ParameterTypeDefaultDescription
record:ToolCallRecordrequiredTool-call data to render.
copyEnabled:booltrueWhether the card exposes copy UI and semantic copy.
copyOptions:ToolCallCopyOptionsconst ToolCallCopyOptions()Clipboard/export options for copied tool-call summaries. Its ToolCallCopyOptions.maxOutputLength also cuts the output shown on the card.
onCopy:void Function(ToolCallCopyResult result)?—Called after a copy attempt completes.
onCancel:VoidCallback?—Called when the cancel action is invoked while the record is busy.
width:int?—Optional fixed width for the card content.

ToolCallCard is defined in packages/fleury/lib/src/catalog/tool_call_card.dart.

Category: Agent surfaces · All widgets