Skip to main content
Glama

lookup_taxpayer

Read-onlyIdempotent

Look up one taxpayer by exact tax id, to confirm who it is.

Use it to check a recipient's name before issuing against them. It takes the id exactly — punctuation is fine, but there is no search by name, by prefix or by state, and there will not be: the registry holds the names and addresses of real people.

A 404 does not mean the company does not exist. The registry reloads monthly from the RFB's dump, so a recently registered CNPJ is simply not in it yet. Say that to the user rather than reporting the tax id as invalid, and never turn a 404 here into a validation rule.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "tax_id": "<tax_id>"
    },
    "name": "lookup_taxpayer"
  }
}

Input Schema

NameRequiredDescriptionDefault
tax_idYesThe exact tax id. A CNPJ is 14 characters and may carry letters in its first 12 since July 2026 (e.g. 12ABC34501DE35); a CPF is 11 digits. Punctuation is fine.
countryNoISO 3166-1 alpha-2 code. A code means nothing without it, and Brazil is the default rather than a guess.BR

Output Schema

NameRequiredDescriptionDefault
kindNoWhether it is a company or a person.
nameNo
stateNo
statusNo
tax_idNo
countryNo
metadataNoWhatever the registry holds beyond these.
city_codeNo
started_atNo
trade_nameNo
postal_codeNo
activity_codeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / tax_id / description
      Previous value: -"The exact tax id. A CNPJ is 14 digits."New value: +"The exact tax id. A CNPJ is 14 characters and may carry letters in its first 12 since July 2026 (e.g. 12ABC34501DE35); a CPF is 11 digits. Punctuation is fine."
  2. Changed16 schema fields changed
    • removedInput schema / properties / country / title
      Removed value: -"Country"
    • removedInput schema / properties / tax_id / title
      Removed value: -"Tax Id"
    • removedInput schema / title
      Removed value: -"lookup_taxpayerArguments"
    • removedOutput schema / properties / activity_code / title
      Removed value: -"Activity Code"
    • removedOutput schema / properties / city_code / title
      Removed value: -"City Code"
    • removedOutput schema / properties / country / title
      Removed value: -"Country"
    • removedOutput schema / properties / kind / title
      Removed value: -"Kind"
    • removedOutput schema / properties / metadata / title
      Removed value: -"Metadata"
    • removedOutput schema / properties / name / title
      Removed value: -"Name"
    • removedOutput schema / properties / postal_code / title
      Removed value: -"Postal Code"
    • removedOutput schema / properties / started_at / title
      Removed value: -"Started At"
    • removedOutput schema / properties / state / title
      Removed value: -"State"
    • removedOutput schema / properties / status / title
      Removed value: -"Status"
    • removedOutput schema / properties / tax_id / title
      Removed value: -"Tax Id"
    • removedOutput schema / properties / trade_name / title
      Removed value: -"Trade Name"
    • removedOutput schema / title
      Removed value: -"TaxpayerResult"
  3. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare this a read-only, idempotent, non-destructive, closed-world lookup, and the description still adds substantial behavior beyond them: the 404 meaning, the monthly reload from the RFB dump, the staleness window for recently registered CNPJs, and the instruction not to convert a 404 into a validation rule. That is exactly the failure-mode context annotations cannot express.

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?

Well front-loaded: purpose first, then usage, then the operational caveat about 404s and registry reloads. Most sentences carry real information, though the 'and there will not be' construction and the privacy rationale run slightly longer than needed for the point they make.

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?

With a 100%-covered two-parameter schema, full annotations, and an output schema, the remaining burden is interpretation of results and misuse prevention — both handled by the 404 guidance and the no-search exclusion. Nothing an agent needs in order to call this correctly or explain its outcome is missing.

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%, so both parameters are already documented, and the description's 'punctuation is fine' and exactness emphasis restate what the tax_id schema says. The country parameter is not mentioned at all, so no meaning is added beyond the structured fields — baseline 3 applies.

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?

States a specific verb and resource — 'look up one taxpayer by exact tax id' — and immediately fixes the scope ('one', 'exact') plus its intent ('to confirm who it is'). It distinguishes itself from name/prefix/state searching in the same breath, so an agent can tell it apart from any lookup-style sibling without opening a schema.

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?

Gives an explicit when-to-use ('check a recipient's name before issuing against them') and explicit when-not-to-use ('no search by name, by prefix or by state'), with the reason those alternatives are absent. It also prescribes the right user-facing behavior on failure, which is the main ambiguity an agent would otherwise guess at.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.