Lokal

v0.18.3
io.github.lokal-id/lokal Checked 4 hours ago Published 2 days ago

Indonesia-ready agents: NIK, phone, Rupiah, regions, postal codes, holidays, and PII masking.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

parse_nik Parse NIK

Validate an Indonesian NIK (16-digit national ID) by structure and decode it: province, regency, district (Kemendagri), birth date, gender. Cannot prove the NIK is registered at Dukcapil. Also takes a [NIK_n] placeholder from read_file_masked; then the birth date and gender come back as placeholders.

ParameterTypeDescription
nik *string16-digit NIK; spaces and dots are ignored

validate_npwp Validate NPWP

Validate the format of an Indonesian tax ID (NPWP): legacy 15-digit (XX.XXX.XXX.X-XXX.XXX), 16-digit, or NIK used as NPWP for individuals. Returns the 16-digit form DJP uses today. Format only: it does not check the DJP check digit or registration. Also takes an [NPWP_n] or [NIK_n] placeholder from read_file_masked; then only validity and kind come back.

ParameterTypeDescription
npwp *string

parse_qris Read a QRIS payload

Read and check a QRIS payload (the text inside an Indonesian QRIS payment code): static or dynamic, merchant name and city, NMID, merchant criteria (UMI, UKE, …), amount, tip, merchant accounts, and whether the CRC checksum is intact. Errors and warnings are in Indonesian.

ParameterTypeDescription
payload *stringThe QRIS text, starting with 000201

set_qris_amount Make a dynamic QRIS with an amount

Turn a QRIS payload into a dynamic one for an amount in Rupiah, optionally with a fixed or percentage fee, and recompute the CRC. The merchant account is unchanged. Returns the new payload, ready to render as a QR code.

ParameterTypeDescription
amount *number | stringRupiah, at most 2 decimals, e.g. 25000
payload *string
fee_fixednumber | stringA fixed fee in Rupiah on top of the amount
fee_percentnumber | stringA percentage fee on top of the amount

parse_phone Parse Indonesian phone number

Normalize an Indonesian phone number (08xx, +62, 62, landline with area code) to E.164, display format, WhatsApp form, and original operator (Telkomsel, Indosat, Tri, XL, Axis, Smartfren). Also takes a [PHONE_n] placeholder from read_file_masked; then only validity, type, and operator come back.

ParameterTypeDescription
phone *string

format_rupiah Format Rupiah

Format an amount as Rupiah the Indonesian way (Rp1.500.000), short form (Rp1,5 jt), and spelled out in words (terbilang) for receipts and invoices.

ParameterTypeDescription
amount *numberAmount in rupiah

parse_rupiah Parse Rupiah from text

Turn how Indonesians write money into a number: "Rp 25.000", "1,5jt", "2jtan", "50rb-an", "goceng", "2 ceban", "sejuta setengah", "dua ratus ribu". "m" means miliar.

ParameterTypeDescription
text *string

search_wilayah Search Indonesian regions

Find official Kemendagri regions by name (provinsi, kabupaten/kota, kecamatan, kelurahan/desa) with their codes. Use for address forms, normalizing user-typed locations, and seed data instead of inventing region names.

ParameterTypeDescription
query *string
level1 provinsi, 2 kabupaten/kota, 3 kecamatan, 4 kelurahan/desa
limitinteger
withinstringOnly search inside this region code, e.g. "32" for Jawa Barat

list_wilayah List child regions

List the direct children of a region code — the data behind cascading address dropdowns. No code returns the 38 provinces; "32" returns the kabupaten/kota in Jawa Barat, and so on down to kelurahan/desa (which include their kode pos).

ParameterTypeDescription
parent_codestring

lookup_kode_pos Look up kode pos

Kode pos (postal codes) for Indonesian regions. Give kode_pos to find the kelurahan/desa that use it, or wilayah_code to list every kode pos inside a region (e.g. "32.76" Kota Depok).

ParameterTypeDescription
kode_posstring
wilayah_codestring

parse_alamat Parse an Indonesian address

