thai-mcp
thai-mcp / tools

Tool reference

Seven tools. Every example below was produced by calling the real code when this page was built.

Informational only. Not tax, accounting or legal advice. Results depend on rules that change; re-verify rates and dates with the Revenue Department.

promptpay_qr PromptPay QR payload + image

Build a Thai PromptPay (Thai QR Payment, EMVCo/BOT) credit-transfer QR. Returns the exact EMV payload string with a valid CRC16-CCITT-FALSE checksum, plus the QR code as an SVG string and a data: URI. target: Thai mobile number (0XXXXXXXXX or 66XXXXXXXXX, spaces/dashes ok), 13-digit national ID or tax ID, or 15-digit e-wallet ID. amount (THB, max 2 decimals) is optional: with an amount the QR is dynamic (POI 12) and the payer cannot change it; without one it is static (POI 11). Nothing is stored. Does not verify that the account exists.

argumenttypedescription
targetstringrequiredPromptPay ID: mobile 0812345678 / 66812345678 / +66 81 234 5678, 13-digit national ID or tax ID, or 15-digit e-wallet ID.
amountnumber | stringoptionalOptional amount in THB with at most 2 decimals, e.g. 100 or "1234.50". Omit for a static QR where the payer types the amount.

The payload follows the Bank of Thailand “Standardized Thai QR Code” guideline (EMVCo merchant-presented mode): tags 00, 01, 29 (AID A000000677010111 + mobile 01 / national or tax ID 02 / e-wallet 03), 58, 53, optional 54, 63. A mobile number becomes 0066 + 9 digits. The QR uses error-correction level M. The test suite rasterises the returned SVG and decodes it with zbarimg to confirm it equals the payload. The tool cannot check that the account exists. Targets whose 13 digits fail the ID checksum get a warning, not an error.

tools/call params
{
  "name": "promptpay_qr",
  "arguments": {
    "target": "0812345678",
    "amount": 100
  }
}
result.content[0].text
PromptPay QR (mobile *****5678, 100.00 THB)
Payload (EMV QPS, CRC16-CCITT BB8A):
00020101021229370016A000000677010111011300668123456785802TH53037645406100.006304BB8A
An SVG image of the QR is in structuredContent.svg (and as a data URI). Render it or encode the payload with any QR library.
result.structuredContent (long strings shortened)
{
  "payload": "00020101021229370016A000000677010111011300668123456785802TH53037645406100.006304BB8A",
  "target_type": "mobile",
  "target_masked": "*****5678",
  "amount": "100.00",
  "currency": "THB",
  "dynamic": true,
  "crc": "BB8A",
  "svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 360 360…",
  "svg_data_uri": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My…",
  "warnings": []
}

thai_vat Thai VAT calculator

Compute Thai VAT with exact integer-satang arithmetic (half-up rounding to the satang). mode 'exclusive': amount is the pre-VAT price, returns net/vat/gross. mode 'inclusive': amount already includes VAT, VAT extracted as gross*rate/(100+rate). rate: 7 (default) or 10. 7% is the temporarily reduced rate, in force through 30 Sep 2027 under Royal Decree 807 B.E. 2569 (statutory rate 10%); this was verified from Revenue Department releases on 24 Nov 2026 - the caller should re-verify before relying on it. Not tax advice.

argumenttypedescription
amountnumber | stringrequiredAmount in THB (max 2 decimals), >= 0.
modestring (exclusive | inclusive)default "exclusive"'exclusive' = amount excludes VAT (add VAT); 'inclusive' = amount includes VAT (extract VAT).
rateinteger (7 | 10)default 7VAT rate percent: 7 (reduced, default) or 10 (statutory).

Reduced 7% VAT (6.3% VAT + 0.7% local tax) is in force through 30 Sep 2027 under Royal Decree No. 807 B.E. 2569; the statutory rate is 10%. Verified from Revenue Department releases 18/2569 and 19/2569 on 24 Nov 2026. Re-verify before relying on it. Exclusive: vat = round(net × rate / 100). Inclusive: vat = round(gross × rate / (100 + rate)), net = gross − vat. Rounding is half-up on integer satang.

