Skip to main content
Glama
MaurizioLisanti

fatturapa-mcp-server

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

TableJSON Schema
NameRequiredDescriptionDefault
pivaYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
pivaYes
validYes
reasonYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.2

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses the two validation phases (format + checksum), the offline/no-network behavior, and the exact shape of the result including the failure `reason` field. Minor gaps remain (e.g., error/exception behavior is unspecified), but the safety-relevant profile is covered.

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?

The one-line purpose is front-loaded before the Args/Returns blocks, and every sentence carries information. The docstring-style Args/Returns formatting is somewhat verbose for a single-parameter tool but not wasteful.

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?

For a one-parameter, deterministic, offline validator, the description covers purpose, mechanism, input normalization rules, and output semantics; an output schema also exists. Nothing needed for correct invocation is missing.

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

Parameters5/5

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

Schema coverage is 0% and the bare `piva: string` schema says nothing, so the description must compensate — and it does, spelling out that the 'IT' prefix may be present or omitted and that 11 digits are expected after stripping prefix and whitespace. It even documents the optional `ctx` parameter that is absent from the input schema.

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

Purpose4/5

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

States a specific verb+resource ('Validate an Italian VAT number') and adds the distinguishing mechanism (official MEF checksum, fully local computation), which separates it from the network-based verify_piva_vies sibling. It stops short of naming the sibling explicitly, so it is clear but not maximally differentiated.

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

Usage Guidelines3/5

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

'No network call — fully local computation' implies this is the offline/format-check path as opposed to a VIES lookup, which is genuine usage signal. However, it never states when to prefer this tool over verify_piva_vies or the other siblings, nor any exclusion conditions.

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