Skip to main content
Glama

mcp-nfe-br 🇧🇷

English | Portugues (Brasil)

PyPI version Python License


Introduction

mcp-nfe-br is an MCP (Model Context Protocol) server providing tools for issuing and validating Brazilian electronic fiscal documents: NF-e (modelo 55), NFC-e (modelo 65), NFS-e Nacional (ADN), and CT-e (modelo 57). This server is part of the mcp-einvoicing-* / mcp-*-* family, built on mcp-einvoicing-core, which provides the base data model, HTTP/OAuth2 utilities, and shared MCP server infrastructure.

Current status (v0.6.5): NF-e/NFC-e (modelo 55/65, schema 4.00) and NFS-e Nacional (ADN, schema v1.01) generation, ICP-Brasil signing, XSD validation, and gated SEFAZ/ADN submission are implemented. NF-e/NFC-e now also covers the 010e_v.1.02 schema delta (DANFE Simplificado Tipo 2 — tpImp=6, cIndOp, ISUFEmit, and the SEFAZ alert-message response group) on top of the PL_010d base. CT-e (modelo 57) generation/signing/validation and SEFAZ event submission (cancelamento, Carta de Correção) were added starting v0.6.0 — v1 scope is intentionally narrow: modal rodoviário only, ICMS CST 00 only, and no bundled/verified CT-e webservice endpoint table (every SEFAZ CT-e call requires an explicit endpoint_override). See the "CT-e (modelo 57)" tools section below and context-library/countries/br.md (in the source repo) for the full field-level reference.

Related MCP server: brasilnfe-mcp

Installation

Requirements

Using uv (recommended)

uv add mcp-nfe-br

Using pip

pip install mcp-nfe-br

From source

git clone https://github.com/cmendezs/mcp-nfe-br.git
cd mcp-nfe-br
uv sync --all-extras

Configuration

This server needs no credentials to run. The environment variables below are optional safety/logging toggles:

Environment variables

Variable

Description

Default

BR_READ_ONLY

Master switch. Set to 1 to disable write tools across all sub-formats: NF-e/NFC-e (br__submit_nfe, br__distribute_dfe), NFS-e (br__submit_nfse, br__cancel_nfse), and CT-e (br__submit_cte, br__cancel_cte, br__correct_cte). Safe mode for exploration. The SEFAZ environment (production/homologation) is selected per call via the tp_amb argument.

BR_CTE_READ_ONLY

Set to 1 to disable only the CT-e write tools (br__submit_cte, br__cancel_cte, br__correct_cte), leaving NF-e/NFS-e writes enabled. Independent of BR_READ_ONLY — either variable set to 1 is sufficient to block CT-e writes; you do not need both.

LOG_LEVEL

Log level: DEBUG, INFO, WARNING, ERROR

INFO

Claude Desktop integration

To use this server with Claude, add this configuration to your claude_desktop_config.json file:

{
  "mcpServers": {
    "nfe-br": {
      "command": "uvx",
      "args": ["mcp-nfe-br"]
    }
  }
}

For a local development install:

{
  "mcpServers": {
    "nfe-br": {
      "command": "uv",
      "args": ["run", "mcp-nfe-br"],
      "cwd": "/path/to/mcp-nfe-br"
    }
  }
}

Cursor integration

Cursor supports MCP servers via stdio. Add the configuration in:

  • Global (all projects): ~/.cursor/mcp.json

  • Project (this repository only): .cursor/mcp.json

{
  "mcpServers": {
    "nfe-br": {
      "command": "uvx",
      "args": ["mcp-nfe-br"]
    }
  }
}

Reload the Cursor window (Ctrl+Shift+P then Reload Window) to apply the changes.

Kiro integration

Kiro supports MCP servers via its dedicated configuration file. Two levels are available:

  • Global (all projects): ~/.kiro/settings/mcp.json

  • Workspace (this repository only): .kiro/settings/mcp.json

{
  "mcpServers": {
    "nfe-br": {
      "command": "uvx",
      "args": ["mcp-nfe-br"],
      "disabled": false,
      "autoApprove": []
    }
  }
}

The file is automatically reloaded on save. You can also open the config via the command palette (Cmd+Shift+P / Ctrl+Shift+P) then MCP.

Available tools

br__validate_cpf

Validates a CPF (Cadastro de Pessoas Físicas), the individual taxpayer identification number, using the Receita Federal modulo 11 algorithm.

Parameter

Type

Required

Description

cpf

string

yes

CPF with or without ./- separators

Returns a TaxIdValidationResult with valid=True and the cleaned value (11 digits) on success, or valid=False with an error message in Portuguese.


br__validate_cnpj

Validates a CNPJ (Cadastro Nacional da Pessoa Jurídica), the business taxpayer identification number. Accepts both the traditional numeric format (14 digits) and the alphanumeric format introduced by NT 2026.004 (PL_010d), effective in homologation from 2026-06-01 and in production from 2026-07-01.

Parameter

Type

Required

Description

cnpj

string

yes

CNPJ with or without .///- separators

Returns a TaxIdValidationResult with valid=True and the cleaned value (14 characters) on success, or valid=False with an error message in Portuguese.

⚠️ [Unverified]: the check-digit algorithm for the alphanumeric CNPJ format was implemented based on secondary sources, as the primary source ("NT Conjunta DFe 2025.001") is not yet available locally. See context-library/countries/br.md for details.


br__generate_nfe

Generates an unsigned NF-e/NFC-e 4.00 document (<NFe><infNFe>…</infNFe></NFe>) from a BRInvoice object.

Parameter

Type

Required

Description

invoice

object

yes

BRInvoice document (modelo 55 or 65, groups ide/emit/dest/det/total/transp/pag)

Returns {"xml": ..., "chave_acesso": ..., "warnings": [...]}. The warnings in Portuguese remind that the document is not signed (ICP-Brasil) and was not transmitted to SEFAZ. Both steps are the responsibility of a separate process.

Phase 1 coverage for per-item tax groups:

Tax

Supported codes

Behavior

ICMS

CST 00 (normal regime) or CSOSN 102 (Simples Nacional)

other codes raise DocumentGenerationError

PIS/COFINS

CST 01/02 (rate-based) or 04-09 (non-taxed)

group omitted if pis_cst/cofins_cst are None

IPI

CST 00/49/50/99 (taxed) or other (non-taxed)

group omitted if ipi_cst is None

[NEED: IBS/CBS/Imposto Seletivo — Grupo UB/W03 (NT 2025.002-RTC) not yet modeled, see context-library/countries/br.md "Known gaps"].


br__validate_nfe_xml

Validates an NF-e/NFC-e 4.00 XML document against the official PL_010d XSD, patched with the PL_010e_v.1.02 delta (local "unsigned" variant, see note below).

Parameter

Type

Required

Description

xml_content

string

no*

XML as a string

xml_base64

string

no*

Base64-encoded XML

* Exactly one of xml_content/xml_base64 must be provided.

Returns {"valid": bool, "errors": [...], "metadata": {"schema_version": ...}}.

[Inference]: the official XSD (nfe_v4.00.xsd/leiauteNFe_v4.00.xsd, PL_010d) requires <ds:Signature> as a mandatory child of <NFe>. Since Phase 1 generates unsigned documents, this tool validates against a local derived copy (nfe_v4.00_unsigned.xsd) where <ds:Signature> has been made optional (minOccurs="0"). Validation of signed documents (future phase) should use the official XSD without modifications.


br__build_access_key

Builds an access key (chNFe, 44 characters) with a modulo 11 check digit, from the components cUF, dhEmi, issuer CNPJ, model, series, and document number.

Parameter

Type

Required

Description

c_uf

string

yes

IBGE state code (2 digits)

dh_emi

string

yes

Issue date/time (ISO 8601)

cnpj

string

yes

Issuer CNPJ (numeric or alphanumeric PL_010d)

modelo

string

yes

55 (NF-e) or 65 (NFC-e)

