Skip to main content
Glama

br__correct_cte

Issue an electronic correction letter (CC-e) to fix errors in a CT-e. Builds, signs, and submits the event to SEFAZ.

Instructions

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.

Input Schema

TableJSON 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

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

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.

Install Server

Other Tools

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