Skip to main content
Glama

Baixar XML ou PDF de evento

arquivo_baixar_evento
Read-onlyIdempotent

Baixa o arquivo de um evento (CC-e, cancelamento, manifestação, encerramento) por chave de acesso + número sequencial. Retorna conteúdo em base64.

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": "arquivo_baixar_evento"
  }
}

Input Schema

NameRequiredDescriptionDefault
ChaveNFNoChave de acesso da Nota Fiscal (44 dígitos) à qual o evento está vinculado.
NuProtocoloNoNúmero do protocolo do evento (somente dígitos). Identifica o evento específico (ex.: Carta de Correção, Cancelamento, Conciliação Financeira (ECONF), Manifestação do destinatário) registrado para a nota fiscal. Sem o protocolo, o BuscarEventos com a Chave lista os eventos autorizados da nota com o protocolo de cada um.
TipoArquivoNoTipo do arquivo do evento a ser retornado. Valores: 1 - XML do evento; 2 - PDF da Carta de Correção (CC-e) ou da Manifestação do destinatário

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / NuProtocolo / description
      Previous value: -"Número do protocolo do evento (somente dígitos). Identifica o evento específico (ex.: Carta de Correção, Cancelamento, Manifestação do destinatário) registrado para a nota fiscal."New value: +"Número do protocolo do evento (somente dígitos). Identifica o evento específico (ex.: Carta de Correção, Cancelamento, Conciliação Financeira (ECONF), Manifestação do destinatário) registrado para a nota fiscal. Sem o protocolo, o BuscarEventos com a Chave lista os eventos autorizados da nota com o protocolo de cada um."
  2. Changed2 schema fields changed
    • changedInput schema / properties / NuProtocolo / description
      Previous value: -"Número do protocolo do evento (somente dígitos). Identifica o evento específico (ex.: Carta de Correção, Cancelamento) registrado para a nota fiscal."New value: +"Número do protocolo do evento (somente dígitos). Identifica o evento específico (ex.: Carta de Correção, Cancelamento, Manifestação do destinatário) registrado para a nota fiscal."
    • changedInput schema / properties / TipoArquivo / description
      Previous value: -"Tipo do arquivo do evento a ser retornado. Valores: 1 - XML do evento; 2 - PDF da Carta de Correção (CC-e)"New value: +"Tipo do arquivo do evento a ser retornado. Valores: 1 - XML do evento; 2 - PDF da Carta de Correção (CC-e) ou da Manifestação do destinatário"
  3. Changed2 schema fields changed
    • changedInput schema / properties / ChaveNF / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedInput schema / properties / NuProtocolo / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
  4. First observed

TDQS

A3.5/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world, so the safety profile is covered. The description adds genuinely new context beyond them: the return payload is base64-encoded content and the file types vary by event kind. It omits whether a missing event/protocol raises an error or returns empty, which keeps it short of 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?

Two compact sentences: the operation and its event-type scope come first, the return format second. Nothing is padded, though the event-type parenthetical is somewhat redundant with the enum and title.

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?

For a simple read-only download with no output schema, the description covers what it fetches, which event types, what keys it needs and that the payload is base64 — enough to call it correctly. Only the alternative-tool routing and error behavior are left unstated.

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 coverage is 100%, so the schema already explains ChaveNF, NuProtocolo and the 1/2 enum for TipoArquivo; the baseline of 3 applies. The description adds little, and its phrase "número sequencial" sits awkwardly against the NuProtocolo parameter, which the schema defines as a protocol number — a small ambiguity rather than a clarification.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb ("Baixa") and resource ("arquivo de um evento"), enumerates the event kinds it covers (CC-e, cancelamento, manifestação, encerramento) and states the keying inputs. It does not explicitly distinguish itself from arquivo_baixar or arquivo_baixar_periodo, so an agent must infer the split from the word "evento".

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

Usage Guidelines2/5

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

There is no when-to-use guidance in the description: nothing says when to pick this over arquivo_baixar (whole NF-e file) or when to fetch the event list first. The valuable fallback hint ("sem o protocolo, use BuscarEventos") lives only in the parameter schema, not the description.

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.