Tool constructor
Tool({
- required String name,
- String? title,
- String? description,
- required ObjectSchema inputSchema,
- ObjectSchema? outputSchema,
- ToolAnnotations? annotations,
- Meta? meta,
Implementation
factory Tool({
required String name,
String? title,
String? description,
required ObjectSchema inputSchema,
// Only supported since version `ProtocolVersion.v2025_06_18`.
ObjectSchema? outputSchema,
// Only supported since version `ProtocolVersion.v2025_03_26`.
ToolAnnotations? annotations,
// Only supported since version `ProtocolVersion.v2025_03_26`.
Meta? meta,
}) => Tool.fromMap({
'name': name,
if (title != null) 'title': title,
if (description != null) 'description': description,
'inputSchema': inputSchema,
if (outputSchema != null) 'outputSchema': outputSchema,
if (annotations != null) 'annotations': annotations,
if (meta != null) '_meta': meta,
});