Skip to content

InvalidToolInputError

Namespace: Vercel.AI.Util

public sealed class InvalidToolInputError : AiSdkError, ISerializable, IErrorMarkers

The input of a tool call does not match the tool’s input schema. Maps to InvalidToolInputError.

Inheritance: object → Exception → AiSdkError

Implements: ISerializable, IErrorMarkers

View source

InvalidToolInputError(string, string, Exception?, string?)

Section titled “InvalidToolInputError(string, string, Exception?, string?)”
public InvalidToolInputError(string toolName, string toolInput, Exception? cause = null, string? message = null)

Creates the error. <code class=“paramref”>message</code> defaults to the upstream format.

Parameters

Name Type Description
toolName string
toolInput string
cause Exception
message string

View source

public const string ErrorMarker = "vercel.ai.error.AI_InvalidToolInputError"

Marker for IsInstance(object).

Value: string

View source

public string ToolInput { get; }

Raw input of the call.

Value: string

View source

public string ToolName { get; }

Name of the tool that was called.

Value: string

View source

public static bool IsInstance(object? error)

Returns whether <code class=“paramref”>error</code> carries this error’s marker.

Parameters

Name Type Description
error object

Returns: bool

View source

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