Skip to main content
Register a tool and the function that runs it. The SDK owns the call-and-execute loop.

The tools namespace

All three are synchronous on Flutter, and there is no clear(). Unregister by name.

Defining a tool

Controlling the loop

Tools registered through tools.register are offered to every generation. Tools passed in options.tools apply to that call alone.

Executors run on the Dart isolate

Your ToolRunner is ordinary Dart. It can await, so network and file work are fine, but the generation is paused while it runs. A slow executor reads to the user as a hung model.

Removing

Inspecting

Which models can do this

Tool calling needs a model with enough context to hold the tool definitions. The SDK gates on context length rather than a model allowlist, so any model with a large enough window can participate, though instruction-tuned models trained on tool use do it far more reliably.