Atomside docsThis page as Markdown

Check an address: check_address

Checks a UK address and returns it as it will print, or close matches if it is not found. Free. quote_letter runs the same check, so use this when you are unsure of an address. In test mode, postcodes TEST 01 to TEST 13 rehearse outcomes.

MCP toolcheck_address
RESTPOST /v1/addresses/check
CLIatomside check-address
Key needsRead (letters:read)
Changes anythingNo. It only reads.
Idempotency keyNot used.

Example

A real call and its real answer, made against the API in test mode. A test runs it again and fails if the answer changes. Ids, keys and links are replaced with stand-ins.

A call that works

REST:

curl -X POST https://api.atomside.com/v1/addresses/check \
  -H "Authorization: Bearer $ATOMSIDE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "line1": "12 Specimen Road",
  "town": "Exampleton",
  "postcode": "xx11xx"
}'

MCP:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "check_address",
    "arguments": {
      "line1": "12 Specimen Road",
      "town": "Exampleton",
      "postcode": "xx11xx"
    }
  }
}

CLI:

atomside check-address \
  --line1 '12 Specimen Road' \
  --town Exampleton \
  --postcode xx11xx

The answer (HTTP 200; over MCP, the same JSON is the result's structuredContent):

{
  "status": "corrected",
  "test": false,
  "address": {
    "lines": [
      "12 Specimen Road"
    ],
    "town": "Exampleton",
    "postcode": "XX1 1XX"
  },
  "prints_as": [
    "12 Specimen Road",
    "Exampleton",
    "XX1 1XX"
  ],
  "changes": [
    "Postcode as XX1 1XX"
  ],
  "matches": [],
  "says": "Found. It prints as 12 Specimen Road, Exampleton, XX1 1XX. We changed: Postcode as XX1 1XX.",
  "next": "Call quote_letter with this address."
}

Input

Over REST, fields in the path go in the path, GET fields in the query string, and POST fields in the JSON body. Over MCP, every field is an argument of the tool.

{
  "type": "object",
  "properties": {
    "line1": {
      "type": "string",
      "minLength": 1,
      "maxLength": 100
    },
    "line2": {
      "type": "string",
      "minLength": 1,
      "maxLength": 100
    },
    "line3": {
      "type": "string",
      "minLength": 1,
      "maxLength": 100
    },
    "town": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60
    },
    "postcode": {
      "type": "string",
      "minLength": 2,
      "maxLength": 10
    },
    "country": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60
    }
  },
  "required": [
    "line1",
    "postcode"
  ],
  "additionalProperties": false
}

Output

{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "enum": [
        "valid",
        "corrected",
        "not_found",
        "ambiguous"
      ],
      "description": "valid: right as sent. corrected: found, written differently. Otherwise not usable."
    },
    "test": {
      "type": "boolean",
      "description": "True for a TEST postcode: nothing is looked up."
    },
    "address": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "lines": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "town": {
              "type": "string"
            },
            "postcode": {
              "type": "string"
            }
          },
          "required": [
            "lines",
            "town",
            "postcode"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ],
      "description": "The address as it will print. Null unless found."
    },
    "prints_as": {
      "anyOf": [
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "changes": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "What we changed from what you sent."
    },
    "matches": {
      "type": "array",
      "items": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "description": "Close matches. Use one only if it is clearly the same place."
    },
    "says": {
      "type": "string",
      "description": "A sentence to repeat to your person as it stands."
    },
    "next": {
      "type": "string"
    }
  },
  "required": [
    "status",
    "test",
    "address",
    "prints_as",
    "changes",
    "matches",
    "says",
    "next"
  ],
  "additionalProperties": false
}

Refusals

Every refusal has the same shape. Branch on code, answer and retry; repeat say to your person.

CodeAnswerRetryHTTPWhat to do next
key_missingnoafter_fix401Send the key as "Authorization: Bearer as_test_…". Ask your person if you have none.
key_not_validnonever401Ask your person for a new key. There is no link: we cannot say whose it was.
scope_missingnoafter_person403Ask your person to give the key that permission.
invalid_requestnoafter_fix400Fix the field named in details.field. The same idempotency key is fine.
rate_limitednoat_time429Wait. The same idempotency key never sends twice.
try_again_shortlynoat_time503Try again after retry_after with the same idempotency key.
account_expirednonever401Start again with start_account if your person still wants this.
connection_endednoafter_person401Tell your person. To carry on, they connect Atomside again in your assistant.
address_not_uknonever422Tell your person. We cannot post this letter.
test_postcode_in_livenoafter_fix422Use the real address. Rehearse outcomes with a test key.
unclaimed_limit_reachednoafter_person403Pass on tell_your_person from start_account, or new_claim_link. Claiming lifts the limit.
not_foundnoafter_fix404Check the name against the tool list or /v1/openapi.json.