Skip to main content
Glama

Cancelar uma nota

cancelar_nota
Destructive

Cancela uma NFS-e autorizada na SEFIN. Exige confirmar=true; o cancelamento não se desfaz. O crédito da emissão NÃO volta (a nota existiu); o cancelamento é grátis.

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": {
      "nota_id": "<nota_id>",
      "motivo": "<motivo>",
      "confirmar": "<confirmar>"
    },
    "name": "cancelar_nota"
  }
}

Input Schema

NameRequiredDescriptionDefault
motivoYesMotivo em texto (vai para a SEFIN).
nota_idYes
confirmarYesPrecisa ser true — confirmação do usuário nesta conversa.
codigo_motivoNo1=erro na emissão · 2=serviço não prestado · 4=duplicidade.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.7/5.0
Behavior3/5

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

The annotations already declare destructiveHint=true and idempotentHint=false, so the irreversibility warning is partly redundant, but the description goes further by stating the emission credit is not refunded and the cancellation is free — genuinely useful consequences not encoded in annotations. It still omits SEFIN-side failure modes, error responses, and timing for a destructive openWorld operation.

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?

Three short sentences, zero filler. The core action is front-loaded, followed by the hard requirement and then the material consequences — an agent can parse intent and risk in a single pass.

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, non-idempotent, open-world mutation with no output schema, the description covers the essential decision facts: authorization prerequisite, mandatory confirmation, non-reversibility, credit loss, and zero cost. It stops short of describing outcomes on SEFIN rejection or how this differs from the product-invoice cancel sibling, which is the main remaining gap.

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 75% and the enum values are already documented, so 3 is the baseline. The description adds real meaning beyond the schema by explaining why confirmar exists (user confirmation in this conversation) and by framing motivo as text routed to SEFIN, clarifying the purpose of two of the four parameters.

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?

"Cancela uma NFS-e autorizada na SEFIN" names a specific verb (cancel), resource (NFS-e), and preconditions (must be authorized, at SEFIN). It does not explicitly distinguish itself from the sibling cancelar_nota_produto, leaving the agent to infer the nota vs. nota_produto split from names alone.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The definition implies when the tool applies by constraining it to an already-authorized NFS-e, and the mandatory confirmar=true acts as a gating instruction. However, it never states when NOT to use it (e.g., nota still in draft, nota rejected, or product-invoice cancellation) nor points to an alternative sibling.

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