serie

string

yes

Document series

nnf

string

yes

Document number

tp_emis

string

no

Issuance type (default "1")

c_nf

string

no

Random numeric code (cNF, 8 digits); auto-generated if omitted

Returns {"chave_acesso": ..., "cnf": ...}.

CT-e (modelo 57) tools

CT-e (Conhecimento de Transporte Eletrônico) coverage started at v0.6.0. v1 scope is intentionally narrow: modal rodoviário only (other modais raise an error), ICMS CST 00 (tributação normal) only, and no bundled/verified SEFAZ CT-e endpoint table — every SEFAZ call below requires an explicit endpoint_override. Since v0.7.0, br__generate_cte also accepts the Reforma Tributária do Consumo (IBS/CBS) fields introduced by NT 2026.002 — imp/IBSCBS, emit/ISUFEmit, and ide/tpPagAnt+gPagAntecipado — with the NT's self-contained business rules enforced at the model layer; rules that require a live SEFAZ database lookup are not checked.

br__generate_cte

Generates an unsigned CT-e 4.00 document (<CTe><infCte>…</infCte></CTe>) from a BRCTeDocument object.

Parameter

Type

Required

Description

cte

object

yes

BRCTeDocument (modelo 57, modal rodoviário, ICMS CST 00)

Returns {"xml": ..., "chave_acesso": ..., "warnings": [...]}.

br__validate_cte_xml

Validates a CT-e 4.00 XML document against the bundled PL_CTe_400 XSD (auto-selects the unsigned or official signed schema based on <ds:Signature> presence).

Parameter

Type

Required

Description

xml_content

string

no*

XML as a string

xml_base64

string

no*

Base64-encoded XML

* Exactly one of xml_content/xml_base64 must be provided.

br__consult_cte_sefaz_status

Checks SEFAZ CT-e webservice availability (CTeStatusServicoV4). Read-only, no confirmation required.

br__consult_cte

Queries a CT-e's status by access key (CTeConsultaV4). Read-only, no confirmation required — it queries one already-known document, not a bulk data pull.

br__submit_cte

Submits a signed CT-e to SEFAZ authorization (CTeRecepcaoSincV4, synchronous). The payload is automatically GZip-compressed and Base64-encoded before transmission, per the CT-e MOC. Gated with a two-step confirmation (ConfirmationGate) and BR_CTE_READ_ONLY.

br__cancel_cte

Requests cancellation of an authorized CT-e (event 110111, CTeRecepcaoEventoV4). cStat=135 indicates the cancellation was homologated. Gated.

br__correct_cte

Issues a Carta de Correção Eletrônica (event 110110, CTeRecepcaoEventoV4). Per Art. 58-B of CONVÊNIO/SINIEF 06/89, a CC-e cannot alter tax values, party registration data, or the issue/departure date. Gated.

Not yet implemented: br__distribute_cte_dfe (CTeDistribuicaoDFe) — the bundled specification confirms the request payload shape but not the webservice's method name, WSDL namespace, or message-wrapper element.

Architecture

mcp-nfe-br/
├── src/
│   └── mcp_nfe_br/
│       ├── __init__.py
│       ├── server.py              # MCP entry point and tool registration
│       ├── models/
│       │   ├── __init__.py
│       │   └── invoice.py         # BRInvoice, BRInvoiceLine, NFeModelo, TipoOperacao
│       ├── standards/
│       │   ├── __init__.py
│       │   └── nfe_generator.py   # NFeGenerator — generates unsigned NF-e/NFC-e 4.00
│       ├── validators/
│       │   ├── __init__.py
│       │   └── nfe_xsd.py         # NFeXSDValidator — validates against PL_010d XSD (unsigned variant)
│       ├── schemas/nfe/           # Bundled XSDs (official + "_unsigned" variants)
│       ├── tools/
│       │   ├── __init__.py
│       │   ├── validation.py      # br__validate_cpf, br__validate_cnpj
│       │   └── generation.py      # br__generate_nfe, br__validate_nfe_xml, br__build_access_key
│       └── utils/
│           ├── __init__.py
│           ├── document_ids.py    # validate_cpf, validate_cnpj
│           └── access_key.py      # build_access_key, access_key_check_digit
├── tests/
│   ├── conftest.py
│   ├── fixtures/
│   ├── test_tools/
│   │   ├── test_validation.py
│   │   └── test_generation.py
│   ├── test_standards/
│   │   └── test_nfe_generator.py
│   ├── test_validators/
│   │   └── test_nfe_xsd.py
│   └── test_utils/
│       └── test_access_key.py
├── specs/nfe/                     # Normative material (XSDs, MOC, Technical Notes, not published)
├── audit/
│   ├── audit_vs_core.py
│   └── report.json
├── .github/workflows/publish.yml
├── pyproject.toml
├── RELEASE.md
└── LICENSE

Relationship with mcp-einvoicing-core

mcp-einvoicing-core provides:

  • Base Pydantic models for invoices, parties, line items, and validation results (InvoiceDocument, InvoiceLineItem, TaxIdValidationResult)

  • Shared MCP server infrastructure (EInvoicingMCPServer)

  • HTTP/OAuth2 client, token cache, structured logging, exception hierarchy

mcp-nfe-br adds Brazil-specific logic:

  • BRInvoice (extends InvoiceDocument, as NF-e/NFC-e has no EN 16931 lineage)

  • Group I fields (NCM, CFOP, ICMS/IPI/PIS/COFINS) in BRInvoiceLine

  • CPF/CNPJ validation (including the alphanumeric CNPJ from NT 2026.004)

Contributing

Contributions are welcome. Please open an issue to discuss significant changes before submitting a pull request.

git clone https://github.com/cmendezs/mcp-nfe-br.git
cd mcp-nfe-br
uv sync --all-extras
uv run pytest
uv run ruff check src/mcp_nfe_br tests audit
uv run mypy src/mcp_nfe_br

Other e-invoicing MCP servers

Country

Server

🌍 Global

mcp-einvoicing-core

🇧🇪 Belgium

mcp-einvoicing-be

🇧🇷 Brazil

mcp-nfe-br

🇫🇷 France

mcp-facture-electronique-fr

🇩🇪 Germany

mcp-einvoicing-de

🇮🇹 Italy

mcp-fattura-elettronica-it

🇲🇽 Mexico

mcp-cfdi-mx

🇵🇱 Poland

mcp-ksef-pl

🇸🇬 Singapore

mcp-invoicenow-sg

🇪🇸 Spain

mcp-facturacion-electronica-es

🇦🇪 United Arab Emirates

mcp-einvoicing-ae

License

This project is licensed under Apache 2.0. See LICENSE for details. For the full version history, see CHANGELOG.md.

Available Tools

22 tools
br__build_access_keyA

Assemble and check-digit a 44-character NF-e/NFC-e access key (chNFe).

Returns a dict with chave_acesso (44 characters) and cnf (the 8-digit random code used, whether provided or generated).

ParametersJSON Schema
NameRequiredDescriptionDefault
nnfYesNúmero do documento fiscal (nNF)
c_nfNoCódigo numérico aleatório de 8 dígitos (cNF). Gerado se omitido.
c_ufYesCódigo IBGE da UF do emitente (2 dígitos)
cnpjYesCNPJ do emitente: 14 dígitos numéricos (PL_010c) ou 12 alfanuméricos + 2 dígitos (PL_010d)
serieYesSérie do documento fiscal
dh_emiYesData e hora de emissão (ISO 8601, com fuso horário)
modeloYesModelo do documento fiscal: '55' (NF-e) ou '65' (NFC-e)
tp_emisNoForma de emissão (tpEmis): '1' = normal1

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.8/5.0
Behavior3/5

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

No annotations are provided. The description discloses that cnf is generated if omitted and that the key is check-digit, but it omits behavioral traits like error handling, idempotency, or prerequisites (e.g., internet access). Adequate but incomplete.

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?

