API & MCP
Everything a person can do on LocaleKit Country Format Rules, a program or AI agent can do with the same inputs and get the identical result.
HTTP API
POST https://localekit.usefulweb.site/api/v1/calculate– run LocaleKit Country Format RulesGET https://localekit.usefulweb.site/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
LocaleKit Country Format Rules
Pick a country to get its address form as an ordered field schema (with required flags and local labels like PIN code or Prefecture), the postal-code pattern with examples and validation, the calling code with basic E.164 normalisation, and date/number formatting examples for the country’s likely locale.
| Field | Type | Default | Description |
|---|---|---|---|
country (required) | select (AC, AD, AE, AF, AG, AI, AL, AM, AO, AQ, AR, AS, AT, AU, AW, AX, AZ, BA, BB, BD, BE, BF, BG, BH, BI, BJ, BL, BM, BN, BO, BQ, BR, BS, BT, BV, BW, BY, BZ, CA, CC, CD, CF, CG, CH, CI, CK, CL, CM, | "DE" | Country |
postalCode | text | — | Postal code to validate (optional) |
phone | text | — | Phone number to normalise (optional). National or international format; extensions (ext. 12) are dropped. |
Example request
Germany: postal code + phone
curl -X POST https://localekit.usefulweb.site/api/v1/calculate -H 'content-type: application/json' -d '{"country":"DE","postalCode":"10115","phone":"030 901820"}'
Every result contains
inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.
MCP (Model Context Protocol)
- Streamable HTTP endpoint:
https://localekit.usefulweb.site/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
localekit - Local stdio connector:
node src/mcp-stdio.ts --tool=localekit
{
"mcpServers": {
"localekit": { "type": "http", "url": "https://localekit.usefulweb.site/mcp" }
}
}