Skip to main content
Glama

br_nfe_xml_auditor

Brazilian NF-e/NFC-e XML-to-JSON compressor (~90% token savings), mathematical & CFOP tax auditor, 44-digit Access Key Mod-11 decoder, and LC 214/2025 CBS/IBS Tax Credit Auditor (single XML, batch xmls[], or direct items[]) with ready-to-send supplierAlert (0.01 USDC via x402 on Base).

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

Input Schema

NameRequiredDescriptionDefault
xmlNoRaw Brazilian NF-e or NFC-e XML content (<nfeProc> or <NFe>, SEFAZ 4.00 / NT 2025.002 layout) to parse, compress (~90% token savings), mathematically audit, and audit CBS/IBS tax credits.
xmlsNoOptional batch array of up to 25 NF-e/NFC-e XML strings for fleet/procurement CBS/IBS credit auditing in a single call.
itemsNoOptional list of purchased items (NCM/cClassTrib/valor + highlighted CBS/IBS) for direct LC 214/2025 credit auditing without building XML.
accessKeyNoOptional 44-digit Brazilian NF-e access key (Chave de Acesso) to decompose UF, issue date, issuer CNPJ, model, number, and validate Mod-11 check digit. Alias: access_key.
aiSummaryNoGenerate a concise accounting/tax audit summary via Cloudflare Workers AI (default: true).
buyerRegimeNoBuyer tax regime (default: 'regime_regular').
includeItemsNoInclude line-item details (NCM, CFOP, ICMS/IPI/PIS/COFINS and CBS/IBS credit audit) in output (default: true).
referenceYearNoOptional calendar year (2026..2033) for expected CBS/IBS rates (defaults to invoice issue year >= 2026, else 2026).
supplierEmailNoOptional supplier email address to prefill supplierAlert.emailDraft for agent-email-x402 chaining.
auditRtcCreditNoEnable LC 214/2025 CBS/IBS tax credit highlight audit & supplierAlert generation (default: true).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changed
    • changedInput schema / properties / accessKey / description
      Previous value: -"Optional 44-digit Brazilian NF-e access key (Chave de Acesso) to decompose UF, issue date, issuer CNPJ, model, number, and validate Mod-11 check digit."New value: +"Optional 44-digit Brazilian NF-e access key (Chave de Acesso) to decompose UF, issue date, issuer CNPJ, model, number, and validate Mod-11 check digit. Alias: access_key."
    • addedInput schema / properties / auditRtcCredit
      Added value: +{
      +  "description": "Enable LC 214/2025 CBS/IBS tax credit highlight audit & supplierAlert generation (default: true).",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / buyerRegime
      Added value: +{
      +  "description": "Buyer tax regime (default: 'regime_regular').",
      +  "enum": [
      +    "regime_regular",
      +    "simples_nacional"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / includeItems / description
      Previous value: -"Include line-item details (NCM, CFOP, quantities, ICMS/IPI/PIS/COFINS) in output (default: true)."New value: +"Include line-item details (NCM, CFOP, ICMS/IPI/PIS/COFINS and CBS/IBS credit audit) in output (default: true)."
    • addedInput schema / properties / items
      Added value: +{
      +  "description": "Optional list of purchased items (NCM/cClassTrib/valor + highlighted CBS/IBS) for direct LC 214/2025 credit auditing without building XML.",
      +  "items": {
      +    "properties": {
      +      "cClassTrib": {
      +        "type": "string"
      +      },
      +      "descricao": {
      +        "type": "string"
      +      },
      +      "ncm": {
      +        "type": "string"
      +      },
      +      "setor": {
      +        "type": "string"
      +      },
      +      "vCBS": {
      +        "type": "number"
      +      },
      +      "vIBS": {
      +        "type": "number"
      +      },
      +      "valor": {
      +        "type": "number"
      +      }
      +    },
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • addedInput schema / properties / referenceYear
      Added value: +{
      +  "description": "Optional calendar year (2026..2033) for expected CBS/IBS rates (defaults to invoice issue year >= 2026, else 2026).",
      +  "type": "integer"
      +}
    • addedInput schema / properties / supplierEmail
      Added value: +{
      +  "description": "Optional supplier email address to prefill supplierAlert.emailDraft for agent-email-x402 chaining.",
      +  "type": "string"
      +}
    • changedInput schema / properties / xml / description
      Previous value: -"Raw Brazilian NF-e or NFC-e XML content (<nfeProc> or <NFe>, SEFAZ 4.00 layout) to parse, compress (~90% token savings), and mathematically audit."New value: +"Raw Brazilian NF-e or NFC-e XML content (<nfeProc> or <NFe>, SEFAZ 4.00 / NT 2025.002 layout) to parse, compress (~90% token savings), mathematically audit, and audit CBS/IBS tax credits."
    • addedInput schema / properties / xmls
      Added value: +{
      +  "description": "Optional batch array of up to 25 NF-e/NFC-e XML strings for fleet/procurement CBS/IBS credit auditing in a single call.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
  2. First observed

TDQS

A3.8/5.0
Behavior3/5

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

The description adds behavioral context through the approximate token savings, the "ready-to-send" supplierAlert, and the 0.01 USDC/x402-on-Base terms. With no annotations, it still leaves ambiguity about what triggers payment, which external services are contacted, whether any alert is actually sent, and what safety or operational limitations apply.

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?

The single sentence front-loads the domain and core capabilities and contains little obvious filler. Its long chain of acronyms, compound noun phrases, and parenthetical clauses is dense and harder to scan than a short structured capability list.

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 10-parameter, multi-mode tool with no annotations or output schema, it covers the major functions and includes payment and alert context. However, it omits the minimum valid invocation, parameter compatibility, audit-result or diagnostic behavior, and precise payment and side-effect semantics, leaving gaps despite the comprehensive input 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%, so the schema already documents formats, defaults, the batch limit, and parameter aliases. The description usefully groups xml, xmls, and items as alternative input modes, but adds no parameter-combination or minimum-input rules beyond the structured fields.

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?

It names the exact document domain and four concrete operations: XML-to-JSON compression, mathematical/CFOP auditing, 44-digit Access Key Mod-11 decoding, and LC 214/2025 CBS/IBS credit auditing. The supported input modes and supplierAlert output further define its scope, making the tool easy to recognize and select.

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

Usage Guidelines4/5

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

The phrase "single XML, batch xmls[], or direct items[]" provides actionable mode-selection context, while the capability list establishes appropriate use cases. It does not explain whether accessKey can be used alone or combined with those modes, whether the modes are mutually exclusive, or any prerequisites or when-not-to-use conditions.

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.

Resources