New to Telerik UI for ASP.NET MVCStart a free 30-day trial

ASP.NET MVC Tool Call

Updated on Aug 11, 2026

When agents make decisions that trigger real-world actions, such as querying databases, calling APIs, or browsing the web, users need to know what is being done on their behalf.

The ToolCall component makes these side effects visible by displaying the tool name, input parameters, and output result in a collapsible block. It also supports approval and error states so users remain in control.

Configuration

The State option controls the visual appearance and the interactive elements that are rendered, so keep it synchronized with your backend. Set it to Active when an invocation begins, then change it to Completed or Error once the result is known.

Use Label for the tool name and SecondaryLabel for scannable context, such as a database name, file path, or execution time. This lets users assess the call without expanding the details panel. Pair Icon or StatusSVGIcon with the state to reinforce the outcome visually.

Bind Parameters to the raw input object and Result to the output; both render as formatted JSON by default. Use ResultTemplate when a plain JSON dump does not provide enough detail.

Razor
    @(Html.Kendo().ToolCall()
        .Name("toolCall")
        .Label("query_database")
        .SecondaryLabel("analytics db")
        .State(ToolCallState.Completed)
        .Expandable(true)
        .Expanded(true)
    )

Approval Flow

When State is AwaitingApproval, the component renders approval and denial buttons inside the expanded panel. Set ApprovalText to explain the action before the user makes a decision.

Razor
    @(Html.Kendo().ToolCall()
        .Name("toolCall")
        .Label("send_email")
        .State(ToolCallState.AwaitingApproval)
        .Expandable(true)
        .Expanded(true)
        .ApprovalText("This will send an email to the selected recipients.")
    )

Handle the user's decision through the Action event, which emits a ToolCallActionEvent.

Error State

When State is Error, set ErrorText to show a human-readable description of what went wrong. Use ErrorTemplate to replace the default error message with a custom layout.

Razor
    @(Html.Kendo().ToolCall()
        .Name("toolCall")
        .Label("send_email")
        .State(ToolCallState.Error)
        .Expandable(true)
        .Expanded(true)
        .ErrorText("Connection timeout: Unable to reach database server.")
    )

See Also