Skip to content

ExecutedTool

Namespace: Vercel.AI

public sealed class ExecutedTool

The result of executing a tool.

Inheritance: object

View source

ExecutedTool(string, string, string, bool)

Section titled “ExecutedTool(string, string, string, bool)”
public ExecutedTool(string toolCallId, string toolName, string outputJson, bool isError)

Creates a tool result.

Parameters

Name Type Description
toolCallId string
toolName string
outputJson string
isError bool

View source

public bool Dynamic { get; init; }

True when the tool is dynamic: a dynamic tool, a provider-executed dynamic call, or an invalid call. Maps to the result’s dynamic.

Value: bool

View source

public Exception? Error { get; init; }

The exception the tool threw, when IsError is set by a failed execution. Maps to the error part’s error.

Value: Exception

View source

public string? InputJson { get; init; }

The JSON input of the tool call this result answers, after any repair and refinement. Maps to the result’s input.

Value: string

View source

public bool IsError { get; }

Whether execution failed or was denied.

Value: bool

View source

public string OutputJson { get; }

JSON output.

Value: string

View source

public bool ProviderExecuted { get; init; }

True when the provider ran the tool. Maps to the result’s providerExecuted.

Value: bool

View source

public JsonElement? ProviderMetadata { get; init; }

Provider-specific metadata of the result, keyed by provider name.

Value: JsonElement?

View source

public string? Title { get; init; }

Display title of the tool. Maps to the result’s title.

Value: string

View source

public string ToolCallId { get; }

Tool call id.

Value: string

View source

public IReadOnlyDictionary<string, JsonElement>? ToolMetadata { get; init; }

Metadata of the tool. It stays apart from ProviderMetadata. Maps to the result’s toolMetadata.

Value: IReadOnlyDictionary<string, JsonElement>

View source

public string ToolName { get; }

Tool name.

Value: string

View source

Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product