Documentation Index
Fetch the complete documentation index at: https://tracepilot.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
tp.wrapToolCall() wraps any asynchronous function — a database write, an email send, a web search, or any other tool invocation — and records it as a structured span linked to a parent span in your execution tree. Set isDestructive: true on operations that modify external state so the dashboard surfaces a warning badge, making it easy to audit side effects during debugging.
Signature
Parameters
A human-readable display name for the tool. This label appears in the dashboard’s execution tree and is used to identify the span when debugging.
A zero-argument async function that executes the tool. Wrap your call in an arrow function so TracePilot can time it and capture any errors that are thrown.
The
spanId of the parent span. Tool calls must always be linked to a parent — typically the spanId returned by the wrapOpenAI call that decided to invoke this tool.An integer that controls where this span appears among its siblings in the execution tree. Use sequential integers (1, 2, 3…) to preserve the correct order in the dashboard.
When
true, the dashboard marks this span with a ⚠ Destructive badge. Use this flag for any operation that modifies external state — sending emails, writing to a database, publishing messages, calling payment APIs, and so on. Defaults to false.Return value
The value resolved by your
call function, returned unchanged. The generic type T is inferred from your function’s return type.The ID of the span created for this tool call. You can pass this as
parentSpanId to downstream wrapOpenAI or wrapToolCall calls to nest them further.