Skip to main content
Glama
josemvelez78

mcp-europe-business

validate_vat_de

Read-onlyIdempotent

Validates German VAT identification numbers (USt-IdNr) by checking format and ISO 7064 checksum. Essential for processing invoices or validating suppliers in intra-EU transactions.

Instructions

Validates a German VAT identification number (Umsatzsteuer-Identifikationsnummer, USt-IdNr) — format 'DE' followed by 9 digits. Verifies the format and applies the official ISO 7064 MOD-11-10 checksum algorithm. Returns { valid: boolean, vat_number: string, country: 'DE' } or { valid: false, reason: string }. Use when processing German invoices, validating German suppliers for intra-EU transactions, or any B2B workflow involving German companies.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
vat_numberYesGerman VAT number with or without spaces. Example: 'DE123456789'

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
validYes
vat_numberNo
countryNo
reasonNo

Implementation Reference

  • The handler function for validate_vat_de tool. Applies the ISO 7064 MOD-11-10 checksum algorithm to validate German VAT numbers (USt-IdNr). Expects format 'DE' + 9 digits. Returns { valid, vat_number, country } or { valid: false, reason }.
    // ── 14. Validate German VAT (USt-IdNr) ──
    server.registerTool("validate_vat_de", {
      description: "Validates a German VAT identification number (Umsatzsteuer-Identifikationsnummer, USt-IdNr) — format 'DE' followed by 9 digits. Verifies the format and applies the official ISO 7064 MOD-11-10 checksum algorithm. Returns { valid: boolean, vat_number: string, country: 'DE' } or { valid: false, reason: string }. Use when processing German invoices, validating German suppliers for intra-EU transactions, or any B2B workflow involving German companies.",
      inputSchema: { vat_number: z.string().describe("German VAT number with or without spaces. Example: 'DE123456789'") },
      outputSchema: { valid: z.boolean(), vat_number: z.string().optional(), country: z.string().optional(), reason: z.string().optional() },
          annotations: { title: "Validate German VAT Number", readOnlyHint: true, idempotentHint: true, openWorldHint: false }
    }, async ({ vat_number }) => {
      const clean = vat_number.replace(/\s/g, "").toUpperCase();
      if (!/^DE\d{9}$/.test(clean)) return { content: [{ type: "text", text: JSON.stringify({ valid: false, reason: "German VAT must start with DE followed by exactly 9 digits. Example: DE123456789" }) }] };
      const digits = clean.substring(2);
      let product = 10;
      for (let i = 0; i < 8; i++) {
        let sum = (parseInt(digits[i]) + product) % 10;
        if (sum === 0) sum = 10;
        product = (2 * sum) % 11;
      }
      const checkDigit = 11 - product === 10 ? 0 : 11 - product;
      const valid = checkDigit === parseInt(digits[8]);
      return { content: [{ type: "text", text: JSON.stringify({ valid, vat_number: clean, country: "DE" }) }] };
    });
  • Input and output schema definitions for validate_vat_de. Input expects 'vat_number' (string), output includes valid (boolean), vat_number (optional string), country (optional string), reason (optional string).
    server.registerTool("validate_vat_de", {
      description: "Validates a German VAT identification number (Umsatzsteuer-Identifikationsnummer, USt-IdNr) — format 'DE' followed by 9 digits. Verifies the format and applies the official ISO 7064 MOD-11-10 checksum algorithm. Returns { valid: boolean, vat_number: string, country: 'DE' } or { valid: false, reason: string }. Use when processing German invoices, validating German suppliers for intra-EU transactions, or any B2B workflow involving German companies.",
      inputSchema: { vat_number: z.string().describe("German VAT number with or without spaces. Example: 'DE123456789'") },
      outputSchema: { valid: z.boolean(), vat_number: z.string().optional(), country: z.string().optional(), reason: z.string().optional() },
          annotations: { title: "Validate German VAT Number", readOnlyHint: true, idempotentHint: true, openWorldHint: false }
    }, async ({ vat_number }) => {
  • index.js:321-321 (registration)
    Registration of the validate_vat_de tool via server.registerTool, with description stating it validates German USt-IdNr using ISO 7064 MOD-11-10 checksum.
    server.registerTool("validate_vat_de", {
Behavior5/5

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

Annotations already indicate readOnly and idempotent. Description adds the validation algorithm (ISO 7064 MOD-11-10) and return shape. No contradictions.

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?

Concise, well-structured, front-loaded with purpose and format. Each sentence adds value without redundancy.

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?

Fully covers the tool's behavior, input, and output. No missing aspects for a single-parameter validation tool.

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 100%, but description adds semantic details: format explanation, allowance of spaces, and link to official algorithm. Enhances understanding beyond 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 it validates a German VAT number, specifies the format 'DE' followed by 9 digits, and mentions the checksum algorithm. It differentiates from sibling validation tools by being country-specific.

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

Usage Guidelines5/5

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

Explicitly provides use cases: processing German invoices, validating German suppliers for intra-EU transactions, and B2B workflows involving German companies. No exclusion mentioned, but clear context given.

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