Skip to main content
Glama

Br Generate Nfe

br__generate_nfe

Generate an unsigned NF-e/NFC-e XML (modelo 55/65, schema 4.00) with access key and warnings. Takes invoice data to produce a Brazilian e-invoice document ready for signing and SEFAZ submission.

Instructions

Generate an unsigned NF-e/NFC-e XML (modelo 55/65, schema 4.00).

The returned <NFe><infNFe>…</infNFe></NFe> document does not include <Signature> — sign it with br__sign_nfe before SEFAZ submission. SEFAZ webservice submission itself is not implemented in this phase.

Returns a dict with:

  • xml: the generated NF-e/NFC-e XML string

  • chave_acesso: the computed 44-character access key (chNFe)

  • warnings: list of non-fatal notices

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
invoiceYesInvoice data matching the BRInvoice schema (modelo 55 = NF-e, modelo 65 = NFC-e)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden. It transparently discloses that the output lacks a Signature, that the XML is unsigned, and that submission is not handled. It also documents the return dict shape, though it could go slightly further in describing behavior on invalid invoice input.

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?

The description is well-structured with a lead sentence, a clear note about signing, and a concise bulleted return-value list. Every sentence contributes necessary information and there is no filler.

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 generation tool with nested invoice data and many document-type siblings, the description fully covers what it does, what it returns, what it does not do, and what to call next. An agent has enough context to invoke it correctly.

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% for the single invoice parameter, and the schema already states it matches the BRInvoice schema and maps modelo 55 to NF-e and 65 to NFC-e. The description reinforces modelo 55/65 and schema 4.00 but adds little beyond the input schema's existing meaning.

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 description starts with a specific verb and resource: 'Generate an unsigned NF-e/NFC-e XML (modelo 55/65, schema 4.00).' It clearly distinguishes this from sibling tools by noting that signing and SEFAZ submission are separate concerns, with submission explicitly out of scope.

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?

The description tells the agent to sign the result with br__sign_nfe before SEFAZ submission and explicitly states that SEFAZ webservice submission is not implemented. This routes the agent to the correct next tool and prevents misuse of this generation-only tool.

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