Read a free-text Indonesian address ("Jl. Margonda Raya No. 100 RT 3/5 Kemiri Muka, Beji, Depok 16423") into street, RT/RW, kode pos, and the Kemendagri kelurahan/desa, kecamatan, kabupaten/kota, and provinsi with their codes. Handles missing commas, capitals, abbreviations (Kel., Kec., Kab., Jaksel, Jabar), and left-out levels. Check confidence and issues: a kode pos that belongs to another kelurahan, a village that is not in the data, or an address that fits more than one region (see alternatives). Use it to clean address columns, fill region dropdowns from typed addresses, or check a shippi…

ParameterTypeDescription
address *string

list_holidays Indonesian public holidays

Libur nasional and cuti bersama for a year, from the official SKB 3 Menteri. Only years with a published decree are available; other years return an error rather than a guess.

ParameterTypeDescription
year *integer

working_days Indonesian working days

Working-day math with Indonesian holidays: is a date a working day, the date N working days after a date (SLA, delivery estimates), or the number of working days between two dates (inclusive). Cuti bersama counts as a day off unless cuti_bersama is false (private companies may work on them).

ParameterTypeDescription
from *string
addintegerWorking days to add (negative to go back)
cuti_bersamaboolean
tostring

scan_pii Scan files for Indonesian personal data

Scan a file or directory (text, CSV, JSON, logs, SQL, .xlsx, .docx, text-based PDF; up to 100 MB each) for personal data — identifiers (NIK, KK, NPWP, phone, email, bank account, BPJS, passport, SIM, NIP, card, plate, IP, coordinates), names, addresses, birth dates, and UU PDP categories (religion, marital status, gender, nationality, health, finances, criminal records, biometrics) — without revealing it: findings show only partially masked values. Also lists files and pages it could not scan (scanned or encrypted PDFs, .xls, .doc, images, archives). Use before reading data files and befor…

ParameterTypeDescription
min_confidencestring
pathstringFile or directory, relative to the project root
typesarray

read_file_masked Read a file with personal data masked

Read a text, CSV, JSON, log, .xlsx, .docx, or text-based PDF file with Indonesian personal data replaced by stable placeholders ([NIK_1], [PHONE_2], [RELIGION_1] …). The same value always gets the same placeholder in this session, so joins, counts, grouping and deduplication still work. Real values never leave the user's machine. Spreadsheets come back as CSV, one block per sheet; Word documents as their text plus each table as CSV; PDFs one block per page.

ParameterTypeDescription
path *string
max_linesinteger
start_lineinteger

write_file_unmasked Write a file, restoring masked values

Write content to a file after replacing Samaran placeholders ([NIK_1], [PHONE_2] …) from this session with the real values, locally. Use this to produce output (cleaned CSV, reports, migrations) from data you read with read_file_masked.

ParameterTypeDescription
content *string
path *string
overwriteboolean

anonymize_file Make a copy of data with realistic stand-ins (Kembaran)

Copy SQL dumps, CSV, JSON, or log files with every piece of Indonesian personal data replaced by a realistic stand-in, for staging, seeders, tests, or sharing with a vendor: valid NIKs in the same district with the same gender and birth year, phone numbers on the same operator, names with the same casing, addresses in the same area, e-mail at example.com. The same value gets the same stand-in in every file of one call, so joins still work. Runs on the user's machine and returns only counts: you never see the data. Use it instead of reading production data, and when asked to copy production dat…

ParameterTypeDescription
output *stringOutput file, or a folder when there are several inputs
paths *arrayInput files, relative to the project root
dry_runbooleanOnly count what would be replaced, and write nothing
keeparrayTypes to leave as they are, e.g. ["FINANCIAL"] for a credit simulation
keep_birth_datebooleanKeep whole birth dates instead of only the year
overwriteboolean
secretstringThe same secret gives the same stand-ins on every run

clear_vault Forget the masked values

Forget every real value behind the placeholders this session gave out. Afterwards write_file_unmasked can no longer restore them, and reading a file again gives new placeholders. Use it when a task with real data is done, or when the user asks to forget the data.