Skip to main content
Glama

Autorizar BP-e (bpeRecepcao)

bpe_autorizar

Submits a BP-e XML for SEFAZ authorization by validating and signing the document, compressing it with GZip+Base64, and sending it; blocks after 30 identical rejections.

Instructions

Envia um BP-e para autorização: minifica, verifica forma do XML (namespace, prefixos, espaços, UTF-8, 1024 KB), assina (se houver certificado), compacta em GZip+Base64 e envia. Um BP-e por requisição. Bloqueia após 30 rejeições iguais (CI01).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "xml": "<xml>"
    },
    "name": "bpe_autorizar"
  }
}

Input Schema

NameRequiredDescriptionDefault
xmlYesXML do BP-e (<BPe xmlns="http://www.portalfiscal.inf.br/bpe"><infBPe Id="BPe...">...)
assinarNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full behavioral burden and does substantially: it discloses the internal transform chain, conditional signing, and a hard blocking behavior after 30 identical rejections (CI01) — a non-obvious side effect an agent must know. It stops short of describing idempotency/retry safety or what the call returns, which keeps it from 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.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences, front-loaded with the action and followed by the processing detail; the parenthetical validation list is dense but every item is actionable. No filler or redundant restatement of the tool name.

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

Completeness3/5

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

For a high-stakes fiscal submission with no annotations and no output schema, the description omits the most consequential unknown: what comes back (authorization protocol, rejection codes, receipt) and whether a retry after a transient failure is safe. The blocking rule is disclosed, but the return contract is left entirely to inference.

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 50%: the `xml` parameter is documented in the schema, while `assinar` (default true) has no schema description and is only obliquely addressed by "assina (se houver certificado)". The description does add genuine constraints not present in the schema — UTF-8, 1024 KB limit, namespace/prefix/whitespace validation — which improves the `xml` parameter's meaning beyond the 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?

"Envia um BP-e para autorização" states a specific verb and resource, and the following pipeline sentence (minify, validate form, sign, compress, send) makes it unmistakable that this is the submission endpoint rather than any of the consulting/diagnostic siblings. An agent can distinguish it from bpe_consultar_situacao or bpe_validar_regras_negocio without opening a schema.

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

Usage Guidelines3/5

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

"Um BP-e por requisição" and the 30-identical-rejection block give real operational constraints, and "assina (se houver certificado)" hints at a prerequisite. But there is no explicit guidance on when to use this versus alternatives (e.g., validating rules first, or consulting status afterward), so the when-to-use signal is only implied.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.