nearest_postcodes
Pack: postcodes · Endpoint: https://gateway.pipeworx.io/postcodes/mcp
Find nearby UK postcodes sorted by distance from a given postcode (e.g., ‘SW1A 1AA’). Returns list with coordinates.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
postcode | string | yes | UK postcode to find neighbours for (e.g. “SW1A 1AA”). |
Example call
Arguments
{
"postcode": "SW1A 1AA"
}
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":"nearest_postcodes","arguments":{"postcode":"SW1A 1AA"}}}'
TypeScript (@pipeworx/sdk)
import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();
const result = await pipeworx.call('nearest_postcodes', {
"postcode": "SW1A 1AA"
});
Response shape
Always returns: results
| Field | Type | Description |
|---|---|---|
results | array | Array of nearby postcodes sorted by distance |
Full JSON Schema
{
"type": "object",
"properties": {
"results": {
"type": "array",
"items": {
"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"
]
},
"description": "Array of nearby postcodes sorted by distance"
}
},
"required": [
"results"
]
}
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.