tools/call params
{
  "name": "thai_vat",
  "arguments": {
    "amount": 1070,
    "mode": "inclusive"
  }
}
result.content[0].text
VAT 7% (amount includes VAT): net 1000.00 + VAT 70.00 = gross 1070.00 THB
result.structuredContent
{
  "mode": "inclusive",
  "rate": 7,
  "net": "1000.00",
  "vat": "70.00",
  "gross": "1070.00",
  "currency": "THB",
  "rounding": "half-up to the satang",
  "note": "Reduced 7% VAT (6.3% VAT + 0.7% local tax) is in force throu…"
}

thai_wht Thai withholding tax (WHT)

Compute Thai withholding tax (หัก ณ ที่จ่าย) on a pre-VAT amount, with optional VAT combination (WHT is computed on the amount BEFORE VAT) and the amount payable to the supplier. payment_type: service 3%, rent 5%, advertising 2%, transport 1%, professional_fees 3%, prizes 5% (Thai company recipients; per Revenue Department), or 'custom' with caller-supplied custom_rate - any other rate (interest, royalties, dividends, foreign payees, ...) is NOT built in and must use 'custom'. e_wht=true applies the optional 1% e-Withholding rate (Ministerial Regulation 402 B.E. 2569) in place of 2/3/5% - only for electronically filed and remitted payments; check eligibility. Integer-satang half-up rounding. Not tax advice.

argumenttypedescription
amountnumber | stringrequiredPayment amount in THB BEFORE VAT (max 2 decimals).
payment_typestring (service | rent | advertising | transport | professional_fees | prizes | custom)requiredPayment category. Use 'custom' with custom_rate for anything else.
custom_ratenumber | stringoptionalPercent (0-100, max 2 decimals). Required with payment_type 'custom', not allowed otherwise.
include_vatbooleandefault falseAlso add VAT to the invoice total and show amount payable = amount + VAT - WHT.
vat_rateinteger (7 | 10)default 7VAT rate when include_vat is true.
e_whtbooleandefault falseApply the optional 1% e-WHT rate instead of 2/3/5% (only when the payer files and remits electronically).

Built-in rates (Thai company recipients; Revenue Department, rd.go.th/english/52471.html, Departmental Order Tor.Por. 4/2528): service 3%, rent 5%, advertising 2%, transport 1%, professional fees 3%, prizes 5%. Anything else (interest, royalties, dividends, foreign payees…) is not built in: use custom with your own rate. WHT is computed on the amount before VAT. The optional e-WHT 1% (Ministerial Regulation 402 B.E. 2569, 1 Jan 2026 – 31 Dec 2027) replaces 2/3/5% only, and you must confirm the payment qualifies.

tools/call params
{
  "name": "thai_wht",
  "arguments": {
    "amount": 1000,
    "payment_type": "service",
    "include_vat": true
  }
}
result.content[0].text
WHT 3% (Services (to a Thai company/PE)) on 1000.00 THB (pre-VAT) = 30.00 THB.
VAT 7% = 70.00; invoice total 1070.00; amount payable to supplier = 1040.00 THB.
result.structuredContent
{
  "payment_type": "service",
  "payment_type_label": "Services (to a Thai company/PE)",
  "rate_percent": 3,
  "amount_before_vat": "1000.00",
  "wht": "30.00",
  "vat": "70.00",
  "vat_rate": 7,
  "invoice_total_with_vat": "1070.00",
  "net_payable": "1040.00",
  "wht_base": "amount before VAT",
  "e_wht_applied": false,
  "currency": "THB",
  "notes": [
    "Rates per Revenue Department (rd.go.th/english/52471.html; D…",
    "Optional e-WHT: Ministerial Regulation No. 402 B.E. 2569 pro…"
  ]
}

thai_date_convert Thai date / Buddhist Era converter

Convert between Buddhist Era (พ.ศ. = CE + 543) and Gregorian dates, parse Thai or English date text, validate that the date really exists (leap years), and return Thai + English weekday. Give either date (string such as '3 ธันวาคม 2569', '3 ธ.ค. 69', '2026-12-03', '3/12/2569' read as day/month/year, '3 Dec 2026'; Thai digits ok) or year+month+day. Years of 4 digits >= 2400 are treated as BE when calendar='auto'; 2-digit years are read as BE 25xx (69 -> 2569) unless calendar='CE'. format selects the main output: th-long '3 ธันวาคม พ.ศ. 2569', th-short '3 ธ.ค. 2569', iso, en. All formats are always returned.

