New to Telerik UI for Blazor? Start a free 30-day trial
Blazor LLM Kit ToolCall
Updated on Aug 13, 2026
The ToolCall component shows a tool invocation made by the agent, including the tool name, its input parameters, and the result. It also supports a human-in-the-loop approval flow where users can approve or reject the tool execution before it runs.
Use the component when an agent requests access to an external system such as a database, API, or file store, and you want to give users visibility and control over that action.
Creating Blazor ToolCall
To use the ToolCall component:
- Add the
<TelerikToolCall>tag. - Set the
Labelparameter to the tool name. - Set the
Stateparameter to aToolCallStatevalue that reflects the current execution state. - Set the
Parametersparameter to an object representing the tool inputs. - (optional) Set
ApprovalTextto describe what the tool will do. This text appears whenStateisToolCallState.AwaitingApproval. - (optional) Subscribe to
OnActionto handle approve and reject actions. - (optional) Set
Resultto display the tool output after execution. - (optional) Set
ErrorTextto display an error message whenStateisToolCallState.Error.
Completed ToolCall showing tool name, parameters, and execution metadata
<TelerikToolCall Label="query_database"
SecondaryLabel="analytics · db · 120ms"
State="ToolCallState.Completed"
Expandable="true"
Expanded="true"
Parameters="@ToolParameters" />
@code {
private object ToolParameters { get; } = new
{
database = "analytics",
query = "SELECT customer_name, SUM(revenue) AS total FROM orders WHERE quarter = 'Q1 2025' GROUP BY customer_name ORDER BY total DESC LIMIT 5"
};
}
ToolCall awaiting user approval before execution
<TelerikToolCall Label="send_email"
State="@ToolState"
ApprovalText="Send a summary email to the top 5 customers."
Parameters="@ToolParameters"
OnAction="@OnToolAction"
Expandable="true"
Expanded="@Expanded" />
@code {
private bool Expanded { get; set; } = true;
private ToolCallState ToolState { get; set; } = ToolCallState.AwaitingApproval;
private object ToolParameters { get; } = new
{
recipients = "top-5-customers",
subject = "Q1 2025 Revenue Summary"
};
private void OnToolAction(ToolCallAction action)
{
ToolState = action == ToolCallAction.Approve ? ToolCallState.Completed : ToolCallState.Error;
}
}
ToolCall API
Get familiar with all ToolCall parameters, states, and events in the ToolCall API Reference.