Skip to main content
Glama
josemvelez78

mcp-europe-business

validate_codice_fiscale

Read-onlyIdempotent

Validate an Italian Codice Fiscale using the official odd/even position checksum algorithm to ensure compliance with Italian revenue agency standards.

Instructions

Validates an Italian Codice Fiscale (fiscal code) for individuals — a 16-character alphanumeric code issued by the Italian Revenue Agency (Agenzia delle Entrate). Applies the official odd/even position checksum algorithm. Returns { valid: boolean, codice_fiscale: string } or { valid: false, reason: string }. Use when processing Italian invoices, onboarding Italian individuals, or any Italian compliance workflow requiring a verified personal fiscal code.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codice_fiscaleYes16-character Italian Codice Fiscale. Example: 'RSSMRA85T10A562S'

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
validYes
codice_fiscaleNo
reasonNo

Implementation Reference

  • index.js:279-284 (registration)
    Registration of the 'validate_codice_fiscale' tool via server.registerTool(), including description, input/output schemas, and annotations.
    server.registerTool("validate_codice_fiscale", {
      description: "Validates an Italian Codice Fiscale (fiscal code) for individuals — a 16-character alphanumeric code issued by the Italian Revenue Agency (Agenzia delle Entrate). Applies the official odd/even position checksum algorithm. Returns { valid: boolean, codice_fiscale: string } or { valid: false, reason: string }. Use when processing Italian invoices, onboarding Italian individuals, or any Italian compliance workflow requiring a verified personal fiscal code.",
      inputSchema: { codice_fiscale: z.string().describe("16-character Italian Codice Fiscale. Example: 'RSSMRA85T10A562S'") },
      outputSchema: { valid: z.boolean(), codice_fiscale: z.string().optional(), reason: z.string().optional() },
          annotations: { title: "Validate Italian Codice Fiscale", readOnlyHint: true, idempotentHint: true, openWorldHint: false }
    }, async ({ codice_fiscale }) => {
  • Handler function for validate_codice_fiscale: validates a 16-character Italian Codice Fiscale by applying the official odd/even position checksum algorithm using character value lookup tables.
    }, async ({ codice_fiscale }) => {
      const clean = codice_fiscale.replace(/\s/g, "").toUpperCase();
      if (!/^[A-Z]{6}\d{2}[A-Z]\d{2}[A-Z]\d{3}[A-Z]$/.test(clean)) {
        return { content: [{ type: "text", text: JSON.stringify({ valid: false, reason: "Codice Fiscale must be 16 characters: 6 letters, 2 digits, 1 letter, 2 digits, 1 letter, 3 digits, 1 letter" }) }] };
      }
      const oddValues = { 0:1,1:0,2:5,3:7,4:9,5:13,6:15,7:17,8:19,9:21,A:1,B:0,C:5,D:7,E:9,F:13,G:15,H:17,I:19,J:21,K:2,L:4,M:18,N:20,O:11,P:3,Q:6,R:8,S:12,T:14,U:16,V:10,W:22,X:25,Y:24,Z:23 };
      const evenValues = { 0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:0,B:1,C:2,D:3,E:4,F:5,G:6,H:7,I:8,J:9,K:10,L:11,M:12,N:13,O:14,P:15,Q:16,R:17,S:18,T:19,U:20,V:21,W:22,X:23,Y:24,Z:25 };
      let sum = 0;
      for (let i = 0; i < 15; i++) {
        const char = clean[i];
        sum += (i % 2 === 0) ? oddValues[char] : evenValues[char];
      }
      const expectedCheck = String.fromCharCode(65 + (sum % 26));
      const valid = clean[15] === expectedCheck;
      return { content: [{ type: "text", text: JSON.stringify({ valid, codice_fiscale: clean }) }] };
    });
  • Input schema (zod) for validate_codice_fiscale: expects 'codice_fiscale' (string). Output schema includes 'valid' (boolean), 'codice_fiscale' (optional string), and 'reason' (optional string).
    inputSchema: { codice_fiscale: z.string().describe("16-character Italian Codice Fiscale. Example: 'RSSMRA85T10A562S'") },
    outputSchema: { valid: z.boolean(), codice_fiscale: z.string().optional(), reason: z.string().optional() },
  • Lookup tables for odd-position (oddValues) and even-position (evenValues) character values used in the Italian Codice Fiscale checksum algorithm.
    const oddValues = { 0:1,1:0,2:5,3:7,4:9,5:13,6:15,7:17,8:19,9:21,A:1,B:0,C:5,D:7,E:9,F:13,G:15,H:17,I:19,J:21,K:2,L:4,M:18,N:20,O:11,P:3,Q:6,R:8,S:12,T:14,U:16,V:10,W:22,X:25,Y:24,Z:23 };
    const evenValues = { 0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:0,B:1,C:2,D:3,E:4,F:5,G:6,H:7,I:8,J:9,K:10,L:11,M:12,N:13,O:14,P:15,Q:16,R:17,S:18,T:19,U:20,V:21,W:22,X:23,Y:24,Z:25 };
Behavior4/5

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

Annotations already indicate readOnlyHint and idempotentHint, and the description adds that it applies the odd/even checksum algorithm and returns a boolean with optional reason. This provides useful context beyond the annotations without contradicting them.

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 description is a single paragraph of four sentences, all relevant and front-loaded with purpose. It is concise but could be slightly more structured (e.g., bullet points). However, it avoids waste.

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 the simple 1-parameter schema, high annotation quality, and description of return format, the description is complete. It covers the country, algorithm, valid use cases, and output structure. No gaps remain for the agent.

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 coverage is 100%, with a clear description of the parameter (16-character code plus example). The tool description adds no further semantic information about the parameter beyond what the schema already provides, so a baseline score of 3 is appropriate.

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 Codice Fiscale, specifies it is a 16-character alphanumeric code for individuals, and mentions the official checksum algorithm. It distinguishes itself from sibling validation tools (e.g., validate_nif, validate_partita_iva) by focusing on Italian personal fiscal codes.

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 lists use cases: processing Italian invoices, onboarding Italian individuals, or Italian compliance workflows. It does not explicitly state when not to use or mention alternatives, but the sibling context implies other tools for different countries/entities.

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