Two sentences, no wasted words, front-loaded with the primary purpose. Efficient and clear.

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?

Given the presence of an output schema, the description adequately covers the tool's purpose and returns. It could mention the check-digit algorithm or error scenarios, but it is sufficiently complete for a utility tool.

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% with detailed parameter descriptions. The description adds minimal extra meaning beyond the schema, such as mentioning check-digit and returned dict. Baseline 3 is appropriate.

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 clearly states the tool assembles and check-digits a 44-character NF-e/NFC-e access key, specifying the output format (chave_acesso and cnf). This distinguishes it from siblings like br__generate_nfe (generating the full NFe) and validation tools.

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?

The description implies the tool is for building the access key, but it does not explicitly state when to use it vs. alternatives like br__generate_nfe or validation tools. Sibling names provide context, but the description itself lacks clear guidance.

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

br__cancel_cteA

Solicita o cancelamento de um CT-e autorizado (evento 110111, CTeRecepcaoEventoV4).

Constrói, assina (build_cte_event_signer, alvo infEvento) e submete o evento de cancelamento. cStat=135 indica cancelamento homologado [Verified locally] — MOC CT-e Visão Geral v4.00 §6.2.2.

Cancelamento é uma operação irreversível em produção e exige confirmação em duas etapas (ConfirmationGate). Define BR_CTE_READ_ONLY=1 para desabilitar. endpoint_override é obrigatório — nenhuma URL de endpoint CT-e está embutida/verificada nesta versão.

Retorna cStat/xMotivo ou error.

ParametersJSON Schema
NameRequiredDescriptionDefault
cnpjYesCNPJ do emitente do CT-e (autor do evento)
ch_cteYesChave de acesso do CT-e a cancelar (chCTe), 44 caracteres
n_protYesNúmero do protocolo de autorização do CT-e original (nProt)
tp_ambNoIdentificação do Ambiente (tpAmb): '1' = produção, '2' = homologação2
x_justYesJustificativa do cancelamento
c_orgaoYesCódigo IBGE da UF do autorizador (cOrgao), 2 dígitos (ou '90' para SUFRAMA)
cert_pathYesCaminho local para o certificado ICP-Brasil A1 (.p12/.pfx)
dh_eventoYesData e hora do evento (ISO 8601, UTC)
cert_passwordNoSenha do certificado A1, se houver
endpoint_overrideYesURL completa do webservice CTeRecepcaoEventoV4 — obrigatório, ver docstring do módulo.
confirmation_tokenNoToken de confirmação obtido de uma chamada anterior pendente.

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.4/5.0
Behavior5/5

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

With no annotations, the description fully discloses behavioral traits: irreversible operation, two-step confirmation, requirement for endpoint_override, internal signing process, and return of cStat/xMotivo or error. No contradictions.

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 concise, well-structured, and front-loaded with the main purpose. Every sentence adds value without unnecessary detail.

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?

Given the tool's complexity (11 parameters, irreversible action), the description covers critical aspects: event code, mandatory endpoint, confirmation process, read-only guard, and return fields. Minor omission of output schema details, but output schema exists.

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 baseline 3 is appropriate. The description adds high-level context (event code, confirmation token usage) but does not significantly elaborate on individual parameters beyond schema descriptions.

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 clearly states the verb 'cancelar' and the resource 'CT-e autorizado', specifying the event code (110111) and web service (CTeRecepcaoEventoV4). It is distinct from siblings like br__consult_cte or br__correct_cte.

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?

Provides important context: cancellation is irreversible in production, requires two-step confirmation with ConfirmationGate, and endpoint_override is mandatory. Does not explicitly contrast with siblings but offers clear when-to-use guidance.

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

br__cancel_nfseA

Solicitar cancelamento de uma NFS-e no ADN.

Cancelamento é uma operação irreversível e exige confirmação em duas etapas (ConfirmationGate). Defina BR_READ_ONLY=1 para desabilitar.

[Unverified — endpoint e formato de requisição são inferidos.]

ParametersJSON Schema
NameRequiredDescriptionDefault
scopeNoOAuth2 scope override
motivoYesMotivo do cancelamento (texto livre)
tp_ambNoIdentificação do Ambiente (tpAmb): '1' = produção, '2' = homologação2
ch_nfseYesChave de acesso da NFS-e a cancelar (53 caracteres)
client_idYesClient ID OAuth2 gov.br
client_secretYesClient Secret OAuth2 gov.br
endpoint_overrideNoURL base do ADN override
confirmation_tokenNoToken de confirmação obtido de uma chamada anterior pendente.

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations provided, the description carries full transparency burden. It discloses irreversibility, two-step confirmation process, and unverified endpoint status. This is adequate, though it could elaborate on the exact effects beyond cancellation.

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 very concise: three sentences plus a note. It front-loads the primary purpose and adds critical behavioral warnings without unnecessary elaboration.

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?

Given the tool's complexity (8 params, 4 required, output schema present), the description covers core behavior but lacks explicit flow explanation for the two-step confirmation. The note about unverified endpoint adds caution. Adequate for an informed agent.

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 baseline is 3. The description does not add meaning to individual parameters beyond what the schema provides, except implicitly linking confirmation_token to the two-step process. No extra syntax or format details are given.

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 clearly states the action ('Solicitar cancelamento') and the resource ('NFS-e no ADN'), distinguishing it from sibling tools like br__submit_nfse or br__generate_nfse. The irreversible nature and two-step confirmation are also mentioned, reinforcing purpose.

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 description warns that cancellation is irreversible and requires a two-step confirmation (ConfirmationGate), and suggests setting BR_READ_ONLY=1 to disable. It provides implicit guidance for safe usage but does not explicitly outline when to use or avoid this tool versus alternatives.

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

br__consult_cteA

Consulta a situação de um CT-e por chave de acesso (CTeConsultaV4).

Read-only — não requer confirmação (consulta um CT-e específico e já conhecido pela chave de acesso, não um lote de dados fiscais de terceiros — diferente de br__distribute_dfe no NF-e). Nenhuma URL de endpoint CT-e está embutida/verificada nesta versão — endpoint_override é obrigatório.

Retorna cStat/xMotivo/protCTe (quando aplicável) ou error.

ParametersJSON Schema
NameRequiredDescriptionDefault
c_ufYesCódigo IBGE da UF do autorizador (cUF), 2 dígitos
ch_cteYesChave de acesso do CT-e (chCTe), 44 caracteres
tp_ambNoIdentificação do Ambiente (tpAmb): '1' = produção, '2' = homologação2
cert_pathYesCaminho local para o certificado ICP-Brasil A1 (.p12/.pfx)
cert_passwordNoSenha do certificado A1, se houver
endpoint_overrideYesURL completa do webservice CTeConsultaV4 — obrigatório, ver docstring do módulo.

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.5/5.0
Behavior5/5

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

No annotations provided, so description fully carries the burden. It discloses the tool is a consultation (non-destructive), describes return fields (cStat, xMotivo, protCTe or error), and warns that no endpoint URL is embedded, making endpoint_override mandatory. This gives agents a clear behavioral model.

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?

Description is three sentences, front-loaded with the verb and resource. Every sentence adds value: what it does, scope, mandatory parameter, return format. No fluff.

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?

Given 6 parameters (4 required), no annotations, and an output schema, the description covers return values, behavioral constraints (read-only, mandatory override), and differentiation from sibling. It is complete for the tool's complexity.

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?

Input schema has 100% description coverage, so each parameter is already documented. The description adds context that endpoint_override is mandatory (already in required) and explains that ch_cte is the access key. No significant extra meaning beyond the schema, thus baseline 3.

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?

Description clearly states the tool consults the situation of a specific CT-e using its access key. It specifies the operation (CTeConsultaV4), marks it as read-only, and distinguishes from sibling `br__distribute_dfe` by scope (single known CT-e vs batch).

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?

