New to Telerik UI for BlazorStart 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:

  1. Add the <TelerikToolCall> tag.
  2. Set the Label parameter to the tool name.
  3. Set the State parameter to a ToolCallState value that reflects the current execution state.
  4. Set the Parameters parameter to an object representing the tool inputs.
  5. (optional) Set ApprovalText to describe what the tool will do. This text appears when State is ToolCallState.AwaitingApproval.
  6. (optional) Subscribe to OnAction to handle approve and reject actions.
  7. (optional) Set Result to display the tool output after execution.
  8. (optional) Set ErrorText to display an error message when State is ToolCallState.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.

Next Steps

See Also