weave / Tool A tool invocation. Emits anDocumentation Index
Fetch the complete documentation index at: https://wb-21fd5541-update-reference-docs-34.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
execute_tool span carrying the tool name,
the JSON-encoded arguments, the tool-call id, and the result.
Created by weave.startTool() (or turn.startTool(), or
llm.startTool()) and terminated with end(). Assign result before
calling end() to record the tool’s output on the span.
Example
Table of contents
Properties
Methods
Properties
args
•Readonly args: string
Defined in
genai/tool.ts:52name
•Readonly name: string
Defined in
genai/tool.ts:51result
•Optional result: string
Tool output as a string. Recorded on gen_ai.tool.call.result at end().
Defined in
genai/tool.ts:45toolCallId
•Readonly toolCallId: string
Defined in
genai/tool.ts:53Methods
end
▸ end(opts?): void
Flush result to the span and close it. Idempotent. Pass error to
mark the span as failed.
Parameters
| Name | Type |
|---|---|
opts? | Object |
opts.error? | Error |
Returns
void
Defined in
genai/tool.ts:83create
▸ create(opts): Tool
Parameters
| Name | Type |
|---|---|
opts | ToolInit & ChildSpanContext |
Returns
Tool