Reschedule a delivery on customer request
A customer calls in asking to push their delivery to a different day or time slot. The agent looks up the shipment, confirms it's still in a state that can be rescheduled, then sets the new schedule.
This is one of the simplest action-shaped patterns — two tool calls in the happy path.
When to use
- Customer service: "Can you reschedule my delivery to Saturday?"
- Internal ops: rescheduling a batch of deliveries after a depot closure or holiday.
Tool sequence
get_shipment (current state — has it shipped? is delivery editable?)
│
▼
schedule_delivery (set / revise the delivery slot)
Example agent prompt
"The customer for SHP-12345 wants delivery on Saturday afternoon instead of tomorrow. Can you reschedule?"
Walkthrough
Step 1 — pull the shipment
get_shipment(
tenantId="…",
shipment_id="SHP-12345",
select="shipment_id,status,promised_delivery_date,carrier"
)
Use select to trim the response — the agent only needs status,
promised date, and carrier here.
The agent checks status before proceeding:
- If status is
DELIVERED, refuse — the shipment is done. - If status is
IN_TRANSITorOUT_FOR_DELIVERY, the carrier may still accept a reschedule (depends on the carrier — often the agent should warn that "this depends on the carrier accepting the new window"). - If status is earlier in the lifecycle (
READY_FOR_PICKUP,PICKED_UP, etc.), reschedule is straightforward.
Step 2 — set the new schedule
schedule_delivery(
tenantId="…",
shipment_id="SHP-12345",
scheduled_from="2026-05-09T13:00:00+04:00",
scheduled_to="2026-05-09T17:00:00+04:00"
)
The tool exposes three optional schedule fields — scheduled_date,
scheduled_from, and scheduled_to — all at the top level alongside
tenantId and shipment_id. Pass scheduled_date alone for a
single-day window, or scheduled_from + scheduled_to for an
explicit time window. Carriers vary on what they accept; inspect the
schema once with a single test call before using in bulk.
In a customer-facing agent, confirm the new window with the user
before calling schedule_delivery. The agent should narrate
"I'll change the delivery window to Saturday afternoon, 1pm to
5pm — confirm?" and wait for explicit yes before firing.
Variations
- Pickup, not delivery — same shape, but call
schedule_collectioninstead. Use when a merchant or warehouse wants to change when the carrier picks up. - Bulk reschedule — given a list of shipment ids (e.g. all
OUT_FOR_DELIVERYfor a closed area), iterate the pattern. Mind rate limits — write tools cap at 120/min. - No new date, just cancel the schedule — most carriers don't support "unscheduled". Cancelling and re-creating the shipment is usually the wrong move; better to schedule a sensible default and let the customer reschedule once they decide.
Related patterns
- Diagnose a stuck shipment — when the question is "why hasn't this been delivered?" rather than "can we change when?".