random_postcode
Pack: postcodes · Endpoint: https://gateway.pipeworx.io/postcodes/mcp
Get a random valid UK postcode with full geographic details. Returns coordinates, region, district, ward, and constituency.
Example call
Arguments
{}
curl
curl -X POST https://gateway.pipeworx.io/postcodes/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"random_postcode","arguments":{}}}'
TypeScript (@pipeworx/sdk)
import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();
const result = await pipeworx.call('random_postcode', {});
Response shape
Always returns: postcode, incode, outcode, country, codes
| Field | Type | Description |
|---|---|---|
postcode | string | The UK postcode |
incode | string | Incode part of postcode |
outcode | string | Outcode part of postcode |
country | string | Country name |
region | string | null | Region name |
admin_district | string | null | Administrative district |
admin_ward | string | null | Administrative ward |
parliamentary_constituency | string | null | Parliamentary constituency |
lat | number | null | Latitude coordinate |
lon | number | null | Longitude coordinate |
eastings | number | null | Eastings grid reference |
northings | number | null | Northings grid reference |
codes | object | Codes mapping object |
Full JSON Schema
{
"type": "object",
"properties": {
"postcode": {
"type": "string",
"description": "The UK postcode"
},
"incode": {
"type": "string",
"description": "Incode part of postcode"
},
"outcode": {
"type": "string",
"description": "Outcode part of postcode"
},
"country": {
"type": "string",
"description": "Country name"
},
"region": {
"type": [
"string",
"null"
],
"description": "Region name"
},
"admin_district": {
"type": [
"string",
"null"
],
"description": "Administrative district"
},
"admin_ward": {
"type": [
"string",
"null"
],
"description": "Administrative ward"
},
"parliamentary_constituency": {
"type": [
"string",
"null"
],
"description": "Parliamentary constituency"
},
"lat": {
"type": [
"number",
"null"
],
"description": "Latitude coordinate"
},
"lon": {
"type": [
"number",
"null"
],
"description": "Longitude coordinate"
},
"eastings": {
"type": [
"number",
"null"
],
"description": "Eastings grid reference"
},
"northings": {
"type": [
"number",
"null"
],
"description": "Northings grid reference"
},
"codes": {
"type": "object",
"description": "Codes mapping object"
}
},
"required": [
"postcode",
"incode",
"outcode",
"country",
"codes"
]
}
Connect
Add this to your MCP client config, or use one-click install buttons:
{
"mcpServers": {
"postcodes": {
"url": "https://gateway.pipeworx.io/postcodes/mcp"
}
}
}
See Getting Started for client-specific install steps.