Skip to main content
Glama

Validate a company identifier (no network call)

validate_company_id
Read-onlyIdempotent

Checks whether a company ID is well-formed for Norway or the UK without a network call. Returns valid/invalid with a reason and hint to pre-validate before a registry lookup.

Instructions

Check whether a national company identifier is well-formed — no network call.

country="NO" checksum-checks a Norwegian organisasjonsnummer (orgnr, org.nr) for Brønnøysundregistrene / Enhetsregisteret (brreg); this is the cheap norway company lookup pre-check for the norwegian business registry. country="GB" shape-checks and normalises a UK company number (company registration number, CRN) for Companies House: it zero-pads a short number ('445790' → '00445790') and upper-cases a prefix ('oc303675' → 'OC303675'). A CRN has no check digit, so a GB valid: true means the shape is right and nothing more.

Use it on user input or a spreadsheet column before spending a real lookup_company call, since it is instant and free.

Returns a ValidationResult and never raises for a malformed identifier: valid: false comes with reason (what failed) and hint (what to do next) rather than a tool error — this tool answers a question, it does not fail on bad input (DECISIONS.md D-010). A valid identifier does not mean the entity exists; follow it with lookup_company if you need facts.

The only real error here is unsupported_country (no module for that country yet — call list_countries), raised with the error text {"error": {"code", "message", "hint"}}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe company's national identifier. Norway (country='NO'): a nine-digit organisasjonsnummer (orgnr), e.g. '923609016'; spaces, dots and a 'NO...MVA' VAT suffix are accepted and normalised. United Kingdom (country='GB'): a Companies House company number (CRN), eight characters, e.g. '00445790' or 'OC303675'; a short number is zero-padded for you.
countryNoISO-3166-1 alpha-2 country code. 'NO' = Norway (Brønnøysundregistrene / Enhetsregisteret), 'GB' = United Kingdom (Companies House). 'UK' is not a country code here and is rejected. Call list_countries for the current set rather than hard-coding one.NO

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
hintNoWhat to do next when `valid` is false — the same hint the invalid_id error carries. None when valid: the next call is simply lookup.
inputYesThe identifier exactly as the caller supplied it.
validYesTrue when the identifier passes this country's format and checksum.
reasonNoOne English sentence saying why it is valid, or what failed.
countryYesISO-3166-1 alpha-2, upper-case.
registryYesRegistry slug, e.g. 'brreg'.
formattedNoThe identifier as a local would write it, e.g. '923 609 016'. None when invalid.
id_schemeNoName of the identifier scheme, e.g. 'organisasjonsnummer'.
normalizedNoCanonical form to pass to lookup, e.g. '923609016'. None when invalid.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the annotations (readOnly, idempotent, non-destructive), the description discloses meaningful behavior: no network call, checksum validation for Norway vs shape-only validation for the UK, normalisation rules, the guarantee that it never raises for malformed identifiers, and the unsupported_country error contract. No contradiction with annotations exists.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is structured logically: purpose first, then per-country behavior, then usage recommendation, then return/error behavior. It is a bit verbose in places — such as repeating the 'cheap' idea — but every major sentence contributes useful operational detail.

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?

For a validation-only tool with an output schema, the description covers all necessary operational aspects: what it validates, how each supported country behaves, the error contract, and when to use it versus lookup_company. Nothing an agent needs to invoke it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema already describes both parameters well (100% coverage), so the baseline is 3. The description adds extra semantic value by explaining the validation algorithms, the zero-padding and upper-casing behavior, and the meaning of a GB valid:true. This goes beyond what the schema provides, though not a huge margin.

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 opens with a specific verb and resource: 'Check whether a national company identifier is well-formed — no network call.' It clearly separates this from lookup_company by framing it as a cheap pre-check, and from search_company by focusing on validation rather than search. The scope is unambiguous.

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?

It explicitly tells the agent when to use it: 'Use it on user input or a spreadsheet column before spending a real lookup_company call, since it is instant and free.' It also routes unsupported countries to list_countries. This gives clear contextual guidance for choosing the tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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/foretak/registry-mcp'

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