Tool class

Tool definition for registering custom tools with Copilot sessions.

Constructors

Tool({required String name, String? description, Map<String, dynamic>? parameters, required ToolHandler handler})
const

Properties

description String?
Human-readable description of what the tool does.
final
handler ToolHandler
Handler function invoked when the tool is called.
final
hashCode int
The hash code for this object.
no setterinherited
name String
Tool name (e.g., "weather", "search").
final
parameters Map<String, dynamic>?
JSON Schema for the tool's input parameters.
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
toRegistrationJson() Map<String, dynamic>
Converts to JSON for registration with the CLI (excludes handler).
toString() String
A string representation of this object.
inherited

Operators

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