Skip to main content
Glama
narinthon-so

thailand-data-mcp

by narinthon-so

Normalize Thai Address

thai_address_normalize
Read-onlyIdempotent

Parse free-text Thai addresses into province, district, subdistrict, and postal code with official codes and bilingual names.

Instructions

Parse free-text Thai addresses (Thai or English) into the official administrative hierarchy: province (จังหวัด) → district (อำเภอ/เขต) → subdistrict (ตำบล/แขวง) → postal code, with bilingual names and official codes.

Handles common written forms: abbreviations (ต./อ./จ., กทม.), Bangkok's แขวง/เขต terminology, missing components, and postcode-only inputs. Matching is dictionary-based against the complete official geography (77 provinces, 928 districts, 7,436 subdistricts).

Args:

  • address (string): free-text address, 2-500 chars

Returns structured JSON: { "province": { "code": number, "nameTh": string, "nameEn": string } | null, "district": { ... } | null, "subdistrict": { ... } | null, "postalCode": number | null, "confidence": "high" | "medium" | "low" | "ambiguous" | "none", "streetHint": string | null, // residual text after removing administrative parts (house no., road, soi) "warnings": string[], // e.g. postcode/subdistrict mismatch "candidates": [...] // present when confidence = "ambiguous"; add district/postcode and retry }

Examples:

  • Use when: filling a shipping form from a customer's pasted address

  • Use when: validating that district/province/postcode in a record are consistent

  • Use when: deduplicating customer records with differently-written addresses

  • Don't use when: you need geocoding to lat/long (not provided)

Error handling: confidence "none" means nothing matched — the text may not be a Thai address.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesFree-text Thai address in Thai or English, e.g. '400/22 ถ.พหลโยธิน แขวงสามเสนใน เขตพญาไท กทม 10400'. Partial addresses work — more components give higher confidence.
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations indicate readOnly, idempotent, non-destructive. The description adds rich behavioral detail: dictionary-based matching, scale (77 provinces, 928 districts, 7,436 subdistricts), confidence levels, warnings, and candidate handling for ambiguous matches.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with clear sections (purpose, handling, args, returns, examples, error handling). Slightly verbose but every sentence is informative, no fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Completely covers input, output, error states, and usage scenarios. Although no output schema is provided, the description fully specifies the return structure, including nested objects and edge cases like confidence levels.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with a detailed description. The description enhances understanding by showing example formats and explaining partial address handling, adding value beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool parses free-text Thai addresses into an official administrative hierarchy with bilingual names and codes. It distinguishes itself from sibling tools (company lookup, holidays, etc.) as a unique address normalization function.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit use cases (filling shipping forms, validating consistency, deduplication) and a clear don't-use condition for geocoding, guiding the agent precisely.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/narinthon-so/thailand-data-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server