Skip to main content
Glama

Gerar GNRE

gnre_emitir
Destructive

Gera a GNRE (guia de ICMS para outra UF, ex.: DIFAL ou ICMS-ST de uma NF-e) no Portal GNRE. O portal processa em segundo plano: o retorno vem com status 3 e o resultado sai em gnre_consultar. Consulte gnre_configuracao antes para saber os campos que a UF exige. Requer serviço GNRE habilitado no cadastro.

Input Schema

NameRequiredDescriptionDefault
ItensNoItens da guia (até 100). Um item = GNRE simples; vários itens da mesma receita = múltiplos documentos de origem; receitas diferentes = múltiplas receitas.
TipoAmbienteNo1 - Produção; 2 - Homologação (guia de teste, não deve ser paga)
UfFavorecidaNoSigla da UF favorecida (destino do recolhimento).
DataPagamentoNoData prevista de pagamento. Não pode ser anterior a hoje nem posterior ao vencimento.
IdentificadorInternoNoCódigo de controle do seu sistema. Com a verificação do identificador interno ligada, não aceita repetir o de uma guia gerada.

Output Schema

NameRequiredDescriptionDefault
IdNo
ValorNo
errosNoLista de erros quando a operação falha. Vazia em caso de sucesso. Cada item traz codigo, descricao e correcao.
avisosNoAvisos não bloqueantes. Pode vir preenchida mesmo em sucesso.
statusNoStatus do resultado da operação: 1 = sucesso; 2 = erro (a lista erros é preenchida).
SituacaoNo
Base64PdfNoPDF oficial gerado pelo Portal GNRE.
NossoNumeroNo
CodigoBarrasNo
NumeroReciboNo
TipoAmbienteNo
UfFavorecidaNo
PixCopiaEColaNoPIX copia e cola, quando a UF e a receita aceitam pagamento via PIX.
DataVencimentoNoData/hora ISO 8601 (ex: 2026-07-22T13:45:00-03:00)
LinhaDigitavelNo
NumeroControleNo
DataLimitePagamentoNoÚltimo dia em que o banco recebe a guia.
IdentificadorInternoNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare destructive and open-world, but the description adds the key non-obvious trait: the portal processes asynchronously and returns status 3, with the outcome retrieved via gnre_consultar. It also names the service-enablement prerequisite. It stops short of describing failure modes or what an actual emitted guide commits the taxpayer to, so not a 5.

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?

Four short sentences with no filler, front-loaded with what the tool creates before moving to the async behavior and prerequisites. Slightly dense but every clause carries operative information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present the description needn't explain return values, yet it still clarifies that the immediate return is an async status and the real result lives in gnre_consultar — exactly the gap an agent would hit. Preconditions and the config prerequisite are covered; only error/duplicate handling is left implicit.

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 documented parameters already carry their own meaning (Receita codes, Periodo enum, DataVencimento ISO format). The description only adds that the emitente is always the token's company and points to gnre_configuracao for UF-specific fields — useful but marginal beyond the rich schema.

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 first sentence states a specific verb and resource ('Gera a GNRE') and immediately scopes it to ICMS for another UF (DIFAL, ICMS-ST de uma NF-e), which distinguishes it from gnre_consultar and gnre_configuracao. An agent can identify this as the creation tool in the gnre_* family without opening the 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?

It gives explicit sequencing: check gnre_configuracao first to learn the UF's required fields, and read the result via gnre_consultar later. It also states a precondition ('Requer serviço GNRE habilitado no cadastro'), so the agent knows when the call will fail.

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.