> ## Documentation Index
> Fetch the complete documentation index at: https://wb-21fd5541-docs-3071-org-scoped-api-keys.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# startTool

> Référence du SDK TypeScript

> **startTool**(`opts`): [`Tool`](../interfaces/tool)

Démarre un span d'outil. Résolution du parent (correspond au principe de conception « plat par
défaut, hiérarchique si vous imbriquez ») :

* Si un LLM est actif, l'outil y est imbriqué.
* Sinon, l'outil est au même niveau, sous le tour de conversation actuel.

Lève une exception si aucun tour de conversation ni aucun LLM n'est actif.

Défini dans : [src/genai/api.ts:110](https://github.com/wandb/weave/blob/8c5f077eb11c42b84000726ff20504abc728d3fb/sdks/node/src/genai/api.ts#L110)

<div id="parameters">
  ## Paramètres
</div>

<div id="opts">
  ### opts
</div>

[`ToolInit`](../interfaces/toolinit)

<div id="returns">
  ## Renvoie
</div>

[`Tool`](../interfaces/tool)

<div id="examples">
  ## Exemples
</div>

```ts twoslash theme={null}
// @noErrors
weave.startTool({
  name: 'get_weather',
  args: JSON.stringify({city: 'Tokyo'}),
  toolCallId: 'call_t1',
});
```

```ts twoslash theme={null}
// @noErrors
weave.startTool({
  name: 'get_weather',
  args: JSON.stringify({city: 'Tokyo'}),
  toolCallId: 'call_t1',
  startTime: new Date('2026-05-29T10:00:00.800Z'),
});
```
