Two agents, one limit, one refused.
All guides
Architecture
Updated
2 min read
by Anlyon Team

Return action outcomes an agent can interpret

Keep pending, denied, refused and unknown results explicit so a tool wrapper does not encourage duplicate side effects.

tool resultsagent integrationoutcomes

Returning only "error" after an uncertain refund invites the agent to try again. Return the existing operation identifier, known state and permitted next step. Keep that information structured so your application can enforce behavior independently of the model's interpretation.

Anlyon's invocation status and governed-effect grade describe different aspects of the result. A capacity refusal can have invocation status failed and grade refused. An unknown outcome means the external operation may have happened. Preserve those distinctions in the wrapper.

Define your application result

The following is an application-owned example shape, not an Anlyon API response:

{
  "operationId": "refund-request-42",
  "state": "unknown",
  "nextStep": "operator_reconciliation",
  "message": "The refund may have happened. Do not create another refund."
}

Map actual SDK responses into this shape after checking the response and error fields. Do not report confirmed merely because the transport returned 200.

Choose next steps by state

ResultApplication behavior
Pending approvalSurface the existing review request
Pending provider resultObserve the existing operation
DeniedStop this request and report the decision
RefusedReport the specific boundary that prevented dispatch
UnknownPreserve identity and route to reconciliation
AcknowledgedReport acceptance with its verification limitation
ConfirmedReport the specific verified outcome

Do not delegate permission escalation to the model. A tool refusal should not expose an administrative shortcut that lets the agent raise its own limit.

Enforce outside the prompt

Persist operation identity, constrain available tools and reject prohibited duplicate or changed requests in application code. A sentence saying "do not retry" is useful communication, but it is not an execution control.

Test your mapping with recorded or controlled fixtures for each state. Include missing data, admission errors without receipts, and transport failure before your application receives a response.

Use outcome fields, operation identity and restart recovery.

Continue with a related task

Free tier, no credit card. One command if you use Claude or Cursor.

$ claude mcp add anlyon -- npx -y @anlyonhq/mcp-server