Description indicates the tool is read-only and requires no confirmation. It contrasts with `br__distribute_dfe` and notes endpoint_override is mandatory. However, no explicit 'when to use' or 'when not to use' guidance beyond the sibling distinction.

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

br__consult_cte_sefaz_statusA

Consulta a disponibilidade do webservice SEFAZ CT-e (CTeStatusServicoV4).

Read-only — não requer confirmação. Nenhuma URL de endpoint CT-e está embutida/verificada nesta versão — endpoint_override é obrigatório (ver mcp_nfe_br.standards.sefaz_cte_client docstring).

Retorna cStat/xMotivo (cStat=107 indica serviço em operação [Unverified], mesmo código do padrão NF-e).

ParametersJSON Schema
NameRequiredDescriptionDefault
c_ufYesCódigo IBGE da UF do autorizador (cUF), 2 dígitos
tp_ambNoIdentificação do Ambiente (tpAmb): '1' = produção, '2' = homologação2
cert_pathYesCaminho local para o certificado ICP-Brasil A1 (.p12/.pfx)
cert_passwordNoSenha do certificado A1, se houver
endpoint_overrideYesURL completa do webservice CTeStatusServicoV4 — obrigatório, ver docstring do módulo.

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.8/5.0
Behavior4/5

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

The description declares the tool is read-only, explains that endpoint_override is required because no endpoint is embedded, and describes the return format (cStat/xMotivo) and the significance of cStat=107. This is good transparency for a tool with no annotations, though error handling or rate limits are not mentioned.

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 concise, consisting of two main sentences plus a helpful parenthetical note. It front-loads the purpose and immediately adds critical usage context about endpoint_override.

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?

Given the 5 parameters, complete schema descriptions, and an output schema that likely covers return structure, the description is reasonably complete. It explains the mandatory parameter and the return code. However, it could be improved by including a brief note on error scenarios or the expected behavior when the service is down.

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 baseline is 3. The description adds value by clarifying that endpoint_override is mandatory and why, and by noting the return pattern. However, it does not add significant meaning beyond the schema descriptions for other parameters.

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 clearly states it consults the availability of the SEFAZ CT-e webservice using CTeStatusServicoV4. The tool name also indicates CT-e, but it does not explicitly differentiate it from the similar sibling br__consult_sefaz_status (likely for NF-e).

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?

The description states it is read-only and does not require confirmation, and that endpoint_override is mandatory. However, it does not provide guidance on when to use this tool versus alternatives like br__consult_sefaz_status or br__consult_cte, nor does it specify when not to use it.

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

br__consult_nfse_statusA

Consultar o status de uma NFS-e pelo chave de acesso (chNFSe).

Read-only, não requer confirmação.

[Unverified — endpoint e formato de resposta são inferidos.]

ParametersJSON Schema
NameRequiredDescriptionDefault
scopeNoOAuth2 scope override
tp_ambNoIdentificação do Ambiente (tpAmb): '1' = produção, '2' = homologação2
ch_nfseYesChave de acesso da NFS-e (53 caracteres, formato NFS[0-9]{50})
client_idYesClient ID OAuth2 gov.br
client_secretYesClient Secret OAuth2 gov.br
endpoint_overrideNoURL base do ADN override

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4/5.0
Behavior3/5

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

With no annotations provided, the description correctly identifies the tool as read-only and requiring no confirmation, adding safety context. However, it lacks details on rate limits, authentication requirements beyond schema, or error behavior. The '[Unverified]' note adds uncertainty.

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?

Description is extremely concise: two lines plus an informative note. No unnecessary words; front-loaded with primary purpose.

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?

Given that an output schema exists, the description does not need to explain return values. It covers the core purpose and safety traits. However, it omits contextual details like error conditions or environment handling for the optional tp_amb parameter.

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 description does not need to add parameter details. It only reiterates the ch_nfse key, adding no new 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?

Description clearly states 'Consultar o status de uma NFS-e pelo chave de acesso (chNFSe)', specifying verb (consult), resource (status of NFS-e), and identifier. This distinguishes it from sibling tools that cancel, generate, or submit invoices.

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?

Description explicitly says 'Read-only, não requer confirmação', indicating safe usage. However, it does not explicitly state when to use this tool versus alternatives like br__consult_sefaz_status or when not to use it.

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

br__consult_sefaz_statusA

Consulta a disponibilidade do webservice SEFAZ (NFeStatusServico4).

Read-only — não requer confirmação. Retorna cStat/xMotivo (cStat=107 indica serviço em operação [Unverified]).

ParametersJSON Schema
NameRequiredDescriptionDefault
c_ufYesCódigo IBGE da UF do autorizador (cUF), 2 dígitos
tp_ambNoIdentificação do Ambiente (tpAmb): '1' = produção, '2' = homologação2
cert_pathYesCaminho local para o certificado ICP-Brasil A1 (.p12/.pfx)
cert_passwordNoSenha do certificado A1, se houver
endpoint_overrideNoURL completa do webservice NFeStatusServico4 (sobrepõe a tabela de roteamento por UF)

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description bears full responsibility for behavioral disclosure. It states the tool is read-only, requires no confirmation, and returns cStat/xMotivo with the meaning of cStat=107. It does not discuss error behavior or dependencies, but for a simple query tool this is sufficient.

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 two sentences long, front-loaded with the core purpose, and every word adds value. No redundancy or fluff.

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?

Given the existence of an output schema and the tool's low complexity (read-only query), the description adequately covers the functionality. It explains the key return fields but does not discuss other possible cStat values or edge cases. Still, it is complete enough for the intended use.

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 baseline is 3. The description adds no additional detail beyond the schema for individual parameters. It does not explain parameter relationships or usage tips.

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 clearly states the tool consults the availability of the SEFAZ webservice NFeStatusServico4, and it is read-only. This distinguishes it from sibling tools that build, distribute, generate, sign, submit, or validate NFe documents.

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?

The description implies usage for checking service status before NFe operations, but it does not explicitly state when to use versus alternatives, nor does it cover when not to use. No exclusions or context about prerequisites are provided.

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

br__correct_cteA

Emite uma Carta de Correção Eletrônica para um CT-e (evento 110110, CTeRecepcaoEventoV4).

Constrói, assina (build_cte_event_signer, alvo infEvento) e submete o evento de CC-e. cStat=135 indica CC-e homologada [Verified locally] — MOC CT-e Visão Geral v4.00 §6.4. Por força do Art. 58-B do CONVÊNIO/SINIEF 06/89, a CC-e não pode alterar valores de impostos, dados cadastrais das partes, ou a data de emissão/saída.

Exige confirmação em duas etapas (ConfirmationGate). Define BR_CTE_READ_ONLY=1 para desabilitar. endpoint_override é obrigatório.

Retorna cStat/xMotivo ou error.

ParametersJSON Schema
NameRequiredDescriptionDefault
cnpjYesCNPJ do emitente do CT-e (autor do evento)
ch_cteYesChave de acesso do CT-e a corrigir (chCTe), 44 caracteres
tp_ambNoIdentificação do Ambiente (tpAmb): '1' = produção, '2' = homologação2
c_orgaoYesCódigo IBGE da UF do autorizador (cOrgao), 2 dígitos (ou '90' para SUFRAMA)
cert_pathYesCaminho local para o certificado ICP-Brasil A1 (.p12/.pfx)
correcoesYesLista de correções. Cada item: 'grupo_alterado', 'campo_alterado', 'valor_alterado', e opcionalmente 'nro_item_alterado'.
dh_eventoYesData e hora do evento (ISO 8601, UTC)
cert_passwordNoSenha do certificado A1, se houver
endpoint_overrideYesURL completa do webservice CTeRecepcaoEventoV4 — obrigatório, ver docstring do módulo.
confirmation_tokenNoToken de confirmação obtido de uma chamada anterior pendente.

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations, the description fully discloses the process (builds, signs, submits), expected cStat=135, legal constraints, two-step confirmation, and return format. This is comprehensive.

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 concise yet information-dense, front-loaded with the main action, and every sentence adds value. No superfluous text.

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?

