Skip to main content
Glama

Enviar Carta de Correção (CC-e)

evento_carta_correcao
Destructive

Envia Carta de Correção (CC-e) para uma NF-e ou CT-e já autorizada (evento tipo 2). Não pode corrigir: valores, datas de emissão/saída, partes envolvidas (CNPJ/CPF), regimes tributários ou número/série do documento. Limite: 20 CC-e por NF-e.

Tool call template

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

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "TipoAmbiente": "<TipoAmbiente>",
      "ChaveNF": "<ChaveNF>"
    },
    "name": "evento_carta_correcao"
  }
}

Input Schema

NameRequiredDescriptionDefault
ChaveNFYesChave de acesso de 44 dígitos da NF-e ou CT-e a corrigir.
CorrecaoNoTexto da correção (mínimo 15, máximo 1000 caracteres). Obrigatório para NF-e (modelo 55). Não pode corrigir variáveis que afetam tributos (valores, quantidades, base de cálculo, alíquotas) nem dados de remetente/destinatário, nem data de emissão. Para CT-e use a lista Correcoes em vez deste campo.
CorrecoesNoLista de correções estruturadas (campo, grupo, valor). Usado SOMENTE para CT-e (modelo 57). Para NF-e/NFC-e use o campo Correcao acima.
TipoAmbienteYesAmbiente do documento original (DEVE bater com o ambiente onde a nota foi emitida). IMPORTANTE: passe explicitamente. Se a nota foi emitida em homologação, use 2. Valores: 1 - Produção; 2 - Homologação
NumeroSequencialNoNúmero sequencial do evento (1 a 20). Se omitido, o sistema usa o próximo disponível.

Output Schema

NameRequiredDescriptionDefault
ErrorNoMensagem de erro da operação. Vazia ("") quando foi bem-sucedida.
AvisosNoAvisos não bloqueantes. Pode vir preenchida mesmo em emissão bem-sucedida.
StatusNo1 - Evento Processado; 2 - Aguardando processamento do evento; 3 - Ocorreu um erro ao processar o evento
DsEventoNo
DsMotivoNo
Base64XmlNoXML do evento processado (procEventoNFe) em Base64. Preenchido quando o evento e autorizado (cStat 135) na Carta de Correcao da NF-e, na manifestacao do destinatario e no ECONF (NF-e e NFC-e). Nulo nos demais casos.
Base64FileNoPDF do documento auxiliar do evento (ex.: Carta de Correcao) em Base64. Preenchido apenas quando o evento e autorizado e a nota existe na base. Nulo nos demais casos.
DsAmbienteNo
NuProtocoloNo
NumeroSequencialNo
CodStatusRespostaSefazNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / Correcoes / items / properties / NumeroItem
      Added value: +{
      +  "description": "Posição do item alterado (1 a 99) quando o campo fica num grupo que se repete, por exemplo 2 para a segunda NF-e dos documentos do CT-e. Omitir nos demais casos. (nroItemAlterado)",
      +  "type": [
      +    "integer",
      +    "null"
      +  ]
      +}
  2. Changed1 schema field changed
    • changedOutput schema / properties / Base64Xml / description
      Previous value: -"XML do evento processado (procEventoNFe) em Base64. Preenchido apenas quando o evento e autorizado (cStat 135) e o documento e NF-e (modelo 55). Nulo nos demais casos."New value: +"XML do evento processado (procEventoNFe) em Base64. Preenchido quando o evento e autorizado (cStat 135) na Carta de Correcao da NF-e, na manifestacao do destinatario e no ECONF (NF-e e NFC-e). Nulo nos demais casos."
  3. Changed2 schema fields changed
    • addedOutput schema / properties / Base64File
      Added value: +{
      +  "description": "PDF do documento auxiliar do evento (ex.: Carta de Correcao) em Base64. Preenchido apenas quando o evento e autorizado e a nota existe na base. Nulo nos demais casos.",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / Base64Xml
      Added value: +{
      +  "description": "XML do evento processado (procEventoNFe) em Base64. Preenchido apenas quando o evento e autorizado (cStat 135) e o documento e NF-e (modelo 55). Nulo nos demais casos.",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
  4. Changed12 schema fields changed
    • changedInput schema / properties / Correcao / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedInput schema / properties / Correcoes / items / properties / Campo / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedInput schema / properties / Correcoes / items / properties / Grupo / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedInput schema / properties / Correcoes / items / properties / Valor / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedInput schema / properties / Correcoes / type
      Previous value: -"array"New value: +[
      +  "array",
      +  "null"
      +]
    • changedInput schema / properties / NumeroSequencial / type
      Previous value: -"integer"New value: +[
      +  "integer",
      +  "null"
      +]
    • changedOutput schema / properties / Avisos / type
      Previous value: -"array"New value: +[
      +  "array",
      +  "null"
      +]
    • changedOutput schema / properties / DsAmbiente / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / DsEvento / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / DsMotivo / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / Error / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / NuProtocolo / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
  5. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already flag a non-read-only, destructive, open-world write operation, so the safety bar is partly covered. The description adds meaningful domain behavior beyond that: the event-type-2 requirement, the enumerated fields that cannot be corrected, and a rate limit of 20 CC-e per NF-e. Minor gaps remain (whether a sent CC-e can be superseded or how rejections surface), but the added context is substantive.

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?

Two sentences, front-loaded with the core action and followed by constraints, with no filler wording. The prohibition list is long but each item is load-bearing for an agent deciding whether a correction is legal.

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?

An output schema exists, so return values need not be explained, and the parameters are fully documented in the schema. The description covers the remaining essentials: preconditions, illegal corrections, the per-document limit, and the NF-e/CT-e model distinction. It could be slightly more complete on failure/retry behavior, but nothing an agent needs to call it correctly is missing.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents every parameter, including the NF-e vs CT-e split between Correcao and Correcoes and the TipoAmbiente caveat. The description adds no parameter-level detail beyond that (it does not, for example, tie the 'evento tipo 2' mention to NumeroSequencial). Baseline 3 applies.

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?

States a specific verb ('Envia') and resource ('Carta de Correção (CC-e)') scoped to 'NF-e ou CT-e já autorizada (evento tipo 2)'. This clearly separates it from other event tools in the sibling list such as evento_cancelar or evento_inutilizar, since it names both the document types and the event type it operates on.

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?

Gives a clear precondition (document must already be authorized) and an explicit exclusion list of what CC-e cannot fix (values, emission/exit dates, parties, tax regimes, document number/series). It also states a hard cap of 20 CC-e per NF-e. It stops short of naming a sibling alternative (e.g. what to do when the correction falls outside CC-e scope, such as cancelamento), so it lacks full routing guidance.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.