Errors and how to fix them
Every error and warning a tool can return, what causes it, and what to do. Each issue in a response carries the same fix text as this page.
What an error looks like
Over REST, a failure is application/problem+json. Over MCP, the tool result has isError: true and its text is the same information as JSON: {"error", "issues"}.
{
"type": "errors/upstream-rejected",
"title": "There was an issue validating the request.",
"status": 422,
"issues": [
{
"code": "missing-destination-contactname",
"field": "to.name",
"message": "Destination contact name was missing.",
"fix": "Send the person's name, up to 50 characters."
},
{
"code": "service-ineligible:weight/over-bounds",
"field": "parcels[0]",
"message": "Parcel weight exceeds the maximum for this service.",
"fix": "Too heavy for this service. Choose a bigger service or split the parcel."
}
]
}
| Field | Use it for |
|---|---|
code | What went wrong. Stable: switch on it. When one code has several causes it is code:reason, e.g. service-ineligible:weight/over-bounds. |
field | The input to change, as a path into the tool's input (to.postcode, parcels[0].contents[1].tariffCode). Absent when the issue is about the whole order. |
message | A sentence you can show the user. Never parse it: the wording can change. |
fix | What to do, from the tables below. |
| Type | Status | Meaning | What to do |
|---|---|---|---|
errors/invalid-input | 400 | The input does not match the tool's schema, or this server refused it. | Fix the listed fields and call again. |
errors/upstream-rejected | 422 | The booking service refused the request. The issues say why. | Fix every issue, then call again. All issues come back at once. |
errors/rate-limited | 429 | Too many calls from this connection: about 120 a minute, or 3 orders a minute. | Wait a minute. For orders, check with the user before trying again. |
errors/too-large | 413 | The request body is over 64 KB. | Send a smaller request. |
errors/upstream-unavailable | 502 | The booking service is down or busy. Read-only calls were already retried once. | Try again shortly. Never retry create_order without asking the user: the message says whether an order may exist. |
errors/internal-error | 500 | A fault on this server, including a call it built badly. | Try again later. Nothing the user can fix. |
errors/not-found | 404 | No such REST route. | Check the path in the API reference. |
The fix loop
- Call the tool.
- Rate limited or unavailable: wait and try again, except
create_order. - Issues: fix or collect every field named, using the tables below. Ask the user one grouped question, then call again.
- Success with warnings or notes: tell the user each one before going on.
- Only when
validate_ordersucceeds and the user says yes, callcreate_orderonce.
Never invent data to clear an error: postcodes, tax ids, EORI, phone numbers, tariff codes or IOSS numbers. Ask the user. The only exception is a seller SKU when the user has none: make one up and keep it stable.
Missing or malformed details
The fix is always to the input. Ask the user for anything you do not have.
| Code | When | Fix |
|---|---|---|
invalid-origin-countryinvalid-destination-countryinvalid-billing-country | Unknown country code, or a territory the sender's country does not serve. | Use an ISO2 code, or the territory code get_quotes returned (e.g. GB-NIR). lookup_country finds codes. |
missing-origin-countrymissing-destination-countrymissing-billing-country | The country is empty. | Send the country code. |
invalid-origin-postcodeinvalid-destination-postcodeinvalid-billing-postcode | The postcode does not match the country's format, or does not exist. | Ask the user for their real postcode and check it with lookup_country's pattern. Never make one up. |
missing-origin-postcodemissing-destination-postcodemissing-billing-postcode | The postcode is empty. | Send the postcode. |
invalid-origin-countyinvalid-destination-countyinvalid-billing-county | The state, province or county is missing or not an allowed value (US, CA, AU and some couriers). | Send the code from get_booking_requirements' options that matches the postcode, e.g. NY or NSW. |
missing-origin-contactnamemissing-destination-contactnamemissing-billing-contactname | The contact name is empty. | Send the person's name, up to 50 characters. |
missing-origin-propertymissing-destination-propertymissing-billing-property | The house number or name is empty. | Send the house number or name. |
missing-billing-address | No billing address where one is needed. | Send a billing address. The sender's address is fine. |
invalid-origin-shopidinvalid-destination-shopidinvalid-billing-shopid | The shop id is not numeric. | Use the id from search_drop_shops. |
missing-customermissing-customer-email | The account holder or their email is missing. | Send the sender's name and email. |
missing-quote-requestsmissing-shipment-parcels | No shipment, or no parcels. | Send at least one parcel. |
missing-servicemissing-courier | No service was chosen. | Send the serviceSlug from get_quotes for the same sender country. |
conflicting-extras | Two extras that cannot go together, e.g. two levels of protection. | Keep one of them. |
invalid-parcel-weight | The weight is zero, negative or missing. | A positive weight in kg (at least 0.001). |
invalid-parcel-quantity | More than 100 identical parcels. | Use a quantity from 1 to 100, or split the shipment. |
invalid-parcel-value | A declared value of zero or less. | Send a positive value in minor units, or leave it out (only the included cover then applies). |
missing-parcel-contentsummary | No description of what is in the parcel. | Add a short description of the contents. |
missing-parcelcontent-description | A customs line has no description. | Be specific, e.g. 'Cotton T-shirt', not 'clothes'. |
invalid-parcelcontent-quantityinvalid-parcelcontent-valueinvalid-parcelcontent-weight | A customs line's quantity, value or weight is below the minimum. | Quantity is a whole number of 1 or more. Value (minor units) and weight (kg) are totals for the line. |
invalid-parcelcontent-countryofmanufacture | The country of manufacture is not valid. | Use an ISO2 code. |
invalid-parcelcontent-tariffcode | The tariff (HS) code is badly formed, or refused when pricing duty-paid (DDP) delivery. | Digits only, at the length get_booking_requirements gives (HS 6 to 10, CN 8, TARIC 10).
|
missing-customs-exportreason | An international parcel with no export reason. | Choose one of the lane's export reasons from get_booking_requirements (sale, gift, documents ...). |
missing-customs-ioss | IOSS duty terms with no IOSS number. | Ask for the IOSS number (IM followed by 10 digits), or switch to ddu or ddp. |
The service cannot carry this shipment
The input is fine, but this service will not take it. Usually: choose another service, or change the parcel.
| Code | When | Fix |
|---|---|---|
service-unavailable | The service does not exist for this sender country, does not serve this lane, or could not be priced. | Get fresh quotes for this lane and choose a service from them.
|
service-ineligible | A parcel is outside the service's limits, or the address is excluded. | Choose a service whose limits fit, split the parcel, or use smaller packaging.
|
routing-unavailable | The courier has no route for this address (remote areas, islands, some couriers). | Check the postcode and territory code (e.g. GB-HIGH), or choose another service. |
The order cannot be built as asked
The input is well formed, but something about the order needs to change.
| Code | When | Fix |
|---|---|---|
quote-unavailable | No current price matches: the parcel changed, or the service stopped quoting. | Get fresh quotes with the final parcel details and choose again. |
extra-unavailable | An extra was asked for that this service cannot add. | Use only extras listed for this service.
|
collection-date-unavailable | No bookable collection date is left. | Get fresh quotes and choose one of the new dates. |
discountcode-unavailable | A discount code cannot be applied. | Remove the discount code. |
credential-unusable | The customer's own courier account cannot be used. | Book without it. |
invalid-requirement | A field the service requires is missing or invalid. The field and message say which. | Re-read get_booking_requirements for this service and lane, and collect or correct that field.
|
Warnings: it worked, but tell the user
The call succeeded. These come back as warnings or notes, not errors. Tell the user before going on.
| Code | When | Fix |
|---|---|---|
collection-date-substituted | The requested collection date has passed or is not offered. The order will use the date shown. | Tell the user the new date and get their OK before create_order. |
country-subdivision-mismatch | The postcode belongs to a territory, e.g. a BT postcode is Northern Ireland (GB-NIR). | get_quotes re-quotes with the territory code for you. Use the from/to codes it returned in later tools. |
invalid-discount-code | The discount code does not exist. The call still worked, with no discount. | Tell the user the code did not apply. |
This server's own codes
Raised by this server before or after calling the booking service.
| Code | When | Fix |
|---|---|---|
invalid-input | The tool input does not match its schema. `field` names the input. | Correct that input. The tool's input schema lists every field and limit. |
confirmation-invalid | The confirmation token is not valid, has expired (30 minutes) or was made by another server. | Call validate_order again, show the user the total, and use the new token. |
price-changed | The total changed between validate_order and create_order. Nothing was booked. | Show the user the new total and ask again. Then validate_order again and use the new token. |
invalid-country | Drop shops cannot be searched in that country. | Use an ISO2 code, such as GB. |
place-not-found | No place matches that postcode or town in a drop-shop search. | Check the postcode, or try a town name. |
no-drop-shops | Services from this sender country are collected, so there are no drop shops. | Book a collection service; no shop id is needed. |
Codes not listed here
New codes and reasons can appear at any time. For one you do not recognise: show the user the message and ask them how to proceed.