SdkMcpTool class

An in-process tool definition. Mirrors SdkMcpToolDefinition / the object built by tool().

inputSchema is JSON-Schema (the extension converts it to Zod via jsonSchemaToZod). handler runs in Dart; it is part of the type surface but is never serialized — only the descriptor crosses the bridge.

Constructors

SdkMcpTool({required String name, required String description, required Map<String, dynamic> inputSchema, ToolHandler? handler})
SdkMcpTool.fromJson(Map<String, dynamic> json)
Parses a tool descriptor from wire JSON. The handler is not transported.
factory

Properties

description String
A human-readable description.
final
handler ToolHandler?
The Dart handler invoked when the model calls this tool (wired in #5).
final
hashCode int
The hash code for this object.
no setterinherited
inputSchema Map<String, dynamic>
The JSON-Schema for the tool input.
final
name String
The tool name.
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>
Serializes the descriptor (name/description/schema) — never the handler.
toString() String
A string representation of this object.
inherited

Operators

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