Skip to main content
Glama

Incluir condutor ou NF-e no MDF-e

mdfe_incluir
Destructive

Inclui num MDF-e autorizado e ainda não encerrado um condutor (nome e CPF, evento 110114) ou NF-e (só modelo 55, com o município de carregamento e o de descarregamento de cada nota, evento 110115). Um evento por chamada: informe 'condutor' ou 'carregamento' + 'descarregamentos'.

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>",
      "chave": "<chave>"
    },
    "name": "mdfe_incluir"
  }
}

Input Schema

NameRequiredDescriptionDefault
chaveYesChave de acesso de 44 dígitos do MDF-e.
condutorNoInclusão de condutor: nome (2 a 60 caracteres) e CPF.
protocoloNoInclusão de NF-e: protocolo de autorização do MDF-e. Opcional - se omitido, o sistema localiza pela chave.
carregamentoNoInclusão de NF-e: município de carregamento, codMunicipio (IBGE, 7 dígitos) e municipio (opcional, sai da tabela do IBGE).
tipoAmbienteYesAmbiente do MDF-e (DEVE bater com o ambiente onde o manifesto foi emitido). Valores: 1 - Produção; 2 - Homologação
descarregamentosNoInclusão de NF-e: uma por item, com chaveDfe (chave da NF-e, só modelo 55), codMunicipio do descarregamento (IBGE, 7 dígitos) e municipio (opcional, sai da tabela do IBGE). De 1 a 2000.
numeroSequencialNoNúmero sequencial do evento. Se omitido, o sistema usa o próximo disponível do tipo de inclusão.

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. Added

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false and destructiveHint=true, but the description adds real context: the operation only applies to already-authorized manifests, one event is appended per call, and the sequence number is auto-assigned if omitted. It does not spell out irreversibility or failure modes, but the mutation profile is clear.

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 operation and its precondition, then the mode selection rule. The nested parentheticals make it dense but nothing is filler.

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?

For a 7-parameter mutation tool with an output schema, the description supplies the preconditions, mode exclusivity, and per-call event limit an agent needs. Remaining gaps (e.g., what happens if the manifest is closed, authorization requirements) are minor given the annotations and full schema coverage.

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 the baseline is 3; the description nonetheless adds the mutually exclusive usage rule (condutor OR carregamento + descarregamentos) that the schema itself does not enforce. It also reinforces the modelo-55 restriction on NF-e keys, which is business meaning rather than schema restatement.

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 (inclui) and two concrete resources (condutor, evento 110114; NF-e, evento 110115) scoped to an authorized and not-yet-closed MDF-e. It is clearly distinguishable from siblings such as mdfe_emitir and mdfe_encerrar without inspecting other schemas.

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 names the preconditions (MDF-e must be authorized and not closed), the one-event-per-call constraint, and the exact selector for each mode ('condutor' or 'carregamento' + 'descarregamentos'). It does not explicitly name alternative tools or state when-not to use it, so it stops short of a 5.

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.