argumenttypedescription
datestringoptionalDate text in Thai or English. Alternative to year/month/day.
yearintegeroptionalYear (BE or CE, see calendar). Use with month and day.
monthintegeroptionalMonth 1-12.
dayintegeroptionalDay of month.
calendarstring (auto | BE | CE)default "auto"How to read the input year. 'auto': >= 2400 means BE, 2-digit means BE 25xx.
formatstring (th-long | th-short | iso | en)default "th-long"Which format goes into the 'formatted' field.

BE (พ.ศ.) = CE + 543. Accepts Thai or English month names (full/short, dots optional), Thai digits, ISO yyyy-mm-dd, and d/m/yyyy (day first). With calendar: "auto", 4-digit years ≥ 2400 are BE and 2-digit years are BE 25xx. Real-calendar validation includes Gregorian leap years (2000 yes, 1900 no, BE 2567 yes). Before 1941 the Thai year began on 1 April, so historical BE years for Jan–Mar can differ by one; the tool applies CE + 543 uniformly and says so in interpretation.

tools/call params
{
  "name": "thai_date_convert",
  "arguments": {
    "date": "3 ธ.ค. 69"
  }
}
result.content[0].text
2026-12-03 (CE 2026 = BE 2569), วันพฤหัสบดี / Thursday.
Thai: วันพฤหัสบดีที่ 3 ธันวาคม พ.ศ. 2569
English: Thursday, 3 December 2026
Notes: 2-digit year 69 read as BE 2569 (assumes 2500-2599; pass 4 digits to be explicit)
result.structuredContent
{
  "iso": "2026-12-03",
  "ce_year": 2026,
  "be_year": 2569,
  "month": 12,
  "day": 3,
  "month_name_th": "ธันวาคม",
  "month_name_th_short": "ธ.ค.",
  "month_name_en": "December",
  "weekday_th": "วันพฤหัสบดี",
  "weekday_en": "Thursday",
  "weekday_index_sun0": 4,
  "day_of_year": 337,
  "is_leap_year": false,
  "formatted": "3 ธันวาคม พ.ศ. 2569",
  "format": "th-long",
  "formats": {
    "th-long": "3 ธันวาคม พ.ศ. 2569",
    "th-short": "3 ธ.ค. 2569",
    "iso": "2026-12-03",
    "en": "3 December 2026",
    "th_long_with_weekday": "วันพฤหัสบดีที่ 3 ธันวาคม พ.ศ. 2569",
    "en_with_weekday": "Thursday, 3 December 2026",
    "th_short_2digit_year": "3 ธ.ค. 69"
  },
  "interpretation": [
    "2-digit year 69 read as BE 2569 (assumes 2500-2599; pass 4 digits to be explicit)"
  ]
}

thai_id_validate Thai ID / tax ID checksum validator

Validate the 13-digit Thai national ID / tax ID check digit (sum of digit*(13-position), check = (11 - sum mod 11) mod 10). Returns formatted X-XXXX-XXXXX-XX-X, the expected check digit, and for invalid numbers which single-digit corrections would satisfy the checksum (the checksum alone cannot tell which digit was mistyped). Validation only: a valid checksum does not prove the ID exists or who it belongs to. Input is processed in memory and never stored or logged. There is deliberately no ID generator.

argumenttypedescription
idstringrequired13-digit ID; spaces and dashes allowed, e.g. '1-2345-67890-12-1'.

Weights 13 down to 2 on the first 12 digits; check digit = (11 − (sum mod 11)) mod 10. A valid checksum only means the number is well-formed: it does not prove the ID exists or who it belongs to. Input is processed in memory; nothing is stored or logged. There is no generator on purpose: numbers starting with 0 are real juristic-person IDs.

tools/call params
{
  "name": "thai_id_validate",
  "arguments": {
    "id": "1-2345-67890-12-1"
  }
}
result.content[0].text
Valid checksum: 1-2345-67890-12-1. A passing checksum only means the number is well-formed. It does not prove the ID exists, is active, or belongs to anyone.
result.structuredContent
{
  "valid": true,
  "formatted": "1-2345-67890-12-1",
  "check_digit": {
    "position": 13,
    "actual": 1,
    "expected": 1
  },
  "caveat": "A passing checksum only means the number is well-formed. It …"
}

thai_baht_text Baht amount in Thai words

Write a THB amount in Thai words as on invoices and cheques (e.g. 1234.56 -> หนึ่งพันสองร้อยสามสิบสี่บาทห้าสิบหกสตางค์; 500 -> ห้าร้อยบาทถ้วน). Handles เอ็ด (…เอ็ด) and ยี่สิบ rules, repeated ล้าน groups, and satang. Exact integer-satang parsing; more than 2 decimals or negative amounts are rejected. Max 999,999,999,999.99.

argumenttypedescription
amountnumber | stringrequiredTHB amount, 0 to 999,999,999,999.99, max 2 decimals. Commas allowed in strings.

Rules covered: เอ็ด for a final 1 after tens/higher places (สิบเอ็ด, หนึ่งร้อยเอ็ด, หนึ่งล้านเอ็ด), ยี่สิบ for 20–29, สิบ (not หนึ่งสิบ) for 10, repeated ล้าน groups, ถ้วน when there are no satang, and ศูนย์บาท before satang-only amounts.

tools/call params
{
  "name": "thai_baht_text",
  "arguments": {
    "amount": 1234.56
  }
}
result.content[0].text
1234.56 THB = หนึ่งพันสองร้อยสามสิบสี่บาทห้าสิบหกสตางค์
result.structuredContent
{
  "amount": "1234.56",
  "currency": "THB",
  "thai_text": "หนึ่งพันสองร้อยสามสิบสี่บาทห้าสิบหกสตางค์"
}

thai_pit_estimate Thai personal income tax estimate (brackets)

Estimate Thai personal income tax with the progressive brackets (0% to 150,000; 5/10/15/20/25/30% steps; 35% above 5,000,000 net; Revenue Department rd.go.th/26218.html). Provide EITHER net_income (taxable net income after all deductions) OR employment_income (annual salary: applies the 50% expense deduction capped at 100,000 and the 60,000 taxpayer allowance, minus optional other_allowances you total yourself). Method 1 only; no 0.5% alternative minimum, no per-allowance rules. Rough estimate, not tax advice.

argumenttypedescription
net_incomenumber | stringoptionalAnnual taxable net income in THB (after expenses and allowances).
employment_incomenumber | stringoptionalAnnual employment income in THB (salary/wages); expense deduction and personal allowance are applied for you.
other_allowancesnumber | stringoptionalExtra annual allowances in THB (spouse, children, insurance, ...) already totalled by the caller. Only with employment_income.

Brackets on net taxable income: 0–150,000 exempt; 5% to 300,000; 10% to 500,000; 15% to 750,000; 20% to 1,000,000; 25% to 2,000,000; 30% to 5,000,000; 35% above (Revenue Department, rd.go.th/26218.html). employment_income applies the 50% expense deduction capped at 100,000 and the 60,000 personal allowance. Method 1 only: no 0.5% alternative method, other income types, or allowance-by-allowance rules.

tools/call params
{
  "name": "thai_pit_estimate",
  "arguments": {
    "employment_income": 600000
  }
}
result.content[0].text
Estimated personal income tax on net income 440000.00 THB: 21500.00 THB/year (1791.67/month). Method 1 (progressive brackets) only. Does not implement the 0.5% alternative minimum (s.48(2)), non-employment income expense rules, or most allowances. Brackets per rd.go.th/26218.html. Not tax advice.
result.structuredContent
{
  "net_income": "440000.00",
  "tax": "21500.00",
  "monthly_average": "1791.67",
  "effective_rate_percent": 4.89,
  "brackets": [
    {
      "from": 0,
      "to": 150000,
      "rate_percent": 0,
      "taxable_in_bracket": "150000.00",
      "tax": "0.00"
    },
    {
      "from": 150000,
      "to": 300000,
      "rate_percent": 5,
      "taxable_in_bracket": "150000.00",
      "tax": "7500.00"
    },
    {
      "from": 300000,
      "to": 500000,
      "rate_percent": 10,
      "taxable_in_bracket": "140000.00",
      "tax": "14000.00"
    }
  ],
  "derivation": {
    "employment_income": "600000.00",
    "expense_deduction": "100000.00",
    "personal_allowance": "60000.00",
    "other_allowances": "0.00"
  },
  "note": "Method 1 (progressive brackets) only. Does not implement the…"
}

All tools return content[0].text (readable), structuredContent (machine-readable) and set isError: true with an explanation when the input is invalid. Money is parsed from decimal text into integer satang; more than 2 decimals is rejected.