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 four are async on React Native, unlike Web where they are synchronous.

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. capabilities().tools reports { registry: true, parallel: false, cancellation: true }, so tools run one at a time but a run can be cancelled.

Executors run in JavaScript

Your executor is ordinary app code on the JS thread. It has fetch, storage, and native modules. It does not have the DOM. Keep it fast: the generation is paused while it runs, and 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.