{"at":"2026-11-23T05:31:06.062Z","dir":"sent","era":"server_discover","message":{"id":1,"jsonrpc":"2.0","method":"server/discover","params":{"_meta":{"io.modelcontextprotocol/clientCapabilities":{},"io.modelcontextprotocol/clientInfo":{"name":"didrun-lab","version":"0.1.0"},"io.modelcontextprotocol/protocolVersion":"2026-07-28"}}}}
{"at":"2026-11-23T05:31:06.512Z","dir":"received","era":"server_discover","message":{"error":{"code":-32601,"message":"Method not found"},"id":1,"jsonrpc":"2.0"}}
{"at":"2026-11-23T05:31:06.613Z","dir":"sent","era":"initialize","message":{"id":1,"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{},"clientInfo":{"name":"didrun-lab","version":"0.1.0"},"protocolVersion":"2025-11-25"}}}
{"at":"2026-11-23T05:31:07.056Z","dir":"received","era":"initialize","message":{"id":1,"jsonrpc":"2.0","result":{"capabilities":{"tools":{"listChanged":true}},"protocolVersion":"2025-11-25","serverInfo":{"name":"thailand-data-mcp-server","version":"0.1.0"}}}}
{"at":"2026-11-23T05:31:07.057Z","dir":"sent","era":"initialize","message":{"jsonrpc":"2.0","method":"notifications/initialized"}}
{"at":"2026-11-23T05:31:07.057Z","dir":"sent","era":"initialize","message":{"id":2,"jsonrpc":"2.0","method":"tools/list","params":{}}}
{"at":"2026-11-23T05:31:07.059Z","dir":"received","era":"initialize","message":{"id":2,"jsonrpc":"2.0","result":{"tools":[{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":true,"readOnlyHint":true},"description":"Look up a Thai company (juristic person) in the official DBD (Department of Business Development) registry by its 13-digit registration number.\n\nReturns the official registry profile: Thai/English name, entity type, operating status, registration date, registered and paid-up capital (THB), business objective (bilingual, with TSIC-style code), and registered head-office address.\n\nArgs:\n  - juristic_id (string): exactly 13 digits, e.g. \"0107536000315\"\n\nReturns structured JSON:\n  {\n    \"found\": boolean,\n    \"company\": {\n      \"juristicId\": string,\n      \"nameTh\": string, \"nameEn\": string,\n      \"type\": string,            // e.g. \"บริษัทจำกัด\" (Co., Ltd.), \"บริษัทมหาชนจำกัด\" (PCL)\n      \"status\": string,          // e.g. \"ยังดำเนินกิจการอยู่\" = still operating\n      \"registerDate\": string,    // YYYYMMDD\n      \"registeredCapitalBaht\": number, \"paidUpCapitalBaht\": number,\n      \"objective\": { \"code\": string, \"textTh\": string, \"textEn\": string },\n      \"address\": { ... }\n    } | null,\n    \"fromCache\": boolean,\n    \"attribution\": string\n  }\n\nExamples:\n  - Use when: verifying a Thai supplier/counterparty exists and is still operating (KYB / due diligence)\n  - Use when: fetching official registered capital or address for a contract\n  - Don't use when: you only have a company NAME — this tool requires the 13-digit ID (ask the counterparty or check their invoice/website footer)\n\nNotes:\n  - \"found\": false means the ID is not in the registry — it may be mistyped, or the entity may be a sole proprietor (not a juristic person).\n  - Data is the live official registry, cached for 24h.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"juristic_id":{"description":"13-digit Thai juristic person registration number, e.g. '0107536000315'. Printed on invoices, contracts, and company documents; same number as the company's tax ID.","pattern":"^\\d{13}$","type":"string"}},"required":["juristic_id"],"type":"object"},"name":"thai_company_lookup","title":"Thai Company Registry Lookup"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"Parse free-text Thai addresses (Thai or English) into the official administrative hierarchy: province (จังหวัด) → district (อำเภอ/เขต) → subdistrict (ตำบล/แขวง) → postal code, with bilingual names and official codes.\n\nHandles 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).\n\nArgs:\n  - address (string): free-text address, 2-500 chars\n\nReturns structured JSON:\n  {\n    \"province\":    { \"code\": number, \"nameTh\": string, \"nameEn\": string } | null,\n    \"district\":    { ... } | null,\n    \"subdistrict\": { ... } | null,\n    \"postalCode\": number | null,\n    \"confidence\": \"high\" | \"medium\" | \"low\" | \"ambiguous\" | \"none\",\n    \"streetHint\": string | null,     // residual text after removing administrative parts (house no., road, soi)\n    \"warnings\": string[],            // e.g. postcode/subdistrict mismatch\n    \"candidates\": [...]              // present when confidence = \"ambiguous\"; add district/postcode and retry\n  }\n\nExamples:\n  - Use when: filling a shipping form from a customer's pasted address\n  - Use when: validating that district/province/postcode in a record are consistent\n  - Use when: deduplicating customer records with differently-written addresses\n  - Don't use when: you need geocoding to lat/long (not provided)\n\nError handling: confidence \"none\" means nothing matched — the text may not be a Thai address.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"address":{"description":"Free-text Thai address in Thai or English, e.g. '400/22 ถ.พหลโยธิน แขวงสามเสนใน เขตพญาไท กทม 10400'. Partial addresses work — more components give higher confidence.","maxLength":500,"minLength":2,"type":"string"}},"required":["address"],"type":"object"},"name":"thai_address_normalize","title":"Normalize Thai Address"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"List all 77 Thai provinces with official codes and bilingual names.\n\nReturns structured JSON: { \"count\": 77, \"provinces\": [{ \"code\": number, \"nameTh\": string, \"nameEn\": string }] }\n\nUse when you need the canonical province list for validation, dropdowns, or mapping Thai/English province spellings.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{},"type":"object"},"name":"thai_list_provinces","title":"List Thai Provinces"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"List Thai public holidays for a given year (2025, 2026), with dates, Thai/English names, and a flag for lunar-calendar holidays.\n\nArgs:\n  - year (number): one of 2025, 2026\n\nReturns structured JSON:\n  { \"year\": number, \"count\": number, \"holidays\": [{ \"date\": \"YYYY-MM-DD\", \"nameEn\": string, \"nameTh\": string, \"lunar\": boolean }], \"disclaimer\": string }\n\nUse when scheduling anything in Thailand: payment due dates, meeting planning, delivery estimates, contract deadlines. Lunar holidays (lunar: true) are fixed by annual announcement — verify for critical deadlines. Bank holidays can differ slightly from public holidays (Bank of Thailand publishes its own list).","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"year":{"description":"Calendar year. Available: 2025, 2026","type":"integer"}},"required":["year"],"type":"object"},"name":"thai_holidays","title":"Thai Public Holidays"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"Reference card for Thai VAT and withholding tax (WHT) basics: standard VAT rate, registration threshold, filing forms and deadlines, and common WHT rates by payment category (services, rent, advertising, transport, dividends, etc.).\n\nNo arguments.\n\nReturns structured JSON with \"vat\", \"withholdingTax\" (rates table + certificate requirement), and \"disclaimers\".\n\nUse when: computing invoice amounts involving Thai WHT deduction, checking whether a business must register for VAT, or explaining the 50 ทวิ withholding certificate. Reference only — NOT tax advice; verify with the Revenue Department for filings.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{},"type":"object"},"name":"thai_vat_reference","title":"Thai VAT & Withholding Tax Reference"}]}}}
