ToolSpec class final

One tool, as tools/list offers it: a name, a sentence, the JSON Schema of its arguments, the JSON Schema of the structuredContent it answers with when it answers one, and its ToolHints.

Schemas are JSON, the maps the protocol sends, so a tool can be written with any schema builder or by hand, and nothing here pins one.

Constructors

ToolSpec({required String name, String? description, Map<String, Object?> inputSchema = const <String, Object?>{'type' : 'object'}, Map<String, Object?>? outputSchema, ToolHints hints = ToolHints.writes, Map<String, Object?> meta = const <String, Object?>{}})
ToolSpec.fromJson(Map<String, Object?> json)
Reads the protocol's tool object, as tools/list sends it.
factory

Properties

description → String?
What it does, for a model to read. The first sentence is what the snapshot keeps.
final
hashCode → int
The hash code for this object.
no setterinherited
hints → ToolHints
final
inputSchema → Map<String, Object?>
The JSON Schema of its arguments: an object schema.
final
meta → Map<String, Object?>
The protocol's _meta, for what a server says about the tool beyond the protocol's own fields — its schema version, under flutter3d/schemaVersion.
final
name → String
What an agent calls it by.
final
outputSchema → Map<String, Object?>?
The JSON Schema of the structuredContent its answers carry, or null for a tool that answers in words and pictures only.
final
properties → Map<String, Object?>
The properties inputSchema names, by name; empty when it names none.
no setter
required → List<String>
The arguments inputSchema requires.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

copyWith({String? name, String? description, Map<String, Object?>? inputSchema, Map<String, Object?>? outputSchema, ToolHints? hints, Map<String, Object?>? meta}) → ToolSpec
This tool under another name, with description when given, and with meta merged over its own.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, Object?>
The protocol's tool object.
toString() → String
A string representation of this object.
override

Operators

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