Tool class

Tool definition (2025-03-26 compliant)

Annotations
  • @immutable

Constructors

Tool({required String name, String? title, required String description, required Map<String, dynamic> inputSchema, Map<String, dynamic>? outputSchema, List<Map<String, dynamic>>? icons, Map<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, optional sizes and mimeType).
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 the tool produces. When present, the runtime SHOULD validate CallToolResult.structuredContent against it.
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