copyWith method

ToolSpec copyWith({
  1. String? name,
  2. String? description,
  3. Map<String, Object?>? inputSchema,
  4. Map<String, Object?>? outputSchema,
  5. ToolHints? hints,
  6. Map<String, Object?>? meta,
})

This tool under another name, with description when given, and with meta merged over its own.

Implementation

ToolSpec copyWith({
  String? name,
  String? description,
  Map<String, Object?>? inputSchema,
  Map<String, Object?>? outputSchema,
  ToolHints? hints,
  Map<String, Object?>? meta,
}) => ToolSpec(
  name: name ?? this.name,
  description: description ?? this.description,
  inputSchema: inputSchema ?? this.inputSchema,
  outputSchema: outputSchema ?? this.outputSchema,
  hints: hints ?? this.hints,
  meta: <String, Object?>{...this.meta, ...?meta},
);