Skip to main content
Glama

Consultar Inscrição Estadual (IE) na SEFAZ

cadastro_consultar
Read-onlyIdempotent

Consulta a Inscrição Estadual (IE) de um contribuinte na SEFAZ estadual (mundo NF-e/ICMS), por CNPJ/CPF/IE + UF. ATENÇÃO: muitas UFs NÃO oferecem este serviço (ex: RJ) e prestadores de serviço normalmente NÃO têm IE - nesses casos a IE não vem, e ISSO NÃO SIGNIFICA QUE O CNPJ ESTEJA INATIVO. Quando a SEFAZ não retorna e o documento é CNPJ, há fallback automático na Receita Federal (campo 'fonte'='receita') trazendo razão social, situação cadastral e endereço - sempre leia o campo 'mensagem'. Para apenas saber se um CNPJ está ativo ou pegar seus dados cadastrais (sem precisar da IE), prefira cliente_consultar.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ufNoUF do CPF, CNPJ, IE
cpfCnpjIeNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
ieNo
fonteNoFonte dos dados: "sefaz" (Inscrição Estadual da SEFAZ estadual), "receita" (fallback na Receita Federal quando a UF não oferece a consulta ou o contribuinte não tem IE - comum em prestadores de serviço) ou "indisponivel".
statusNoStatus Consulta Valores: 0 - Não Encontrada;; 1 - Encontrada;
ContatoNo
cpfCnpjNo
ieAtualNo
ieUnicaNo
EnderecoNo
mensagemNoMensagem explicativa do resultado: por que a IE não veio, qual fonte foi usada, e o aviso de que vazio NÃO significa CNPJ inativo. Fica vazio quando a SEFAZ retornou a Inscrição Estadual normalmente.
situacaoNoSituação do contribuinte: 0 - não habilitado; 1 - habilitado.
razaoSocialNo
nomeFantasiaNo
ufConsultadaNo
cnaePrincipalNo
regimeApuracaoNo
dataInicioAtividadeNoData/hora ISO 8601 (ex: 2026-07-22T13:45:00-03:00)
dataOcorrenciaBaixaNoData/hora ISO 8601 (ex: 2026-07-22T13:45:00-03:00)
indicadorCredenciamentoCTeNoIndicador de contribuinte credenciado a emitir CT-e. Valores: 0 - Não credenciado para emissão da CT-e;; 1 - Credenciado;; 2 - Credenciado com obrigatoriedade para todas operações;; 3 - Credenciado com obrigatoriedade parcial;; 4 - a SEFAZ não fornece a informação. Este indicador significa apenas que o contribuinte é credenciado para emitir CT-e na SEFAZ consultada.
indicadorCredenciamentoNFeNoIndicador de contribuinte credenciado a emitir NF-e. Valores: 0 - Não credenciado para emissão da NF-e;; 1 - Credenciado;; 2 - Credenciado com obrigatoriedade para todas operações;; 3 - Credenciado com obrigatoriedade parcial;; 4 - a SEFAZ não fornece a informação. Este indicador significa apenas que o contribuinte é credenciado para emitir NF-e na SEFAZ consultada.
dataUltimaAlteracaoCadastralNoData/hora ISO 8601 (ex: 2026-07-22T13:45:00-03:00)

TDQS

A4.6/5.0
Behavior5/5

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

Adds significant context beyond annotations: notes that missing IE does not mean CNPJ is inactive, describes fallback to Receita Federal for CNPJ, and instructs to read the `mensagem` field. No contradiction with annotations.

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?

Front-loaded with purpose and includes essential warnings and fallback info, but slightly verbose due to multiple caveats. Each sentence adds value.

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?

Covers edge cases (UF unavailability, service providers), fallback mechanism, and expected behavior given the output schema. Adequate for the tool's complexity.

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 50% (only `uf` described). Description mentions the combination of CPF/CNPJ/IE and UF but does not detail parameter format or requiredness, only partially compensating for the missing schema descriptions.

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?

Clearly states it consults the state registration (IE) for a taxpayer via CNPJ/CPF/IE + UF, distinguishing from sibling `cliente_consultar` which is for basic cadastral data.

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?

Explicitly warns that many UFs do not offer the service (e.g., RJ) and that service providers typically lack IE. Advises using `cliente_consultar` if only checking active status, and describes fallback behavior for CNPJ.

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.

TDQS

A3.6/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose, with thorough descriptions that clarify overlaps (e.g., cliente_consultar vs cadastro_consultar). Even similar operations like arquivo_baixar variants have explicit scope differences.

Naming Consistency4/5

Most tools follow a noun_verb pattern (e.g., cliente_consultar, evento_cancelar, produto_criar), but a few deviate (e.g., 'health', 'cte_desacordo'). Overall consistent enough for easy recognition.

Tool Count4/5

34 tools is high but justified given the complexity of fiscal document management across multiple document types (NF-e, NFS-e, CT-e, MDF-e, etc.) and required CRUD, events, and auxiliary operations.

Completeness4/5

The tool set covers create/read/update/delete for clients, products, and tax rules, plus emission, cancellation, correction, and status checks for various documents. Minor gaps like dedicated NFS-e cancellation are handled by generic event tools.