invokeTool method

Future<String> invokeTool(
  1. FrameId frameId,
  2. String toolName,
  3. Map<String, dynamic> input
)

Invokes a registered tool. frameId Frame in which to invoke the tool. toolName Name of the tool to invoke. input Input parameters for the tool, matching the tool's inputSchema. Returns: Unique identifier for this invocation. Response is sent before tool events.

Implementation

Future<String> invokeTool(
  page.FrameId frameId,
  String toolName,
  Map<String, dynamic> input,
) async {
  var result = await _client.send('WebMCP.invokeTool', {
    'frameId': frameId,
    'toolName': toolName,
    'input': input,
  });
  return result['invocationId'] as String;
}