> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wandb.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# startTool

> Référence du SDK TypeScript

<div id="starttool">
  # startTool
</div>

▸ **startTool**(`opts`): [`Tool`](../classes/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.

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

| Nom    | Type                                 |
| :----- | :----------------------------------- |
| `opts` | [`ToolInit`](../interfaces/toolinit) |

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

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

`Exemple`

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

`Exemple`

```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'),
});
```

<div id="defined-in">
  #### Défini dans
</div>

[src/genai/api.ts:103](https://github.com/wandb/weave/blob/9591aba8a5e77309ee0858e5ba94d31c1bd7e404/sdks/node/src/genai/api.ts#L103)

***
