ToolDefinition class final

A declaration of a tool the model may call: its name, purpose, and the JSON Schema describing its arguments.

This is pure data — it carries no executor. The flutter_ai_tools package builds on it to add client-side execution. Keeping the declaration in the core lets provider contracts accept tools without depending on the tools package.

Constructors

ToolDefinition({required String name, required String description, Map<String, Object?> parametersSchema = const {}})
Creates a tool definition.
const
ToolDefinition.fromJson(Map<String, Object?> json)
Reconstructs a ToolDefinition from json.
factory

Properties

description → String
A natural-language description the model uses to decide when to call it.
final
hashCode → int
The hash code for this object.
no setteroverride
name → String
The tool's unique name, as referenced in tool calls.
final
parametersSchema → Map<String, Object?>
A JSON Schema object describing the tool's arguments.
final
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
toJson() → Map<String, Object?>
Serializes this definition.
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
override