> ## 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 リファレンス

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

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

`Tool` の span を開始します。親の解決方法 (設計上の「デフォルトではフラット、ネストした場合は階層化」に対応) :

* LLM がアクティブな場合、`Tool` はその配下にネストされます。
* それ以外の場合、`Tool` は現在の Turn と同じ親の下に配置されます。

Turn と LLM のどちらもアクティブでない場合は、例外をスローします。

<div id="parameters">
  #### パラメーター
</div>

| 名      | タイプ                                  |
| :----- | :----------------------------------- |
| `opts` | [`ToolInit`](../interfaces/toolinit) |

<div id="returns">
  #### 戻り値
</div>

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

`例`

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

<div id="defined-in">
  #### 定義元
</div>

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

***
