Skip to main content

startTool

startTool(opts): 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

NameType
optsToolInit

Returns

Tool Example
weave.startTool({
  : 'get_weather',
  : .({: 'Tokyo'}),
  : 'call_t1',
});
Example
weave.startTool({
  : 'get_weather',
  : .({: 'Tokyo'}),
  : 'call_t1',
  : new ('2026-05-29T10:00:00.800Z'),
});

Defined in

src/genai/api.ts:103