Given the tool's complexity (10 params, 7 required, no output schema issues), the description covers legal context, behavioral details, and return info, making it complete for an agent to use.

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 baseline is 3. The description adds some context (endpoint_override required, confirmation_token for pending calls) but does not significantly enhance parameter 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?

The description clearly states the tool emits a Correção Eletrônica for a CT-e, specifying the event code (110110) and API reference. It distinguishes from sibling tools (e.g., cancel, generate) by being specifically for CC-e.

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 description provides important context: CC-e cannot alter tax values, cadastral data, or dates (legal reference), and it mentions two-step confirmation with a disable option. It does not explicitly contrast with alternatives but clearly defines the scope.

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

br__distribute_dfeA

Consulta/distribui DF-e via NFeDistribuicaoDFe (NT2014.002_v1.30, [Verified locally]).

Exatamente um de ult_nsu, nsu, ou ch_nfe deve ser informado, selecionando distNSU, consNSU, ou consChNFe respectivamente.

Esta ferramenta consulta dados fiscais de terceiros vinculados ao certificado e requer confirmação em duas etapas. Define BR_READ_ONLY=1 para desabilitar.

ParametersJSON Schema
NameRequiredDescriptionDefault
nsuNoconsNSU/NSU — NSU específico a consultar
ch_nfeNoconsChNFe/chNFe — chave de acesso (44 caracteres) a consultar
tp_ambNoIdentificação do Ambiente (tpAmb): '1' = produção, '2' = homologação2
ult_nsuNodistNSU/ultNSU — último NSU recebido (modo distribuição em lote)
cert_pathYesCaminho local para o certificado ICP-Brasil A1 (.p12/.pfx)
c_uf_autorYesCódigo IBGE da UF autorizadora (cUFAutor), 2 dígitos
document_idYesCNPJ ou CPF do interessado
cert_passwordNoSenha do certificado A1, se houver
document_id_typeNoTipo de document_id: 'CNPJ' ou 'CPF'CNPJ
endpoint_overrideNoURL completa do webservice NFeDistribuicaoDFe (sobrepõe o endpoint do Ambiente Nacional)
confirmation_tokenNoToken de confirmação obtido de uma chamada anterior pendente.

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.1/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses the two-step confirmation requirement and the option to set BR_READ_ONLY=1, indicating potential side effects. However, it does not detail idempotency, error handling, or the exact nature of the 'distribution' mode, leaving some behavioral aspects unclear.

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 description is concise with three clear sentences, each serving a purpose: identifying the operation, explaining parameter selection, and noting behavioral constraints. The technical reference (NT2014.002_v1.30) is somewhat verbose but still acceptable. No wasted words.

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?

Given the complexity (11 parameters, 100% schema coverage, output schema exists), the description adequately covers parameter logic and behavioral context. It does not explain the output schema or define DF-e, but the schema handles those details. The two-step confirmation and read-only mode are mentioned, providing sufficient operational context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. The description adds significant value by explaining the mutual exclusivity of ult_nsu, nsu, and ch_nfe, mapping them to distNSU, consNSU, and consChNFe respectively. This clarifies the parameter selection logic beyond individual parameter descriptions.

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 clearly states the tool consults/distributes DF-e via a specific operation (NFeDistribuicaoDFe). It distinguishes from sibling tools like br__generate_nfe and br__submit_nfe, which are for different phases of the workflow.

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 description explains that exactly one of three parameters must be provided, determining the mode. It also mentions the two-step confirmation and read-only mode, but does not explicitly state when to use this tool versus alternatives. However, the sibling context makes the usage area clear.

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

br__generate_cteA

Generate an unsigned CT-e XML (modelo 57, schema 4.00).

v1 supports modal rodoviário only and ICMS CST 00 (tributação normal) only — other modais/CSTs raise an error. The returned <CTe><infCte>…</infCte></CTe> document does not include <Signature> — sign it with br__sign_cte (roadmap BR-CTE-6 factory, tool not yet registered) before SEFAZ submission.

Returns a dict with:

  • xml: the generated CT-e XML string

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

  • warnings: list of non-fatal notices

ParametersJSON Schema
NameRequiredDescriptionDefault
cteYesCT-e data matching the BRCTeDocument schema (modelo 57)

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.9/5.0
Behavior5/5

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

With no annotations, the description fully discloses behavioral traits: unsupported modals/CSTs cause errors, output lacks signature, and return dict structure.

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?

Very concise, front-loaded with main purpose, followed by limitations, post-processing steps, and return fields in bullet format – no wasted words.

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?

Given 1 parameter, output schema, and sibling context, the description is complete: it explains constraints, necessary next steps, and return values adequately.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already provides a description (100% coverage), but the tool description adds value by specifying model, modal, and CST constraints 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?

The description clearly states the tool generates an unsigned CT-e XML (modelo 57, schema 4.00), specifies limitations (modal rodoviário, ICMS CST 00), and distinguishes from siblings like br__sign_cte and other generate tools.

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?

It explicitly says to use only for modal rodoviário and ICMS CST 00, errors others, and advises signing with br__sign_cte before SEFAZ submission, providing clear when-to-use and alternatives.

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

br__generate_nfeA

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

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

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries full burden of transparency. It discloses that the XML is unsigned, the need for signing, the exclusion of submission, and the structure of the return dict (xml, chave_acesso, warnings). Minor omission: no mention of error behavior, but overall transparent.

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 concise (4 lines), front-loaded with the main purpose, and every sentence adds value. No fluff or redundancy.

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?

Given the complexity of generating NF-e XML, the description covers the essential aspects: output format, access key, warnings, and the need for signing. It assumes knowledge of BRInvoice schema, which is acceptable. Could mention more about error handling or constraints, but overall complete for the context.

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 parameter 'invoice', so baseline is 3. The description adds no extra information beyond the schema; it only restates 'Invoice data matching the BRInvoice schema'. No additional semantics provided.

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 clearly states the tool generates an unsigned NF-e/NFC-e XML, specifies modelo 55/65 and schema 4.00, and distinguishes itself from siblings like br__sign_nfe and br__submit_nfe by noting that the output lacks Signature and SEFAZ submission is not included.

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 description explicitly tells users to sign the output with br__sign_nfe before submission and that SEFAZ submission is not in this phase, providing clear context for when to use this tool. However, it does not explicitly compare with other siblings like br__build_access_key or list when not to use this tool.

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

br__generate_nfseA

Gerar um DPS não assinado para NFS-e Nacional (ADN), schema v1.01.

O DPS (Declaração de Prestação de Serviços) gerado não contém <ds:Signature> — assine-o com br__sign_nfse antes de submeter ao ADN via br__submit_nfse.

Returns a dict with:

  • xml: the generated unsigned DPS XML string

  • dps_id: the 45-character DPS Id (infDPS Id attribute)

  • warnings: list of non-fatal notices

ParametersJSON Schema
NameRequiredDescriptionDefault
dpsYesDPS data matching the NFSeDocument schema (NFS-e Nacional, ADN, schema v1.01)

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.2/5.0
Behavior4/5

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

No annotations provided, so description carries full burden. It discloses that the output lacks ds:Signature, describes the return value structure (xml, dps_id, warnings), and mentions the schema version. It does not mention authentication or side effects, but the tool is read-only generation, so no major gaps.

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 very concise: one line for purpose, followed by essential details on unsigned signature and return values. Every sentence provides value without redundancy.

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?

Given one parameter, an output schema (implied), and sibling tools, the description covers the workflow and return values. Could provide more detail on the dps nested object structure, but it's sufficient for an experienced user.

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 the dps parameter described as 'DPS data matching the NFSeDocument schema'. The description adds only that it is for NFS-e Nacional and schema v1.01, which is already in the schema description. Minimal additional meaning beyond 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?

