The context type passed to the handler. Defaults to ToolInvocationContext.
OptionalcheckOptional hook to determine automatic action for this tool invocation.
The JSON argument string passed to the tool
OptionalconfirmIf set, this tool requires extra confirmation before auto-approval can be enabled.
When a tool has this flag:
If a string is provided, it will be displayed as the custom warning message. If true, a generic warning message will be shown.
Use for tools with broad system access (shell execution, file deletion, etc.)
OptionaldescriptionOptionalproviderOptionalgetOptional method that returns a short, human-readable label for the tool's arguments to display in the chat UI summary.
The raw arguments JSON string passed to the tool.
An object with:
label: A short text to display (e.g. the most important argument value).hasMore: Whether there are additional arguments not shown in the label (renders as ... suffix).
Returns undefined if no short label can be determined.
If this method is not provided, a generic condensed rendering of the arguments JSON is used as fallback.
Defines a tool that can be invoked by language models.