Skip to content

Tools reference

All tools return a JSON object as text. Inputs are validated with zod.

validate_nif

Validate a Portuguese NIF and classify the taxpayer.

  • Input: { nif: string }
  • Output: { nif, valid: boolean, entityType: string | null }
{ "nif": "123456789", "valid": true, "entityType": "Pessoa singular" }

validate_iban

Validate an IBAN via the ISO 7064 mod-97 checksum.

  • Input: { iban: string }
  • Output: { iban, valid: boolean, portuguese: boolean }
{ "iban": "PT50000201231234567890154", "valid": true, "portuguese": true }

validate_postal_code

Validate a CP7 postal code (NNNN-NNN).

  • Input: { postalCode: string }
  • Output: { postalCode, valid: boolean }

list_holidays

List Portuguese national mandatory holidays for a year, including movable (Easter-based) feasts. Municipal holidays and the optional Carnival Tuesday are excluded, as they are not national by law.

  • Input: { year: number } (1970–2100)
  • Output: { year, holidays: Array<{ date, name, movable }> }
{
  "year": 2026,
  "holidays": [
    { "date": "2026-01-01", "name": "Ano Novo", "movable": false },
    { "date": "2026-04-03", "name": "Sexta-feira Santa", "movable": true }
  ]
}

is_holiday

Whether a date is a national holiday.

  • Input: { date: string } (YYYY-MM-DD)
  • Output: { date, holiday: boolean }

Notes

  • Validators check structure and check digits only — not whether an identifier is actually assigned/active.
  • Holiday dates are computed (Easter via the Anonymous Gregorian algorithm), so any year works offline.