Validate a postal code
validate_postcodeCheck whether a postal code has a valid format for a country and return its normalized form (uppercase, official space or hyphen), a format example and the country name. Example: country "NL", code "1234ab" → valid true, normalized "1234 AB". Format check only (Google libaddressinput patterns): it does not confirm the code exists or is deliverable. Countries without postal codes return valid false with reason "no_postal_codes". Read-only. Same engine as GET /v1/validate.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"country": "<country>",
"code": "<code>"
},
"name": "validate_postcode"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | The postal code to check, e.g. "SW1A 1AA", "94103", "10115". | |
| country | Yes | ISO 3166-1 alpha-2 country code, e.g. "US", "GB", "DE" (case-insensitive; "UK" accepted). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | No | ||
| valid | Yes | ||
| reason | No | ||
| country | No | ||
| message | No | ||
| version | Yes | ||
| zip_name | No | ||
| normalized | Yes | ||
| country_name | Yes | ||
| format_example | Yes | ||
| has_postal_codes | No |