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

The steps, at a high level

  1. Check the syntax and checksum first, offline: python-stdnum validates and reformats VAT and company numbers for dozens of countries, with no network call.
  2. 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.
  3. 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

Back to step 1The mapWhere tax work happens and by whom: a tax department and a tax authority, team by team, with what is open for each activity.