BaseTool class abstract

Base contract for one callable tool exposed to the model runtime.

Constructors

BaseTool({required String name, required String description, bool isLongRunning = false, Map<String, dynamic>? customMetadata})
Creates a tool with a stable name and user-visible description.

Properties

customMetadata Map<String, dynamic>?
Arbitrary metadata attached to this tool declaration.
getter/setter pair
description String
Human-readable purpose text shown to the model.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
isLongRunning bool
Whether the tool can outlive a single response turn.
getter/setter pair
name String
Unique tool name used in function-calling payloads.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getDeclaration() FunctionDeclaration?
Returns the function declaration exposed to the model, if any.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
processLlmRequest({required ToolContext toolContext, required LlmRequest llmRequest}) Future<void>
Mutates outgoing llmRequest before model generation.
run({required Map<String, dynamic> args, required ToolContext toolContext}) Future<Object?>
Executes the tool and returns a JSON-like response payload.
toString() String
A string representation of this object.
inherited

Operators

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