check_piva
Validate Italian VAT numbers locally using official MEF checksum and format rules, returning validity, normalized value, and failure reason without network calls.
Instructions
Validate an Italian VAT number using the official MEF checksum algorithm.
Performs format validation and the Ministry of Economy checksum algorithm. No network call — fully local computation.
Args: piva: Italian VAT number string. May include or omit the "IT" prefix. Expected: 11 digits after stripping prefix and whitespace. ctx: Optional MCP context for structured log emission.
Returns: A CheckPivaResult with keys: valid (bool): Whether the P.IVA passes format and checksum checks. piva (str): Normalised P.IVA (11 digits, no prefix). reason (str | None): Failure reason if valid is False, else None.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| piva | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| piva | Yes | ||
| valid | Yes | ||
| reason | Yes |