Skip to main content
Glama

LATAM Business, Fiscal & FX (x402)

Validate and decode a LATAM tax ID

latam_validate_tax_id
Read-onlyIdempotent

Checks 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

NameRequiredDescriptionDefault
typeNoDocument 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.
valueYesThe 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.
countryNoISO 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

NameRequiredDescriptionDefault
okYestrue when the request was processed and paid for. It does not mean the documents were valid: read results[].valid for that.
metaYesProvenance of the call, worth logging.
errorNoStable 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.
messageNoHuman-readable explanation of the failure. Safe to log or surface to a human operator.
resultsNoA single-element array holding the verdict for the value you sent.
summaryYesAggregate counters, so a batch can be triaged without walking the results array.
warningsNoNon-fatal notes, such as a batch truncated at 100 items or a request that carried nothing to check.
suggestedNextStepsNoChaining 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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint=false, yet the description still adds real value: offline/deterministic edge execution, retry safety, no-throw contract with type 'UNKNOWN' and reasons in errors, branch on results[0].valid rather than HTTP status, and the exact payment mechanics (0.008 USDC via x402 v2 on Base, B2B X-API-Key, HTTP 402 with a PAYMENT-REQUIRED header). It loses a point for an internal inconsistency: it opens by saying it checks 'a single' identifier, then says 'One call is one charge no matter how many identifiers it carries', which could mislead an agent about whether a single call can accept multiple values.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with purpose and coverage, then usage, then exclusions, then behavioral and payment guarantees — a sensible priority order with no filler sentences. The payment/batching material is slightly repetitive and the 'no matter how many identifiers it carries' line contradicts the single-value framing, costing it the top mark.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return-value detail is not required, yet the description still covers the error shape and the correct branching field. Combined with pricing, offline/retry guarantees, and the explicit scope boundary of 'structural and checksum audit, not a registry lookup', an agent has everything needed to call it correctly and interpret failures.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% and the parameter descriptions are themselves unusually rich — they define every enum member, explain that plain 'RUT' is resolved by length, and warn that omitting type can make an 11-digit number ambiguous between CPF and Uruguayan RUT. The description adds essentially no parameter-level information beyond that, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb ('Checks ... and decodes') plus the resource (Latin American tax/personal identifiers) and enumerates the exact document families covered (RFC, CURP, CUIT, CUIL, RUT, NIT, RUC, CPF, CNPJ). It also names what is produced — canonical format plus embedded data such as company vs individual for an RFC or birth date in a CURP — which distinguishes it from any sibling without opening a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete positive contexts (signup, KYC/onboarding, cleaning a supplier record, before paying a per-query registry) and explicit exclusions with the alternative named for each: bank account keys go to latam_validate_bank_account, lists go to latam_validate_batch, and it will not confirm holder existence or active status. The only gap is that latam_convert_fx is not addressed, but that sibling is clearly out of scope for a validator.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.