AI agents for customer support · Part 7 of 14
Giving the agent actions: refunds, cancellations, address changes
What a tool is, in plain words, which actions to switch on first, and how to build each one so the customer is only told what really happened.
The short version
An action is a tool: a named step the model asks for and your code carries out. Switch actions on in order, from those that change nothing to those that move money, and build each one to check first, change one thing, and report what happened. Four steps:
Step 1Know what a tool is
A tool is an action with a name and inputs, such as “refund this order, this amount, for this reason”. The model decides when to ask for one. Your code runs it and sends back the result. The model never touches your systems itself.
The customer
“My mug arrived broken.”
The model asks
refund: order #1042, €12, reason: damaged
Your tool acts
checks first, then refunds in your store
The result
refunded €12, reference R-881
The model writes the reply from it
“Done: €12 is on its way back to your card.”
Anthropic’s documentation puts it in two lines: the model decides when to call a tool from the request and the tool’s description, and “your code executes the operation”. Helpdesk agents work the same way under their own names: Zendesk calls them custom actions, which change data outside Zendesk through an API you choose, and Intercom lets Fin reach other systems through data connectors.
Step 2Switch actions on in order
Start where a mistake costs little and is easy to put right. Move down the list only once the action above it has run cleanly for a while.
Switch on, in this order
Resend the tracking link
If it goes wrong: nothing has changed.
Change the address, before dispatch
If it goes wrong: change it back.
From here, money moves: a rule is checked before each one (part 8)
Reship a lost parcel
If it goes wrong: the cost of one more parcel.
Cancel an unshipped order
If it goes wrong: it can’t be undone, so they order again.
Refund
If it goes wrong: the money has left.
Ready-made agents offer most of these. Gorgias’s agent can cancel a Shopify order, edit its shipping address, remove or replace an item, reship it for free, or add a note to it. Take care with cancellations: Shopify’s documentation says a cancelled order can’t be restored.
Step 3Build each action in three parts
Write each action down as three parts: what it checks before it runs, the one thing it changes, and what it reports back. That report is all the customer is told.
One action: cancel an order
1 Checks first
The order is this customer’s (part 6). It hasn’t shipped. Your rule allows it (part 8).
2 Changes one thing
Cancels order #1042 in your store and restocks the items. Nothing else.
3 Reports what happened
What the store replied: cancelled at 14:02, €42 back to the card. The customer is told this, and only this.
Gorgias builds its own actions this way: before it cancels, its agent checks that the order is unfulfilled, and it asks the shopper to confirm a new address before changing it. A confirmation the model writes from memory can promise something that never happened. Build it from the result instead, which is also why part 4 takes the confirmation out of your macros.
Step 4Make a retry safe
Networks drop halfway. If the refund went through but the reply got lost, the agent tries again, and a careless tool refunds twice. So give each action a key, such as the ticket number and the step, and send the same key with every try.
Without a key
Refund €12 → no reply: the network drops → the agent tries again → a second refund, €24 in total
With a key
Refund €12, key T-5521-1 → no reply → tries again, same key → the saved result: €12, refunded once
Stripe’s API “supports idempotency for safely retrying requests without accidentally performing the same operation twice”. In its v1 API, “retries with the same key return the saved response”.
Stripe, “Idempotent requests”Not every system takes such a key. Where yours doesn’t, the tool has to keep its own note of what it already did for each ticket, and look there before it tries again.
Next in this series
Part 8: rules for agent actions: limits, approvals and hand-overs. See all 14 parts.
Where Himmel fits
Himmel is the rule check in the first part of each action that moves money: before the tool changes anything, it asks Himmel whether your rules allow it, and acts on the answer.
Sources
- Anthropic, “Tool use with Claude”, read on 20 October 2026.
- Zendesk help, “About actions in AI agents”, read on 20 October 2026.
- Intercom, “How to use data connectors in Fin Procedures”, read on 20 October 2026.
- Gorgias, “AI Agent Actions: make changes to Shopify orders”, read on 20 October 2026.
- Shopify, “orderCancel”, GraphQL Admin API, read on 20 October 2026.
- Stripe, “Idempotent requests”, read on 20 October 2026.
