Skip to main content
Glama

lookup_fiscal_code

Read-onlyIdempotent

Resolve one code of one classification, when you know both.

Use this to confirm a code before putting it on a document — an NCM that does not exist is rejected by the tax authority after issuing, which costs a cancellation.

A code that is not there answers 404. That means the code is wrong, not that the lookup failed; do not retry it.

metadata differs per kind and is passed through as published: utrib on an NCM, ncm_code on a CEST, tax_type on a CST, and nothing at all on an ISS service.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesThe code itself, as published: 84716052 for an NCM, 5102 for a CFOP. Digits only, no dots.
kindYescfop, ncm, cest, cst, csosn, ...
countryNoISO 3166-1 alpha-2 code. A code means nothing without it, and Brazil is the default rather than a guess.BR

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeNo
kindNocfop, ncm, cest, cst, csosn, ...
countryNo
metadataNoWhatever the classification carries beyond a code and a description, and it differs per kind: utrib on an NCM, ncm_code on a CEST, tax_type on a CST, null on an ISS service.
descriptionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.5/5.0
Behavior5/5

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

The description adds meaningful behavioral context beyond the annotations: 404 means invalid code, not a lookup failure, and metadata varies by kind with concrete examples. This disclosure helps the agent interpret responses correctly and avoid useless retries.

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

Conciseness5/5

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

The description is tightly organized: purpose first, then when to use, then failure semantics, then metadata variation. Every sentence adds distinct value with no redundancy or filler.

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 simple lookup tool with an output schema, the description covers the key operational details: use case, failure mode, retry guidance, and kind-dependent metadata. Nothing needed for correct invocation 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?

The input schema already covers all parameters clearly with 100% schema description coverage, including examples and validation constraints. The description adds useful context about metadata behavior, but does not need to repeat parameter details; baseline 3 is appropriate.

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 states a precise operation: resolve one code of one classification when both are known. It clearly distinguishes this from broader searching by emphasizing the single-code, confirmatory nature.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives a clear use case: confirm a code before putting it on a document to avoid rejected issuance. It also explains that a 404 means the code is wrong and should not be retried, though it does not explicitly name sibling alternatives like search_fiscal_codes.

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.