Validate and decode a LATAM tax ID
latam_validate_tax_idChecks a single Latin American tax or personal identifier and decodes what it encodes: Mexican RFC and CURP, Argentine CUIT and CUIL, Chilean RUT, Colombian NIT, Peruvian RUC, Uruguayan RUT, and Brazilian CPF and CNPJ. It runs the official check-digit algorithm of each registry, confirms the structure, and returns the canonical format plus the data embedded in the number itself, such as whether an RFC belongs to a company or an individual, the birth date and state in a CURP, the DNI inside a CUIT, or whether a CNPJ is a head office or a branch. Use it at signup, in KYC and onboarding flows, to clean a supplier record, or before sending an identifier to a registry that charges per query. Do not use it for bank account keys, which latam_validate_bank_account handles, do not loop it over a list when latam_validate_batch checks up to 100 identifiers for the same single charge, and do not expect it to confirm that the holder exists or is active: this is an offline structural and checksum audit, not a registry lookup. Read-only, deterministic and fully offline at the edge, so the same input always returns the same verdict and a retry is safe. Costs 0.008 USDC per call via x402 v2 on Base (eip155:8453) or a B2B X-API-Key; an unpaid call returns HTTP 402 with a PAYMENT-REQUIRED header. One call is one charge no matter how many identifiers it carries, so batching is strictly cheaper than looping. It never throws on bad input: an unrecognised value comes back with type 'UNKNOWN', valid false and the reasons in errors, so branch on results[0].valid and never on the HTTP status alone.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"value": "<value>"
},
"name": "latam_validate_tax_id"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | Document type, which skips auto-detection and makes the check strict. RFC is the Mexican SAT tax ID, CURP the Mexican RENAPO personal ID, CUIT and CUIL the Argentine AFIP tax and labour IDs, RUT_CL the Chilean SII ID, RUT_UY the Uruguayan DGI ID, NIT the Colombian DIAN ID, RUC the Peruvian SUNAT ID, and CPF and CNPJ the Brazilian Receita Federal personal and company IDs. Plain 'RUT' is resolved to the Chilean or Uruguayan variant by length. Supply it whenever you know it: without it an 11-digit number could be read as a CPF or a Uruguayan RUT. | |
| value | Yes | The identifier to check, with or without punctuation: '12.345.678-5', 'XAXX010101000' and '20-12345678-9' are all accepted. Dots, dashes and slashes are stripped before the checksum is computed. | |
| country | No | ISO 3166-1 alpha-2 country code. Supplying it narrows auto-detection to that country's standards and avoids an ambiguous match between same-length documents. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | true when the request was processed and paid for. It does not mean the documents were valid: read results[].valid for that. | |
| meta | Yes | Provenance of the call, worth logging. | |
| error | No | Stable machine-readable failure code, present only on a rejected call. Common values: 'invalid_payment' and 'settlement_failed' (x402 verification or settlement refused, returned with HTTP 402), 'B2B_KEY_INVALID' and 'B2B_QUOTA_EXCEEDED' (B2B X-API-Key path). An invalid document is NOT an error: the call succeeds with valid false and a populated errors array. | |
| message | No | Human-readable explanation of the failure. Safe to log or surface to a human operator. | |
| results | No | A single-element array holding the verdict for the value you sent. | |
| summary | Yes | Aggregate counters, so a batch can be triaged without walking the results array. | |
| warnings | No | Non-fatal notes, such as a batch truncated at 100 items or a request that carried nothing to check. | |
| suggestedNextSteps | No | Chaining hints for autonomous agents: sibling paid APIs commonly called right after this one, selected from what was actually found in the results. Purely advisory, never required. |