Step 4 of 4 · Learn to buildHow-to guide
LearnDo it with open toolsCheck a VAT number from an agent
Check a VAT number from an agent
An agent has a counterparty's VAT number and must confirm it is valid before applying the reverse charge.
A route to listed tools, not a lesson, and not tax advice: a person decides.
Open it
- python-stdnumParse and validate VAT, TIN and company numbers for dozens of countries.
- VATcomplyRust API server for VAT number validation, ECB exchange rates, VAT rates and IP geolocation.
- valvatRuby gem that validates EU and UK VAT numbers, standalone or as an ActiveModel validator.
- vies-mcp-serverMCP server that validates EU VAT numbers through the VIES service.Inactive since 2025
The steps, at a high level
- Check the syntax and checksum first, offline: python-stdnum validates and reformats VAT and company numbers for dozens of countries, with no network call.
- Then ask VIES: vatcomply is a self-hosted API that validates the number against VIES and returns JSON; valvat does the same from Ruby and can return the registered name and address.
- Give the agent the lookup as a tool: an MCP server for VIES exists (vies-mcp-server, last commit 2025), or wrap the API in a tool of your own and keep the answer, the timestamp and the consultation number as evidence.
Check before you rely on it
- VIES answers only for EU numbers; a UK number needs HMRC's API, and valvat's UK lookup needs HMRC Developer Hub credentials.
- VIES is sometimes down or rate-limited; a valid number is a fact about registration, not about the customer's status as a taxable person.
- Whether the reverse charge applies is a person's decision; the lookup is the evidence it rests on.
Where these tools sit on the map
- Indirect taxCompany tax department › Indirect Tax / VAT / GST
- Taxpayer register & identifiersTax authority › Registration