Skip to main content
defineTool requires effects:
Use idempotent when the handler can see context.operationId and skip an effect it already recorded. Use non-idempotent when a repeated call would do something the application cannot undo, such as sending a message or charging a payment.

Reconciliation

A blocked non-idempotent step waits for the application. run.reconcile accepts:
resolution is "retry", "complete", or "fail". Call it only while the run is waiting. Otherwise it throws invalid_state_transition. ToolFailure fails the tool attempt. Set retryable: true only when the handler knows the attempt can be repeated safely.

Remote calls

A remote agent is also an external effect. The local run stores the delegation, then the host sends it. Cancelling the local run does not roll back a remote effect that already happened. See HTTP remote agents.