Skip to main content
Glama

Cancelar nota de produto

cancelar_nota_produto
Destructive

Cancela uma NF-e ou NFC-e autorizada. Efeito fiscal que não se desfaz. Exige a justificativa (15 a 255 caracteres) e confirmar=true. O prazo é o da legislação; fora dele a SEFAZ recusa. O crédito da emissão não volta.

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": {
      "tipo": "<tipo>",
      "id": "<id>",
      "justificativa": "<justificativa>",
      "confirmar": "<confirmar>"
    },
    "name": "cancelar_nota_produto"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYes
tipoYes
confirmarYes
justificativaYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior5/5

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

Annotations already flag this as destructive and non-idempotent, but the description adds the crucial fiscal consequence: the effect cannot be undone, the emission credit is not restored, and an external authority (SEFAZ) can reject the call based on timing. That is exactly the kind of context annotations cannot express.

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?

Four short sentences, front-loaded with what the tool does and the irreversibility warning, followed by the required inputs and deadline constraint. No filler or repetition.

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 destructive, externally-gated operation with no output schema, the description covers irreversibility, credit loss, mandatory confirmation, and rejection conditions. Only the meaning of the 'id' identifier is missing to make it fully self-sufficient.

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?

With 0% schema description coverage, the description does some work: it explains why justificativa and confirmar=true are required (legal justification + deliberate confirmation) and notes the deadline constraint. However, the 'id' parameter (pattern ^[a-z0-9]{20,32}$) and the nfe/nfce choice are left completely unexplained, which is a meaningful gap at 0% coverage.

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?

States a specific verb (cancela) and resource (NF-e ou NFC-e autorizada), which domain-wise separates it from the service-invoice sibling cancelar_nota. It stops short of naming that alternative explicitly, so the agent must infer the distinction from fiscal document types.

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 clear preconditions for use: the note must already be authorized, justification and confirmar=true are mandatory, and the cancellation must fall within the legal deadline or SEFAZ will refuse. It does not explicitly route between this and the sibling cancelar_nota, which is the only notable gap.

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.

Resources