ToolValidator class

Tool validation utility for ensuring tool calls and parameters are valid

This class provides static methods for validating tool calls against their definitions and ensuring parameter types and requirements are met.

Constructors

ToolValidator.new()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

findTool(String toolName, List<Tool> tools) Tool?
Get tool by name from a list of tools
validateParameters(Map<String, dynamic> arguments, ParametersSchema schema) List<String>
Validate parameters against a schema
validateStructuredOutput(StructuredOutputFormat format) bool
Validate structured output format
validateToolCall(ToolCall toolCall, Tool toolDefinition) bool
Validate a tool call against its tool definition
validateToolCalls(List<ToolCall> toolCalls, List<Tool> availableTools) Map<String, List<String>>
Validate multiple tool calls against their definitions
validateToolChoice(ToolChoice toolChoice, List<Tool> availableTools) bool
Validate tool choice against available tools