Skip to content

GeneratedToolCall

Namespace: Vercel.AI.Provider

public class GeneratedToolCall : GeneratedContent

A function tool call.

Inheritance: object → GeneratedContent

Derived: GoogleToolCall, HuggingFaceToolCall

View source

GeneratedToolCall(string, string, string, JsonElement?)

Section titled “GeneratedToolCall(string, string, string, JsonElement?)”
public GeneratedToolCall(string toolCallId, string toolName, string argumentsJson, JsonElement? providerMetadata = null)

Creates a tool call.

Parameters

Name Type Description
toolCallId string
toolName string
argumentsJson string
providerMetadata JsonElement?

View source

public string ArgumentsJson { get; }

JSON object arguments.

Value: string

View source

public bool Dynamic { get; init; }

True when the tool is not known up front, such as a provider-executed MCP tool. Maps to the call’s dynamic.

Value: bool

View source

public Exception? Error { get; init; }

Why the call is Invalid. Maps to error.

Value: Exception

View source

public bool Invalid { get; init; }

True when the call failed to parse: its tool is unknown, its input did not parse, or the input did not match the tool’s input schema. Such a call is Dynamic and is never executed. Maps to invalid.

Value: bool

View source

public bool ProviderExecuted { get; init; }

True when the provider executed the tool, so the caller has nothing to run.

Value: bool

View source

public JsonElement? ProviderMetadata { get; }

Provider-specific metadata for this call, such as a thought signature.

Value: JsonElement?

View source

public string? Title { get; init; }

Display title of the tool, when the tool has one. Maps to title.

Value: string

View source

public string ToolCallId { get; }

Provider id for this call.

Value: string

View source

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

Metadata of the tool, kept apart from ProviderMetadata. Maps to 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