Skip to main content
Glama
Jazib-but

VAT Validation MCP Server

by Jazib-but

check_vat_number

Validate EU VAT numbers through the official VIES service to verify tax compliance and retrieve company information for all 27 EU member states.

Instructions

Validate EU VAT number using VIES service / Overiť IČ DPH v EÚ pomocou služby VIES

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
countryCodeYesEU member state code (e.g., SK, CZ, DE) / Kód členského štátu EÚ
vatNumberYesVAT number without country prefix / IČ DPH bez predpony krajiny

Implementation Reference

  • MCP tool execution handler for 'check_vat_number': parses arguments using checkVatNumberSchema, delegates to ViesApiClient.checkVatNumber(), formats the result into a text response.
    case 'check_vat_number': {
      const params = checkVatNumberSchema.parse(args);
      const result = await this.viesClient.checkVatNumber(params);
      
      const responseText = this.formatVatValidationResult(result);
      
      return {
        content: [
          {
            type: 'text',
            text: responseText,
          },
        ],
      };
    }
  • src/index.ts:36-55 (registration)
    Registration of the 'check_vat_number' tool in the ListTools response, defining name, description, and input schema matching the Zod schema.
      name: 'check_vat_number',
      description: 'Validate EU VAT number using VIES service / Overiť IČ DPH v EÚ pomocou služby VIES',
      inputSchema: {
        type: 'object',
        properties: {
          countryCode: {
            type: 'string',
            enum: [...EU_MEMBER_STATES],
            description: 'EU member state code (e.g., SK, CZ, DE) / Kód členského štátu EÚ',
          },
          vatNumber: {
            type: 'string',
            description: 'VAT number without country prefix / IČ DPH bez predpony krajiny',
            minLength: 1,
            maxLength: 20,
          },
        },
        required: ['countryCode', 'vatNumber'],
      },
    },
  • Zod input schema for 'check_vat_number' tool: validates countryCode against EU_MEMBER_STATES enum and vatNumber as non-empty string up to 20 chars.
    export const checkVatNumberSchema = z.object({
      countryCode: z.enum(EU_MEMBER_STATES, {
        errorMap: () => ({ message: 'Invalid EU member state code' })
      }),
      vatNumber: z.string().min(1, 'VAT number is required').max(20, 'VAT number too long'),
    });
  • Core implementation in ViesApiClient: POST request to VIES /check-vat-number endpoint, Zod validation of response, mapping to VatNumberInfo with preprocessing handling and error management.
    async checkVatNumber(params: CheckVatNumberParams): Promise<VatNumberInfo> {
      try {
        const response = await this.client.post('/check-vat-number', {
          countryCode: params.countryCode,
          vatNumber: params.vatNumber,
        });
    
        const validatedData = vatValidationResponseSchema.parse(response.data);
    
        return {
          countryCode: validatedData.countryCode || params.countryCode,
          vatNumber: validatedData.vatNumber || params.vatNumber,
          isValid: validatedData.valid,
          companyName: validatedData.name,
          companyAddress: validatedData.address,
          requestDate: validatedData.requestDate,
          wasPreprocessed: validatedData.originalVatNumber !== undefined,
          originalVatNumber: validatedData.originalVatNumber,
          originalCountryCode: validatedData.originalCountryCode,
        };
      } catch (error) {
        if (error instanceof ViesApiError) {
          // Try to parse error response
          try {
            const errorData = errorResponseSchema.parse(error.response);
            throw new Error(`VIES validation failed: ${errorData.error}${errorData.message ? ` - ${errorData.message}` : ''}`);
          } catch {
            throw error;
          }
        }
        throw error;
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions the VIES service but does not disclose behavioral traits like rate limits, authentication needs, response format, error handling, or whether this is a read-only operation. The description adds minimal context beyond the basic purpose.

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 extremely concise with a single bilingual sentence that efficiently conveys the tool's purpose. Every word earns its place, and it is front-loaded with the core functionality. No unnecessary details or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description is minimal but adequate for a simple validation tool. It covers the purpose and service used, but lacks details on behavior, response format, or error handling. For a tool with 2 parameters and 100% schema coverage, it meets minimum viability but has clear gaps in transparency.

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 description coverage is 100%, with clear descriptions for both parameters (countryCode and vatNumber). The description does not add meaning beyond what the schema provides, such as explaining VAT number formats or validation rules. Baseline 3 is appropriate since the schema does the heavy lifting.

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 specific action ('Validate EU VAT number') and the resource/service used ('using VIES service'), with a Slovak translation reinforcing the purpose. It distinguishes from siblings by focusing on validation rather than testing service status or listing member states.

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 implies usage context for validating EU VAT numbers via VIES, but does not explicitly state when to use this tool versus alternatives like 'check_vat_test_service' or 'check_vies_status'. It provides clear scope (EU VAT validation) without exclusions or prerequisites.

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/Jazib-but/check-vat-vies-mcp-Jazib'

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