discontinuedPackage fluttersdk_artisan has been discontinued and replaced by dowel.

McpToolDescriptor class final

A value type describing a single MCP tool contributed by an ArtisanServiceProvider via its mcpTools override.

The four fields are mandatory; there are no defaults. Plugin authors construct descriptors in code and return them from mcpTools; the framework never parses descriptors from external JSON, so no fromJson factory is provided.

Wire shape note: toJson emits only name, description, and inputSchema. The extensionMethod field is an internal routing key used by the MCP server to dispatch incoming tool calls to the correct VM Service extension; it is intentionally absent from the MCP protocol payload.

dart_mcp integration note: when passed to dart_mcp v0.5.1's registerTool, the inputSchema map must be wrapped as ObjectSchema.fromMap(inputSchema) at the registerTool call site (Step 7 handles the wrap). Keeping the descriptor field as Map avoids leaking dart_mcp's ObjectSchema extension type into plugin author code.

Collision diagnostics: toString includes name and extensionMethod so that ArtisanMcpToolCollisionException messages identify the duplicate at a glance.

Constructors

McpToolDescriptor({required String name, required String description, required Map<String, dynamic> inputSchema, required String extensionMethod})
Constructs an immutable MCP tool descriptor.
const

Properties

description → String
Human-readable, LLM-targeted description of what the tool does.
final
extensionMethod → String
The VM Service extension method this tool dispatches to at runtime.
final
hashCode → int
The hash code for this object.
no setterinherited
inputSchema → Map<String, dynamic>
JSON Schema object describing the tool's accepted input.
final
name → String
Tool name exposed to the MCP client.
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
toJson() → Map<String, dynamic>
Serialises to the MCP protocol tool object.
toString() → String
A string representation of this object.
override

Operators

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