The description clearly states it generates an unsigned DPS for NFS-e Nacional, schema v1.01. It distinguishes from siblings br__sign_nfse and br__submit_nfse by specifying the unsigned nature and the subsequent workflow.

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?

It explicitly instructs to sign the DPS with br__sign_nfse before submitting via br__submit_nfse, providing a clear workflow. However, it does not explicitly state when not to use this tool or mention alternatives beyond the implied workflow.

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

br__sign_nfeA

Apply an ICP-Brasil enveloped XML-DSig signature to an NF-e/NFC-e XML.

Signs <infNFe> per MOC 7.0 Table 4-2 (RSA-SHA1 / SHA-1, enveloped transform, ds:Signature appended as the last child of <NFe>) using mcp_nfe_br.standards.nfe_signer.build_nfe_signer.

Only ICP-Brasil A1 (PKCS#12 file-based) certificates are supported. A3 (hardware token/HSM) certificates [NEED: not modeled].

Returns a dict with xml (the signed document) or error.

ParametersJSON Schema
NameRequiredDescriptionDefault
cert_pathYesCaminho local para o certificado ICP-Brasil A1 (.p12/.pfx)
xml_base64NoXML NF-e/NFC-e não assinado, codificado em base64.
xml_contentNoXML NF-e/NFC-e não assinado. Informe xml_content ou xml_base64.
cert_passwordNoSenha do certificado A1, se houver

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.5/5.0
Behavior5/5

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

No annotations are provided, so the description carries full burden. It discloses detailed behavior: signing algorithm (RSA-SHA1, enveloped transform), placement (last child of <NFe>), and supported certificate types (A1 only, A3 not modeled). It also specifies return format (dict with xml or error).

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 concise, front-loaded with the action, and includes necessary technical details without extraneous information. Every sentence adds value.

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?

Given the complexity of the signing operation and the presence of an output schema (implied by 'returns a dict with xml or error'), the description is complete. It covers the signing process, certificate limitations, and return format, leaving no major gaps considering the sibling tools are distinct operations.

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 baseline is 3. The description does not significantly add parameter-specific meaning beyond the schema; it provides overall context about signing and certificate support, but the parameters (cert_path, xml_content, xml_base64, cert_password) are adequately described in 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?

The description clearly states it applies an ICP-Brasil enveloped XML-DSig signature to an NF-e/NFC-e XML, specifying that it signs <infNFe> per MOC 7.0 Table 4-2. This distinguishes it from sibling tools like br__validate_nfe_xml or br__generate_nfe, which perform other operations.

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 description implies usage for signing NF-e/NFC-e XML and specifies supported certificate types (only ICP-Brasil A1). It does not explicitly state when not to use or provide alternatives, but the context is clear enough given the distinct operation from siblings.

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

br__sign_nfseA

Aplicar assinatura XML-DSig ICP-Brasil ao DPS da NFS-e Nacional.

Assina o elemento <infDPS> com enveloped ds:Signature adicionada como último filho de <DPS>, usando mcp_nfe_br.standards.nfse_signer.build_nfse_signer.

Algoritmo: RSA-SHA1 (padrão XMLDSigSigner). [Unverified para NFS-e Nacional — confirme no manual ADN antes de usar em produção.]

Somente certificados A1 (PKCS#12 em arquivo) são suportados. A3 (hardware token/HSM) [NEED: não modelado].

Returns a dict with xml (the signed DPS) or error.

ParametersJSON Schema
NameRequiredDescriptionDefault
cert_pathYesCaminho local para o certificado ICP-Brasil A1 (.p12/.pfx)
xml_base64NoDPS não assinado codificado em base64.
xml_contentNoDPS não assinado (saída de br__generate_nfse). Informe xml_content ou xml_base64.
cert_passwordNoSenha do certificado A1, se houver

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.6/5.0
Behavior4/5

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

With no annotations provided, the description carries full burden. It discloses the algorithm (RSA-SHA1), signature placement (as last child of <DPS>), and return structure (dict with xml or error). It does not explicitly mention whether the tool is read-only or destructive, but signing is inherently a write operation. The details are sufficient for an agent to understand behavior.

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 description is well-structured with a clear opening sentence, followed by technical details and caveats. It is not overly verbose, though the bracketed notes (e.g., `[Unverified...]`, `[NEED: não modelado]`) add slight clutter. Still, every sentence contributes meaning.

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?

Given the tool's complexity (signing XML with certificate), the description covers essential aspects: algorithm, supported certificate types, input format, and return value. It references a sibling tool for input, acknowledges verification status, and provides enough context for an agent to use it correctly. The presence of an output schema reduces the need for detailed return value documentation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so parameters are already documented. The description adds value by noting that cert_path is a local file path, xml_content typically comes from br__generate_nfse, and cert_password is optional. This contextualizes the parameters 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?

The description clearly states the tool applies an XML-DSig ICP-Brasil signature to the DPS element of NFS-e Nacional. It specifies the exact element (<infDPS>), signature type (enveloped ds:Signature), and library used. This distinguishes it from sibling tools like br__sign_nfe and br__generate_nfse.

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 explicitly states that only A1 certificates (PKCS#12 files) are supported, and A3 hardware tokens are not modeled. It also includes a warning that the tool is unverified for production, guiding cautious use. The input reference to br__generate_nfse provides context for the expected xml_content.

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

br__submit_cteA

Submete um CT-e assinado à autorização SEFAZ (CTeRecepcaoSincV4, síncrono).

O payload é automaticamente compactado em GZip e codificado em Base64 antes do envio, conforme exigido pelo MOC CT-e §3.4.1 [Verified locally].

Submissão para SEFAZ é uma operação irreversível em produção e exige confirmação em duas etapas (ConfirmationGate). Define BR_CTE_READ_ONLY=1 para desabilitar esta ferramenta. Nenhuma URL de endpoint CT-e está embutida/verificada nesta versão — endpoint_override é obrigatório.

Retorna protCTe (incluindo nProt, o protocolo de autorização) em caso de sucesso, ou error.

ParametersJSON Schema
NameRequiredDescriptionDefault
c_ufYesCódigo IBGE da UF do autorizador (cUF), 2 dígitos
tp_ambNoIdentificação do Ambiente (tpAmb): '1' = produção, '2' = homologação2
cert_pathYesCaminho local para o certificado ICP-Brasil A1 (.p12/.pfx)
xml_base64NoXML CT-e assinado, codificado em base64.
xml_contentNoXML CT-e assinado (saída de br__sign_cte). Informe xml_content ou xml_base64.
cert_passwordNoSenha do certificado A1, se houver
endpoint_overrideYesURL completa do webservice CTeRecepcaoSincV4 — obrigatório, ver docstring do módulo.
confirmation_tokenNoToken de confirmação obtido de uma chamada anterior pendente.

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations provided, the description carries full burden. It discloses automatic GZip + Base64 encoding, irreversible operation, two-step confirmation gate, absence of embedded endpoint URLs, and return format (protCTe or error). This is comprehensive.

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 description is fairly long but each sentence provides necessary information. It is well-structured: purpose, encoding details, irreversibility, confirmation gate, return value. Could be slightly more concise but not wasteful.

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?

Given the presence of an output schema (not shown), the description does not need to explain return values in full detail, but it mentions key parts (protCTe, nProt). For a tool with 8 parameters (3 required), it covers encoding, mandatory endpoint, confirmation process, and necessary context (e.g., no embedded endpoint). Complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so every parameter has a description. The description adds context: xml_content is the output of br__sign_cte, endpoint_override is mandatory, and encoding details. It adds value beyond schema, especially clarifying the relationship between xml_content and xml_base64.

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 clearly states the verb 'Submete um CT-e assinado' and the resource 'à autorização SEFAZ', specifying the operation as 'CTeRecepcaoSincV4, síncrono'. It distinguishes itself from siblings (e.g., br__submit_nfe, br__submit_nfse) by focusing on CT-e submission.

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 description provides when to use: after signing CT-e (from br__sign_cte). It mentions that submission is irreversible in production, requires two-step confirmation, and that endpoint_override is mandatory. It also gives a way to disable the tool. However, it does not explicitly mention when not to use it vs alternatives.

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

br__submit_nfeA

Submete um NF-e/NFC-e assinado à autorização SEFAZ (NFeAutorizacao4, síncrono).

Submissão para SEFAZ é uma operação irreversível em produção e exige confirmação em duas etapas (ConfirmationGate). Define BR_READ_ONLY=1 para desabilitar esta ferramenta.

Retorna protNFe (incluindo nProt, o protocolo de autorização) em caso de sucesso, ou error.

ParametersJSON Schema
NameRequiredDescriptionDefault
c_ufYesCódigo IBGE da UF do autorizador (cUF), 2 dígitos
tp_ambNoIdentificação do Ambiente (tpAmb): '1' = produção, '2' = homologação2
id_loteYesIdentificador do lote (idLote), até 15 dígitos
cert_pathYesCaminho local para o certificado ICP-Brasil A1 (.p12/.pfx)
xml_base64NoXML NF-e/NFC-e assinado, codificado em base64.
xml_contentNoXML NF-e/NFC-e assinado (saída de br__sign_nfe). Informe xml_content ou xml_base64.
cert_passwordNoSenha do certificado A1, se houver
endpoint_overrideNoURL completa do webservice NFeAutorizacao4 (sobrepõe a tabela de roteamento por UF)
confirmation_tokenNoToken de confirmação obtido de uma chamada anterior pendente.

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.2/5.0
Behavior4/5

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

The description discloses key behavioral traits: synchrony, irreversibility in production, required two-step confirmation via ConfirmationGate, and the ability to disable with BR_READ_ONLY. Without annotations, it provides sufficient behavioral context, though rate limits or detailed authentication flows are not covered.

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 concise: a single-sentence purpose followed by a brief paragraph on important caveats. No redundant or filler content; front-loaded with the key action.

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?

Given the complexity of SEFAZ submission (irreversible, two-step confirmation), the description covers purpose, input, output, and critical warnings. Output schema exists but is not detailed here; however, the description mentions protNFe and error, which is sufficient for an agent. Sibling tools contextualize the workflow.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. The description adds value by linking xml_content to br__sign_nfe output and explaining confirmation_token as from a previous pending call. This extra context aids proper parameter use beyond the schema descriptions.

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 clearly states the tool submits signed NF-e/NFC-e to SEFAZ for authorization (NFeAutorizacao4, synchronous). It distinguishes from sibling tools like br__sign_nfe (signing) and br__consult_sefaz_status (consultation), making its role unambiguous.

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?

The description warns about irreversibility and the two-step confirmation gate, but does not explicitly state when to use this tool versus alternatives like br__consult_sefaz_status or br__distribute_dfe. The mention of BR_READ_ONLY to disable provides a conditional usage hint, but lacks direct comparison to siblings.

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

br__submit_nfseA

Submeter um DPS assinado ao ADN para geração da NFS-e Nacional.

Submissão ao ADN é uma operação irreversível em produção e exige confirmação em duas etapas (ConfirmationGate). Defina BR_READ_ONLY=1 para desabilitar esta ferramenta.

[Unverified — endpoint ADN, formato de requisição e resposta são inferidos de fontes secundárias. Verifique no manual ADN antes do uso em produção.]

Retorna campos de status do ADN (cStat, xMotivo) e opcionalmente o XML da NFS-e gerada (nfse_xml).

ParametersJSON Schema
NameRequiredDescriptionDefault
scopeNoOAuth2 scope override (padrão: 'openid govbr_empresa')
tp_ambNoIdentificação do Ambiente (tpAmb): '1' = produção, '2' = homologação2
client_idYesClient ID OAuth2 gov.br (registrado no portal de desenvolvedores)
xml_base64NoDPS assinado codificado em base64.
xml_contentNoDPS assinado (saída de br__sign_nfse). Informe xml_content ou xml_base64.
client_secretYesClient Secret OAuth2 gov.br
endpoint_overrideNoURL base do ADN (sobrepõe a URL padrão por ambiente)
confirmation_tokenNoToken de confirmação obtido de uma chamada anterior pendente.

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.6/5.0
Behavior5/5

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

Describes critical behaviors: irreversibility, confirmation gate, and unverified endpoint. No annotations provided, so description fully bears the burden. Also specifies return fields (cStat, xMotivo, nfse_xml).

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?

Concise and front-loaded with the main purpose. Includes necessary warnings in a separate block. No fluff, but the warning could be slightly more integrated. Still efficient.

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?

Covers all essential aspects: main action, irreversibility, two-step confirmation, input alternatives, environment parameter, optional endpoint override, and response fields. No output schema provided, but description sufficiently documents returns. Complete for a complex submission tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

All parameters have detailed descriptions in the schema (100% coverage). The description adds value by clarifying the mutual exclusivity of xml_content and xml_base64, and the role of confirmation_token. Baseline is 3; the additional context justifies a 4.

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?

Clearly states the action: submit a signed DPS to ADN to generate the NFS-e. Distinguishes from siblings like br__sign_nfse and br__generate_nfse by specifying 'assinado' (signed) and mentioning the ADN submission step.

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?

Explicitly notes irreversibility in production and a two-step confirmation process. Suggests disabling the tool with BR_READ_ONLY=1. Provides a warning about the endpoint being unverified. Could be clearer about when to use vs. alternatives, but the context implies usage after signing.

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

br__validate_cnpjA

Validate a Brazilian CNPJ (company tax ID).

Accepts both the legacy all-numeric form (14 digits) and the alphanumeric form introduced by NT 2026.004 / PL_010d (12 alphanumeric characters + 2 numeric check digits, production from 2026-07-01).

ParametersJSON Schema
NameRequiredDescriptionDefault
cnpjYesCNPJ string, with or without ``.``/``/``/``-`` separators.

Output Schema

ParametersJSON Schema
NameRequiredDescription
errorNo
validYes
valueNo
country_codeNo

TDQS

A3.8/5.0
Behavior2/5

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

No annotations provided; description only covers input formats, not behavior on invalid inputs, side effects, or return values.

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?

Two sentences, front-loaded purpose, no wasted words.

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?

Simple tool with one param; description explains input variations adequately. Output schema exists, so no need to detail return values, but behavioral gaps remain.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema covers the single parameter with separator note; description adds valuable detail on two accepted formats (numeric and alphanumeric).

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?

Describes validation of Brazilian CNPJ, clearly distinguishing from sibling br__validate_cpf (which validates CPF).

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?

Implicitly when CNPJ validation is needed, but no explicit when-not or alternative tools guidance beyond sibling names.

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

br__validate_cpfA

Validate a Brazilian CPF (individual taxpayer ID).

ParametersJSON Schema
NameRequiredDescriptionDefault
cpfYesCPF string, with or without ``.``/``-`` separators.

Output Schema

ParametersJSON Schema
NameRequiredDescription
errorNo
validYes
valueNo
country_codeNo

TDQS

A3.5/5.0
Behavior2/5

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

With no annotations, the description bears full burden. It states 'Validate' but does not disclose what validation entails (e.g., checksum, formatting, existence), nor what happens on validation failure. The agent is left guessing the tool's behavior beyond the name.

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 a single, front-loaded sentence with no extraneous words. It efficiently communicates the core purpose.

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 simple validation tool with one parameter and an output schema, the description is moderately complete. However, the lack of behavioral details (e.g., what validation steps are performed, return format) limits its completeness, especially given no annotations.

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?

The input schema already provides 100% coverage for the single parameter, including format details. The description adds no new information beyond what the schema gives, so the baseline of 3 is appropriate.

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 clearly states the verb 'Validate' and the resource 'Brazilian CPF (individual taxpayer ID)', directly distinguishing it from sibling tools like br__validate_cnpj.

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?

The description implies use when a CPF needs validation, but provides no explicit guidance on when to prefer this tool over alternatives like validating CNPJ, nor any context on prerequisites or when not to use it.

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

br__validate_cte_xmlA

Validate a CT-e XML (modelo 57, schema 4.00) against the bundled PL_CTe_400 XSD.

CTeXSDValidator selects the schema automatically: documents without a <ds:Signature> are validated against the unsigned derivative; signed documents are validated against the unmodified official schema, which requires <ds:Signature>.

Returns a dict with valid, errors, warnings, and schema_version.

ParametersJSON Schema
NameRequiredDescriptionDefault
xml_base64NoBase64-encoded CT-e XML bytes.
xml_contentNoRaw CT-e XML string. Provide either xml_content or xml_base64.

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations, the description fully discloses behavior: it validates against a bundled XSD, automatically selects schema version based on signature, and returns a dict with keys valid, errors, warnings, and schema_version. No contradictions.

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 concise, with three sentences covering purpose, behavior, and output. It uses a code block for return structure, making it easy to parse. No wasted words.

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?

Given two optional parameters, no required fields, and an output schema implied by the description, the tool definition is complete. It explains validation logic, schema selection, and return format adequately.

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?

The input schema has 100% coverage with clear descriptions for both parameters. The description adds minimal extra semantic value beyond stating that one of the two should be provided, which is already in 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?

The description clearly states the tool validates CT-e XML against a specific XSD schema (modelo 57, schema 4.00). It distinguishes itself from sibling validation tools for NFe and NFSe by specifying the CT-e domain.

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 description explains schema selection logic based on signature presence, providing context for when the tool applies. However, it does not explicitly state when not to use it or compare to alternatives beyond the sibling list.

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

br__validate_nfe_xmlA

Validate an NF-e/NFC-e XML (modelo 55/65, schema 4.00) against the bundled PL_010d XSD.

NFeXSDValidator selects the schema automatically: documents without a <ds:Signature> are validated against the unsigned derivative; signed documents (produced by br__sign_nfe) are validated against the unmodified official schema, which requires <ds:Signature>.

Returns a dict with valid, errors, warnings, and schema_version.

ParametersJSON Schema
NameRequiredDescriptionDefault
xml_base64NoBase64-encoded NF-e/NFC-e XML bytes.
xml_contentNoRaw NF-e/NFC-e XML string. Provide either xml_content or xml_base64.

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.5/5.0
Behavior4/5

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

No annotations provided, but description adequately discloses automatic schema selection and return structure (valid, errors, warnings, schema_version). Sufficient for a read-only validation tool.

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?

Description is concise, front-loaded with the main purpose, and clearly structured with a technical note in the second paragraph. No unnecessary information.

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?

Given the complexity of schema selection and lack of annotations, the description fully explains behavior, inputs, and output. Output schema exists but description covers key fields.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but description adds value by clarifying mutual exclusivity of xml_content and xml_base64, which is not explicit in 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?

The description clearly states it validates NF-e/NFC-e XML against a specific XSD schema, distinguishing it from sibling tools like generation or signing.

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?

Provides guidance on schema selection based on presence of signature, linking to br__sign_nfe. Explicit usage context but no direct 'when not to use' statement.

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

br__validate_nfse_xmlA

Validar um DPS ou NFSe contra o XSD v1.01 do ADN.

Seleciona automaticamente o schema com base no elemento raiz:

  • <DPS> → valida contra DPS_v1.01.xsd (<ds:Signature> opcional)

  • <NFSe> → valida contra NFSe_v1.01.xsd (<ds:Signature> obrigatória)

Returns a dict with valid, errors, warnings, and schema_version.

ParametersJSON Schema
NameRequiredDescriptionDefault
xml_base64NoXML DPS ou NFSe codificado em base64.
xml_contentNoXML DPS ou NFSe como string. Informe xml_content ou xml_base64.

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.2/5.0
Behavior3/5

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

The description discloses the return dict structure (valid, errors, warnings, schema_version) and schema selection behavior. Without annotations, it doesn't mention side effects, network calls, or permissions, but the core behavior is adequately described.

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 very concise—three short sentences that front-load purpose, then detail behavior and output. Every sentence adds value without redundancy.

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?

Given no annotations, the description covers the validation logic, parameter choices, and return structure. It lacks details about performance or error handling, but is generally complete for a validation tool with an output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% for both parameters, but the description adds value by clarifying that xml_content and xml_base64 are alternatives and explaining how the root element influences validation. This goes beyond raw 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?

The description clearly states it validates DPS or NFSe against XSD v1.01, distinguishing it from siblings like br__validate_nfe_xml. It uses specific verbs and identifies the exact resources.

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 description explains automatic schema selection based on root element, providing context for when it applies. However, it does not explicitly exclude usage for other XML types like NFe, though this is implied by the tool name.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 7 tool updatesv0.6.2
    • Addedbr__cancel_cte
    • Addedbr__consult_cte
    • Addedbr__consult_cte_sefaz_status
    • Addedbr__correct_cte
    • Addedbr__generate_cte
    • Addedbr__submit_cte
    • Addedbr__validate_cte_xml
  2. 3 tool updatesv0.5.2
    • Addedbr__cancel_nfse
    • Addedbr__consult_nfse_status
    • Addedbr__submit_nfse
  3. 3 tool updatesv0.5.0
    • Addedbr__generate_nfse
    • Addedbr__sign_nfse
    • Addedbr__validate_nfse_xml
  4. 4 tool updatesv0.3.1
    • Addedbr__consult_sefaz_status
    • Addedbr__distribute_dfe
    • Addedbr__sign_nfe
    • Addedbr__submit_nfe
  5. 5 tool updatesv0.3.0
    • First observedbr__build_access_key
    • First observedbr__generate_nfe
    • First observedbr__validate_cnpj
    • First observedbr__validate_cpf
    • First observedbr__validate_nfe_xml

TDQS

A4/5.0
Disambiguation5/5

Each tool targets a distinct document type (NF-e, CT-e, NFS-e) and operation (generate, sign, submit, consult, cancel, correct, validate). Even similar consult tools are differentiated by specific document or service status. No two tools have overlapping purposes.

Naming Consistency5/5

All tools follow a consistent 'br__<verb>_<document>' pattern (e.g., br__generate_nfe, br__cancel_cte, br__validate_nfe_xml). The only minor deviation is br__build_access_key, but it still clearly describes the action. Overall, naming is highly predictable.

Tool Count4/5

22 tools cover multiple document types (NF-e, CT-e, NFS-e) with lifecycle operations plus validation and helper tools. While slightly high, each tool serves a distinct purpose and the count is appropriate for the domain's complexity.

Completeness2/5

Core workflows for NFS-e and CT-e are well-covered, but NF-e is missing essential operations like cancellation and correction (CC-e). Additionally, CT-e signing tool is not yet registered despite being mentioned. These are significant gaps that will hinder full lifecycle management.

Maintenance

ActivityActive
ResponsivenessWithin a week

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    A
    maintenance
    Model Context Protocol (MCP) server for Spanish Electronic Invoicing. Provides tools to generate, validate, and submit invoices across VERI\*FACTU, Facturae/FACe, SII, TicketBAI, and Crea y Crece B2B.
    20
    2
    Apache 2.0
  • F
    license
    Not graded
    quality
    D
    maintenance
    MCP server that exposes Brazilian tax infrastructure as tools, resources, and prompts, enabling AI agents to emit and manage fiscal documents (NF-e, NFC-e, NFS-e, CT-e, MDF-e, DC-e) through natural language.
    -
  • A
    license
    Not graded
    quality
    B
    maintenance
    MCP server to validate Brazilian fiscal documents (NF-e and NFS-e) locally before transmission, offering actionable feedback without requiring certificates or sending data anywhere.
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/cmendezs/mcp-nfe-br'

If you have feedback or need assistance with the MCP directory API, please join our Discord server