Skip to content

ToolContext

The second argument to a tool's run.

Property Type Description
agent string | undefined The calling agent's ID. Set by Wardrik, never by the model.
run string | undefined The run the call is part of.
idempotencyKey string | undefined The same each time Wardrik runs this call. Pass it to whatever the tool changes.
signal AbortSignal Aborts when Wardrik stops waiting for the call.
cost(usd): void;

Reports what the call cost, in US dollars. Each report adds to the total. Budgets count it. Throws a RangeError for a negative or non-finite amount.

Parameter Type
usd number

void