Skip to main content
Glama

check_vies_status

Check the operational status of the VIES service and verify which EU member states are currently available for real-time VAT number validation.

Instructions

Check VIES service status and member state availability / Skontrolovať stav služby VIES a dostupnosť členských štátov

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/index.ts:76-83 (registration)
    Registration of the 'check_vies_status' tool in the MCP server tool list, including its name, description, and empty input schema.
    { name: 'check_vies_status', description: 'Check VIES service status and member state availability / Skontrolovať stav služby VIES a dostupnosť členských štátov', inputSchema: { type: 'object', properties: {}, }, },
  • MCP tool handler case for 'check_vies_status' that calls ViesApiClient.checkStatus() and formats the response using formatStatusResult.
    case 'check_vies_status': { const result = await this.viesClient.checkStatus(); const responseText = this.formatStatusResult(result); return { content: [ { type: 'text', text: responseText, }, ], }; }
  • Core implementation of checkStatus in ViesApiClient: makes GET request to VIES /check-status API, parses response with statusResponseSchema, handles errors, and returns ServiceStatus object.
    async checkStatus(): Promise<ServiceStatus> { try { const response = await this.client.get('/check-status'); const validatedData = statusResponseSchema.parse(response.data); return { isAvailable: validatedData.availabilityStatus === 'AVAILABLE', memberStates: validatedData.memberStates.map(ms => ({ code: ms.memberStateCode, status: ms.availability, })), lastChecked: new Date().toISOString(), }; } catch (error) { if (error instanceof ViesApiError) { try { const errorData = errorResponseSchema.parse(error.response); throw new Error(`VIES status check failed: ${errorData.error}${errorData.message ? ` - ${errorData.message}` : ''}`); } catch { throw error; } } throw error; } }
  • Helper function to format the VIES status result into a human-readable text response with bilingual labels.
    private formatStatusResult(result: any): string { let response = `VIES Service Status / Stav služby VIES:\n\n`; response += `Overall Status / Celkový stav: ${result.isAvailable ? 'AVAILABLE / DOSTUPNÁ' : 'UNAVAILABLE / NEDOSTUPNÁ'}\n`; response += `Last Checked / Posledná kontrola: ${result.lastChecked}\n\n`; response += `Member States Status / Stav členských štátov:\n`; for (const ms of result.memberStates) { const statusText = ms.status === 'AVAILABLE' ? 'AVAILABLE / DOSTUPNÁ' : ms.status === 'UNAVAILABLE' ? 'UNAVAILABLE / NEDOSTUPNÁ' : 'TIMEOUT / ČASOVÝ LIMIT'; response += `${ms.code}: ${statusText}\n`; } return response; }
  • Zod schema for parsing the VIES status API response, used in checkStatus() for validation.
    export const statusResponseSchema = z.object({ availabilityStatus: z.enum(['AVAILABLE', 'UNAVAILABLE']), memberStates: z.array(memberStateStatusSchema), });

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