Tool class

A tool that the server exposes for the client to call.

Inheritance

Constructors

Tool({List<Icon>? icons, required String name, String? title, String? description, required ToolSchema inputSchema, ToolSchema? outputSchema, ToolAnnotations? annotations, MetaObject? $meta})
Creates a Tool.
Tool.toMCP(Map<String, Object?> map)
Builds a Tool from a decoded MCP JSON map.
factory

Properties

$meta ↔ MetaObject?
Optional metadata.
getter/setter pair
annotations ↔ ToolAnnotations?
Optional behavioural hints.
getter/setter pair
description ↔ String?
Human-readable description of what the tool does.
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
icons ↔ List<Icon>?
Optional display icons.
getter/setter pair
inputSchema ↔ ToolSchema
JSON Schema for the expected call arguments.
getter/setter pair
name ↔ String
Programmatic tool name.
getter/setter pair
outputSchema ↔ ToolSchema?
Optional JSON Schema for the structured output.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
title ↔ String?
Human-readable display title.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() → Map<String, Object?>
Converts this Tool into a JSON-compatible map.
override
toString() → String
A string representation of this object.
inherited

Operators

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