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.

Input Schema

TableJSON 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

TableJSON 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 apenas quando o evento e autorizado (cStat 135) e o documento e NF-e (modelo 55). 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. 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"
      +  ]
      +}
  2. 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"
      +]
  3. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already convey destructive, non-read-only, open-world behavior. The description adds valuable business-rule context beyond annotations: specific correction exclusions (values, dates, parties, tax regimes, document number/series) and a per-document event limit, which help the agent understand what will happen and what is prohibited.

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 three tight sentences, front-loading the core action and purpose before listing exclusions and limits. Every sentence adds material information with no redundancy.

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?

With an output schema, full parameter descriptions, and annotations covering safety, the description supplies the remaining essential context: what the event does, what it cannot correct, and the CC-e limit. Nothing critical for correct invocation 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 all five parameters are already documented in the input schema. The description restates some correction restrictions but adds no syntax or format details beyond what the schema provides, making 3 the appropriate baseline.

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 states a specific verb ('Envia') and resource ('Carta de Correção (CC-e)') for an authorized NF-e or CT-e, explicitly noting the event type (2). It is clearly distinguishable from sibling event tools like evento_cancelar or evento_manifestar.

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 provides clear constraints on when this tool is appropriate: only for authorized documents, and it lists fields that cannot be corrected plus a 20-per-NF-e limit. However, it does not explicitly name alternative tools (e.g., evento_cancelar) for cases where correction is not allowed.

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.