callTool method

  1. @override
Future<KernelToolResult> callTool(
  1. String name,
  2. Map<String, dynamic> args
)
override

In-process tool dispatch. Used by BundleActivation flows whose toolDispatcher closure routes through the host's local server surface, by BundleSessionBridge mirroring, and by host code that wants to invoke a tool without going over the transport.

Implementation

@override
Future<KernelToolResult> callTool(
  String name,
  Map<String, dynamic> args,
) async {
  final handler = _kernelHandlers[name];
  if (handler == null) {
    return KernelToolResult(
      isError: true,
      content: <KernelContent>[
        KernelTextContent(text: 'Tool not registered: $name'),
      ],
    );
  }
  return handler(args);
}