Tool class
Tool definition. Spec 2025-06-18+ added outputSchema, _meta,
and the title display name (separate from programmatic name).
Spec 2025-11-25+ added icons.
- Annotations
-
- @immutable
Constructors
-
Tool({required String name, String? title, required String description, required Map<
String, dynamic> inputSchema, Map<String, dynamic> ? outputSchema, List<Map< ? icons, Map<String, dynamic> >String, dynamic> ? meta, bool? supportsProgress, bool? supportsCancellation, Map<String, dynamic> ? metadata}) -
const
-
Tool.fromJson(Map<
String, dynamic> json) -
factory
Properties
- description → String
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
icons
→ List<
Map< ?String, dynamic> > -
Spec 2025-11-25+: visual metadata (icon objects with
src, optionalsizesandmimeType).final -
inputSchema
→ Map<
String, dynamic> -
final
-
meta
→ Map<
String, dynamic> ? -
Spec 2025-06-18+: free-form metadata.
final
-
metadata
→ Map<
String, dynamic> ? -
final
- name → String
-
final
-
outputSchema
→ Map<
String, dynamic> ? -
Spec 2025-06-18+: optional JSON Schema describing the structured
result this tool produces.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- supportsCancellation → bool?
-
final
- supportsProgress → bool?
-
final
- title → String?
-
Spec 2025-06-18+: human-readable display name; falls back to name
when null.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited