vn-skills
v0.10.0Vietnam: VietQR, address, tax ID, CCCD, phone, holiday, names, number/date format, lunar, e-invoice
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
vietqr_build Build VietQR
Create a VietQR (NAPAS 247) bank-transfer QR payload. Returns the EMVCo string, CRC and optionally a PNG image. Bank accepts BIN (970436), code (VCB) or name (Vietcombank). Amount is integer VND; note is sanitized (no diacritics, max 25 chars).
| Parameter | Type | Description |
|---|---|---|
account * | string | Beneficiary account number |
bank * | string | Bank BIN, code or name, e.g. "VCB", "970436", "Vietcombank" |
accountName | string | Account holder shown on the card (display only, not in the payload). |
additionalData | object | Extra tag 62 sub-fields keyed by two-digit ID, e.g. {"05":"ORDER123"}. Passed through, not interpreted. Use note for 08. |
amount | number | string | Amount in VND (integer). Omit for a static QR. |
image | boolean | Also return a PNG image (base64). Default false. |
note | string | Transfer note / purpose |
template | string | Also return a printable SVG card (QR + bank, account, amount) as `card`. |
vietqr_parse Parse VietQR
Decode a VietQR / EMVCo QR payload string: bank, account, amount, note, and whether the CRC is valid.
| Parameter | Type | Description |
|---|---|---|
payload * | string | The decoded QR text, starting with 000201 |
vietqr_decode Decode VietQR image
Read the QR code in a PNG image and decode it like vietqr_parse: bank, account, amount, note, CRC validity. Give exactly one of `path` (a file on the server) or `data` (base64 of the PNG, or a data:image/png;base64, URL; max 5 MB decoded, at most 20 megapixels). Returns INVALID_INPUT unless exactly one is given, TOO_LARGE over either cap, READ_ERROR for bad base64 or an unreadable/non-PNG image and NO_QR when no QR code is found.
| Parameter | Type | Description |
|---|---|---|
data | string | Base64 PNG bytes, or a data:image/png;base64,... URL (max 5 MB decoded) |
mimeType | string | MIME type of `data`, e.g. image/png |
path | string | Path to a PNG image on the server |
vietqr_banks Search banks
Search the NAPAS bank list by BIN, code, short name, full name or SWIFT/BIC code. Empty query lists all banks.
| Parameter | Type | Description |
|---|---|---|
query | string | e.g. "vietcombank", "VCB", "9704", "BFTVVNVX" (SWIFT/BIC) |
vn_address_parse Parse Vietnamese address
Parse a free-text Vietnamese address into province / ward / street using the post-01/07/2025 catalogue (34 provinces, no districts). Handles missing diacritics and abbreviations (TP.HCM, Q.1, P. Bến Nghé). Set mode "legacy" for pre-2025 addresses with districts.
| Parameter | Type | Description |
|---|---|---|
text * | string | Free-text address |
mode | string | Default auto |
vn_address_convert_batch Convert many old addresses to new (2025)
Convert up to 1000 pre-July-2025 Vietnamese free-text addresses (63 provinces, districts, wards) into the new 2-level structure (34 provinces, wards) in one call. Returns per-row results plus a summary of converted and failed rows. Null, empty or non-string entries do not fail the call: they come back as failed rows (ok:false with an error code) and are counted in summary.failed.
| Parameter | Type | Description |
|---|---|---|
addresses * | array | Free-text old addresses (max 1000); null or empty entries become failed rows |
vn_address_convert Convert old address to new (2025)
Convert a pre-July-2025 Vietnamese address (63 provinces, districts, wards) into the new 2-level structure (34 provinces, wards). Returns the new ward/province, mapping type (unchanged/merged/divided) and all candidates when the old ward was split. When the client supports elicitation, the server may ask the user to pick the new ward for a split old ward (chosenBy: user|default).
| Parameter | Type | Description |
|---|---|---|
district | string | |
province | string | |
street | string | |
text | string | Free-text old address |
ward | string |
vn_address_search_wards Search wards
Find current (post-2025) wards by name, optionally within a province.
| Parameter | Type | Description |
|---|---|---|
query * | string | |
limit | integer | |
province | string |
vn_tax_id_validate_batch Validate many tax IDs
Check up to 1000 Vietnamese tax IDs (mã số thuế) in one call. Returns per-row results (same fields as the single-value tool) plus a summary of total, valid and invalid rows. Null, empty or non-string entries do not fail the call: they come back as failed rows (ok:false, error code EMPTY) and are counted in summary.invalid.
| Parameter | Type | Description |
|---|---|---|
taxIds * | array | Tax IDs (max 1000); null or empty entries become failed rows |
vn_tax_id_validate Validate tax ID
Offline validation of a Vietnamese tax ID (mã số thuế): 10 digits (enterprise), 13 digits (branch, e.g. 0100233488-001) with check-digit verification, or 12-digit personal ID (format only). Does not query the tax authority.
| Parameter | Type | Description |
|---|---|---|
taxId * | string |
vn_id_parse_batch Parse many citizen IDs
Check up to 1000 Vietnamese CCCD/CMND numbers in one call. Returns per-row results (same fields as the single-value tool) plus a summary of total, valid and invalid rows. Null, empty or non-string entries do not fail the call: they come back as failed rows (ok:false, error code EMPTY) and are counted in summary.invalid.
| Parameter | Type | Description |
|---|---|---|
ids * | array | Citizen ID numbers (max 1000); null or empty entries become failed rows |
vn_id_parse Parse citizen ID
Offline validation and decoding of a 12-digit CCCD (province, sex, birth year; legacy province mapped to 2025 province) or format check of a 9-digit CMND. Format validity does not prove the identity exists.
| Parameter | Type | Description |
|---|---|---|
id * | string |
vn_phone_parse_batch Parse many phone numbers
Check up to 1000 Vietnamese phone numbers in one call. Returns per-row results (same fields as the single-value tool) plus a summary of total, valid and invalid rows. Null, empty or non-string entries do not fail the call: they come back as failed rows (ok:false, error code EMPTY) and are counted in summary.invalid.
| Parameter | Type | Description |
|---|---|---|
phones * | array | Phone numbers (max 1000); null or empty entries become failed rows |
vn_phone Vietnamese phone number
Normalise a Vietnamese phone number (0/84/+84, old 11-digit 01xx mobile prefixes) to national and E.164 forms and classify it: mobile (original carrier) or landline (area code, province). Offline.
| Parameter | Type | Description |
|---|---|---|
phone * | string |
vn_name Vietnamese name tools
Split a Vietnamese full name into họ / tên đệm / tên (handles Tôn Thất, Nguyễn Phúc), plus slug and initials; or sort a list of names by tên with Vietnamese collation (sortAs: "text" sorts any strings).
| Parameter | Type | Description |
|---|---|---|
ascii | boolean | Strip diacritics from initials |
name | string | Full name to split |
names | array | Names to sort |
sortAs | string | "name" (default) sorts by tên; "text" sorts whole strings |
vn_money_to_words Amount in Vietnamese words
Read an integer VND amount in Vietnamese words, e.g. 1200000 -> "một triệu hai trăm nghìn đồng". Also reads plain numbers without a unit with plain: true, e.g. 30 -> "ba mươi". Reads ordinals with ordinal: true, e.g. 4 -> "thứ tư" (second "nhì"/"hai" for 2). Options: thousand "nghìn"/"ngàn", odd "lẻ"/"linh", capitalize, unit, lang "en" for English words (e.g. "one million two hundred thousand dong").
| Parameter | Type | Description |
|---|---|---|
amount * | number | string | |
capitalize | boolean | |
chan | boolean | Append "chẵn" for round amounts |
lang | string | "vi" (default) or "en" (English words, default unit "dong") |
odd | string | |
ordinal | boolean | Read an ordinal ("thứ nhất", "thứ tư"); integers >= 1, implies plain |
plain | boolean | Read a plain number without a unit (default false); not with unit/chan |
second | string | Ordinal 2 as "nhì" (default) or "hai" |
thousand | string | |
unit | string | Default "đồng"; "" for none |
vn_text_speech_normalize Rewrite text as spoken Vietnamese for TTS
Rewrite numbers, VND amounts (1.250.000đ, 500k), percentages, phone numbers and dd/mm/yyyy dates in text as spoken Vietnamese for text-to-speech. Decimals and partial dates are left unchanged and listed in skipped. Returns text, changes, skipped.
| Parameter | Type | Description |
|---|---|---|
text * | string |
vn_money_parse Vietnamese number words to digits
Parse an amount written in Vietnamese words back to digits, e.g. "một triệu hai trăm nghìn đồng" -> "1200000". Returns value (digit string), negative, unit, chan.
| Parameter | Type | Description |
|---|---|---|
text * | string |
vn_number_format Vietnamese number formatting and parsing
Format numbers/VND/dates the Vietnamese way (1.234.567,89; 1.200.000 ₫; 1,2 triệu; dd/MM/yyyy) or parse typed amounts ("1tr2", "500k", "1,5 tỷ"; "1.500" = 1500).
| Parameter | Type | Description |
|---|---|---|
mode * | string | |
value * | number | string | |
style | string | Date style, only for mode "date" (default numeric dd/MM/yyyy) |
vn_lunar_from_solar Solar to lunar date
Convert a Gregorian date (dd/mm/yyyy or yyyy-mm-dd) to the Vietnamese lunar date with can chi (e.g. Ất Tỵ), zodiac, leap-month flag and solar term. Optional hour (0-23) adds hourCanChi, hourBranch, hourRange (giờ sinh).
| Parameter | Type | Description |
|---|---|---|
date * | string | |
hour | integer |
vn_lunar_to_solar Lunar to solar date
Convert a Vietnamese lunar date to the Gregorian date. Set leap=true for the leap (nhuận) month.
| Parameter | Type | Description |
|---|---|---|
day * | integer | |
month * | integer | |
year * | integer | |
leap | boolean |
vn_lunar_parse_date Parse Vietnamese date phrase
Turn a Vietnamese date phrase into a solar date: lunar ("rằm tháng Giêng năm sau", "mùng 1 Tết", "23 tháng Chạp"), relative ("ngày mai", "3 ngày nữa", "thứ Sáu tuần sau") or Gregorian. ref (yyyy-mm-dd) defaults to today in UTC+7.
| Parameter | Type | Description |
|---|---|---|
text * | string | |
ref | string |
vn_lunar_month Lunar month calendar
Calendar of a Gregorian month: each day with lunar date (leap flag, mùng 1, rằm), day can chi, solar term starts and holidays/days off.
| Parameter | Type | Description |
|---|---|---|
month * | integer | |
year * | integer |
vn_lunar_holidays Vietnamese holidays
List Vietnamese holidays for a solar year (Tết, Giỗ Tổ Hùng Vương, 30/4, 1/5, 2/9, Trung thu...). Lunar holidays are resolved to solar dates. publicOnly limits to official days off.
| Parameter | Type | Description |
|---|---|---|
year * | integer | |
publicOnly | boolean |
vn_holidays_year Vietnam official days off for a year
Official days off for public-sector staff in a year (2023-2199): Tết Dương lịch, Tết Âm lịch, Giỗ Tổ Hùng Vương, 30/4, 1/5, Quốc khánh, Ngày Văn hóa Việt Nam 24/11 (from 2026), with nghỉ bù and swapped working Saturdays from the Government notice. Unannounced years return the statutory days, announced: false and the pending Tết / National Day days.
| Parameter | Type | Description |
|---|---|---|
year * | integer |
vn_holidays_ics Export Vietnam days off as an iCalendar file
Export the official days off of a year (2023-2199) as iCalendar (RFC 5545) text for Google Calendar, Outlook or Apple Calendar: holidays, nghỉ bù, swapped days and (optionally) working Saturdays. Unannounced years omit pending days and list them in warnings.
| Parameter | Type | Description |
|---|---|---|
year * | integer | |
includeWorkingSaturdays | boolean |
vn_holidays_is_working_day Is it a working day in Vietnam?
Whether a date is a working day for public-sector staff (Monday-Friday minus holidays and nghỉ bù, plus swapped Saturdays). certain: false when the year is not announced and the date may still become a Tết or National Day day off.
| Parameter | Type | Description |
|---|---|---|
day * | integer | |
month * | integer | |
year * | integer |
vn_holidays_add_working_days Add Vietnamese working days
The date n working days after (or before, n < 0) a date, skipping weekends, holidays and nghỉ bù; the start date is not counted. certain: false if unannounced days were crossed.
| Parameter | Type | Description |
|---|---|---|
day * | integer | |
month * | integer | |
n * | integer | |
year * | integer |
vn_holidays_count_working_days Count Vietnamese working days
Number of working days in (from, to]: the start date is not counted, the end date is; negative if to is before from. Skips weekends, holidays and nghỉ bù. certain: false if unannounced Tết or National Day days were crossed.
| Parameter | Type | Description |
|---|---|---|
from * | string | |
to * | string |
vn_einvoice_validate Validate e-invoice
Validate an e-invoice (hóa đơn điện tử) object against the mandatory contents of Decree 123/2020 (series, date, seller tax ID, lines, VAT rates 0/5/8/10/KCT/KKKNT).
| Parameter | Type | Description |
|---|---|---|
invoice * | object | Invoice object: {series, issueDate, seller{name,taxId,address}, buyer{...}, lines[{name,quantity,unitPrice,vatRate}]} |
vn_einvoice_totals Compute e-invoice totals
Validate an invoice and compute line amounts, VAT per rate, grand total and the total in Vietnamese words.
| Parameter | Type | Description |
|---|---|---|
invoice * | object | Invoice object: {series, issueDate, seller{name,taxId,address}, buyer{...}, lines[{name,quantity,unitPrice,vatRate}]} |
thousand | string |
vn_einvoice_vat Apply or split VAT
Apply VAT to a net amount, or with inclusive=true split a VAT-inclusive price (giá đã gồm VAT) into net (tiền hàng) and VAT. Rates 0/5/8/10/KCT/KKKNT. Net is rounded half away from zero and the leftover đồng goes to VAT (library convention).
| Parameter | Type | Description |
|---|---|---|
amount * | number | Integer VND amount |
rate * | number | string | VAT rate: 0, 5, 8, 10, "KCT" or "KKKNT" |
inclusive | boolean | true: amount already includes VAT |
vn_einvoice_mock_issue Issue invoice (mock)
Issue an invoice through the in-memory MOCK provider (no real API, nothing persisted). Useful for testing integrations before wiring MISA/Viettel/VNPT sandbox adapters.
| Parameter | Type | Description |
|---|---|---|
invoice * | object | Invoice object: {series, issueDate, seller{name,taxId,address}, buyer{...}, lines[{name,quantity,unitPrice,vatRate}]} |
vn_lunar_tet Date of Tết
Solar date of Tết (lunar new year) for a year, with can chi and leap month.
| Parameter | Type | Description |
|---|---|---|
year * | integer | Year, e.g. 2026 |
vn_lunar_canchi Can chi of a year
Can chi (e.g. Giáp Thìn) of a lunar year, with its leap month if any.
| Parameter | Type | Description |
|---|---|---|
year * | integer | Year, e.g. 2024 |
vn_tax_id_check_digit Tax ID check digit
Compute the 10th check digit of a Vietnamese tax ID from its first 9 digits.
| Parameter | Type | Description |
|---|---|---|
first9 * | string | Exactly 9 digits |
vn_address_provinces List provinces
List the 34 current Vietnamese provinces (since 01/07/2025) with ward counts.
vn_address_history Former wards of a current ward
List the pre-01/07/2025 wards (with district and province) that became a current ward, by ward code or name.
| Parameter | Type | Description |
|---|---|---|
ward * | string | Current ward code or name |
province | string |
vn_address_province Look up a province
Look up one current province by name, alias (e.g. "TP.HCM") or 2-digit code.
| Parameter | Type | Description |
|---|---|---|
query * | string | Province name, alias or code |
vn_einvoice_example Example e-invoice
Return a valid example invoice object to start from.