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)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed36 schema fields changed
    • changedInput schema / properties / cpfCnpjIe / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedInput schema / properties / uf / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / Contato / properties / Email / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / Contato / properties / Fax / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / Contato / properties / Telefone / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / Contato / type
      Previous value: -"object"New value: +[
      +  "object",
      +  "null"
      +]
    • changedOutput schema / properties / Endereco / properties / Bairro / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / Endereco / properties / Cep / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / Endereco / properties / CodMunicipio / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / Endereco / properties / Complemento / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / Endereco / properties / Logradouro / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / Endereco / properties / Municipio / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / Endereco / properties / Numero / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / Endereco / properties / Pais / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / Endereco / properties / Uf / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / Endereco / type
      Previous value: -"object"New value: +[
      +  "object",
      +  "null"
      +]
    • changedOutput schema / properties / cnaePrincipal / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / cpfCnpj / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • addedOutput schema / properties / dataInicioAtividade / description
      Added value: +"Data/hora ISO 8601 (ex: 2026-07-22T13:45:00-03:00)"
    • removedOutput schema / properties / dataInicioAtividade / format
      Removed value: -"date-time"
    • changedOutput schema / properties / dataInicioAtividade / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • addedOutput schema / properties / dataOcorrenciaBaixa / description
      Added value: +"Data/hora ISO 8601 (ex: 2026-07-22T13:45:00-03:00)"
    • removedOutput schema / properties / dataOcorrenciaBaixa / format
      Removed value: -"date-time"
    • changedOutput schema / properties / dataOcorrenciaBaixa / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • addedOutput schema / properties / dataUltimaAlteracaoCadastral / description
      Added value: +"Data/hora ISO 8601 (ex: 2026-07-22T13:45:00-03:00)"
    • removedOutput schema / properties / dataUltimaAlteracaoCadastral / format
      Removed value: -"date-time"
    • changedOutput schema / properties / dataUltimaAlteracaoCadastral / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / fonte / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / ie / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / ieAtual / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / ieUnica / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / mensagem / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / nomeFantasia / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / razaoSocial / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / regimeApuracao / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / ufConsultada / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already cover the safe-read profile (readOnly, idempotent, openWorld, non-destructive), and the description layers on the traits that matter: absent IE does not imply an inactive CNPJ, automatic Receita Federal fallback for CNPJs with the 'fonte'='receita' marker, and an instruction to always read 'mensagem'. This is behavioral disclosure well beyond the 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 the core action, then caveats and the fallback rule. Dense and largely waste-free, though the capitalized warnings make it longer than a minimal summary and could be trimmed slightly.

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?

An output schema exists so return values need no explanation, and the description still covers the interpretive traps (missing IE != inactive CNPJ, fallback source, 'mensagem' field). Given the open-world external dependency, this is complete enough for an agent to call and interpret results correctly.

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?

Schema coverage is 50% and the 'cpfCnpjIe' property has no schema description, but the description compensates by stating the accepted identifier types (CNPJ/CPF/IE) and pairing them with UF. It adds real meaning over the bare schema, though it doesn't spell out format expectations.

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+resource ('Consulta a Inscrição Estadual (IE) ... na SEFAZ estadual'), scopes it to the NF-e/ICMS domain, and names the input keys (CNPJ/CPF/IE + UF). It also distinguishes itself from cliente_consultar, so an agent can route between them without opening schemas.

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 names the alternative ('Para apenas saber se um CNPJ está ativo ... prefira cliente_consultar') and the condition that selects it. It also warns when the tool will not yield a useful IE (UFs without the service, service providers), which is exactly the when/when-not guidance an agent needs.

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.