> ## 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

> TypeScript SDK reference

# startTool

▸ **startTool**(`opts`): [`Tool`](../classes/tool)

Start a Tool span. Parent resolution (matches the design's "flat by
default, hierarchical if you nest"):

* If an LLM is active, the Tool nests under it.
* Otherwise, the Tool is a sibling under the current Turn.

Throws if neither a Turn nor an LLM is active.

#### Parameters

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

#### Returns

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

`Example`

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

`Example`

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

#### Defined in

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

***
