Skip to main content
Glama
josemvelez78

mcp-europe-business

validate_partita_iva

Read-onlyIdempotent

Validates Italian Partita IVA numbers using the official checksum algorithm. Use for B2B invoices, supplier validation, and compliance.

Instructions

Validates an Italian Partita IVA (VAT number for companies and self-employed) — an 11-digit number issued by the Italian Revenue Agency. Applies the official Luhn-variant checksum algorithm used by Italian tax authorities. Returns { valid: boolean, partita_iva: string } or { valid: false, reason: string }. Use when processing Italian B2B invoices, validating Italian suppliers, or any Italian business compliance workflow.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
partita_ivaYes11-digit Italian Partita IVA, with or without spaces. Example: '12345670017'

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
validYes
partita_ivaNo
reasonNo

Implementation Reference

  • index.js:301-318 (registration)
    The tool 'validate_partita_iva' is registered via server.registerTool() with its description, input/output schemas, and handler. The registration includes the Italian Partita IVA description, input schema (11-digit string), output schema (valid boolean, partita_iva string optional, reason string optional), and annotations.
    // ── 13. Validate Italian Partita IVA ──
    server.registerTool("validate_partita_iva", {
      description: "Validates an Italian Partita IVA (VAT number for companies and self-employed) — an 11-digit number issued by the Italian Revenue Agency. Applies the official Luhn-variant checksum algorithm used by Italian tax authorities. Returns { valid: boolean, partita_iva: string } or { valid: false, reason: string }. Use when processing Italian B2B invoices, validating Italian suppliers, or any Italian business compliance workflow.",
      inputSchema: { partita_iva: z.string().describe("11-digit Italian Partita IVA, with or without spaces. Example: '12345670017'") },
      outputSchema: { valid: z.boolean(), partita_iva: z.string().optional(), reason: z.string().optional() },
          annotations: { title: "Validate Italian Partita IVA", readOnlyHint: true, idempotentHint: true, openWorldHint: false }
    }, async ({ partita_iva }) => {
      const clean = partita_iva.replace(/\s/g, "");
      if (!/^\d{11}$/.test(clean)) return { content: [{ type: "text", text: JSON.stringify({ valid: false, reason: "Partita IVA must have exactly 11 digits" }) }] };
      let sum = 0;
      for (let i = 0; i < 10; i++) {
        let digit = parseInt(clean[i]);
        if (i % 2 === 1) { digit *= 2; if (digit > 9) digit -= 9; }
        sum += digit;
      }
      const valid = (10 - (sum % 10)) % 10 === parseInt(clean[10]);
      return { content: [{ type: "text", text: JSON.stringify({ valid, partita_iva: clean }) }] };
    });
  • The handler function for validate_partita_iva. It cleans whitespace, checks for exactly 11 digits, applies the Luhn-variant checksum algorithm (doubling odd-positioned digits, summing, and validating the check digit at position 10), and returns {valid, partita_iva} or {valid: false, reason}.
    }, async ({ partita_iva }) => {
      const clean = partita_iva.replace(/\s/g, "");
      if (!/^\d{11}$/.test(clean)) return { content: [{ type: "text", text: JSON.stringify({ valid: false, reason: "Partita IVA must have exactly 11 digits" }) }] };
      let sum = 0;
      for (let i = 0; i < 10; i++) {
        let digit = parseInt(clean[i]);
        if (i % 2 === 1) { digit *= 2; if (digit > 9) digit -= 9; }
        sum += digit;
      }
      const valid = (10 - (sum % 10)) % 10 === parseInt(clean[10]);
      return { content: [{ type: "text", text: JSON.stringify({ valid, partita_iva: clean }) }] };
    });
Behavior4/5

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

Annotations already provide readOnlyHint=true and idempotentHint=true, indicating safety. The description adds value by detailing the return format ({ valid: boolean, partita_iva: string } or { valid: false, reason: string }) and the checksum algorithm used. No contradictions with annotations.

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

Conciseness5/5

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

The description is three sentences, front-loaded with the core purpose, and contains no redundant information. Every sentence contributes meaning (purpose, algorithm, return types, use cases). Ideal length for this simple tool.

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?

Given one parameter with full schema coverage and an output schema (indicated by context signals), the description covers input format, algorithm, return shape, and use cases. It is fully sufficient for an agent to understand and invoke the tool correctly.

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?

The input schema has 100% coverage, describing the parameter with an example and allowing spaces. The description does not significantly add new meaning beyond the schema; it reiterates the 11-digit nature but does not provide additional constraints or format details not already in the schema.

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?

The description clearly states the tool validates an Italian Partita IVA (VAT number), specifies it is an 11-digit number, and mentions the official Luhn-variant checksum algorithm. It effectively distinguishes itself from sibling tools that validate other country-specific identifiers (e.g., validate_vat_de, validate_tva_fr).

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

Usage Guidelines4/5

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

The description explicitly states when to use the tool: 'processing Italian B2B invoices, validating Italian suppliers, or any Italian business compliance workflow.' While it does not explicitly mention when not to use it or list alternatives, the context from sibling tools (all country-specific) makes the usage clear.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/josemvelez78/mcp-europe-business'

If you have feedback or need assistance with the MCP directory API, please join our Discord server