execute method

  1. @override
Future<ToolResult> execute(
  1. Map<String, dynamic> input
)
override

Execute the tool with the given input.

Implementation

@override
Future<ToolResult> execute(Map<String, dynamic> input) async {
  final parsed = ScreenshotInput.fromJson(input);
  if (capturer != null) return capturer!(parsed);

  return ToolResult.error(
    'No screenshot capturer configured. '
    'Wire up a browser/preview engine to use this tool.',
  );
}