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.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "gnre_emitir"
  }
}

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
NumeroReciboNoRecibo do lote no Portal GNRE; vem vazio enquanto o portal ainda não recebeu o lote.
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. Changed2 schema fields changed
    • changedOutput schema / description
      Previous value: -"status: 1 - Guia gerada; 2 - Rejeitada (ver erros); 3 - Processando no Portal GNRE (consulte com ConsultarGnre em alguns segundos)."New value: +"status: 1 - Guia gerada; 2 - Rejeitada (ver erros); 3 - Processando no Portal GNRE (consulte com ConsultarGnre em cerca de 1 minuto ou aguarde o webhook gnre.processada)."
    • addedOutput schema / properties / NumeroRecibo / description
      Added value: +"Recibo do lote no Portal GNRE; vem vazio enquanto o portal ainda não recebeu o lote."
  2. Added

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already flag destructiveHint=true and openWorldHint=true, and the description usefully adds the non-obvious asynchronous behavior (return comes with status 3, actual result retrieved via gnre_consultar) plus the account-level prerequisite. What it does not spell out is that a successful emission creates a real payable tax obligation outside homologação, which is the main consequence of the destructive flag for a caller.

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?

Four short sentences, each carrying distinct load: what it is, how the async return works, what to consult first, and the enabling prerequisite. The purpose is front-loaded and there is no redundant or decorative wording.

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 complex, multi-item tax-guide emission with a large schema and an output schema, the description covers the pieces structured fields cannot: the async lifecycle, the companion tools to call before and after, and the account prerequisite. Return-value detail is correctly left to the output schema.

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%, with detailed per-field notes (Receita codes, Periodo enum values, TipoDocumentoOrigem, DataVencimento ISO format), so the baseline is 3. The description adds only the routing advice that UF-specific required fields come from gnre_configuracao, a point already made in the schema's own top-level description.

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 ("Gera a GNRE") and immediately defines the resource for an agent that may not know it ("guia de ICMS para outra UF, ex.: DIFAL ou ICMS-ST de uma NF-e"). It also scopes the operation to the Portal GNRE and the leiaute, so it is clearly distinguishable from the emitir siblings for other document types.

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 explicit workflow guidance: consult gnre_configuracao first to learn the UF-required fields, and poll gnre_consultar afterwards because the portal processes asynchronously. It also states a prerequisite ("Requer serviço GNRE habilitado no cadastro"), which is exactly the when-not/blocker information an agent needs before calling.

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.