Skip to main content
Glama

Stackin

cancel_invoice

Destructive

Cancel an authorized invoice.

Legal cancellation, with fiscal and accounting effect, inside a window the NFS-e authorizer enforces for the municipality. Ask the human to confirm before calling; never call it speculatively. The reason reaches the tax authority verbatim and must be at least 15 characters.

Pass idempotency_key to make a retry safe: repeating the same key with the same access key and reason replays the first answer instead of cancelling a second time. Reuse the key only when retrying that exact call; a genuinely new cancellation needs a new key, or none. Nothing generates one for you — two calls without a key are two cancellations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
reasonYes
access_keyYes
document_typeYes
idempotency_keyNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNoLocal id. Use it for reissue and for submissions, and when a document was rejected and has no key.
statusNoissued, rejected or cancelled.
protocolNoThe authorization protocol, when granted.
access_keyNoThe authorizer's key. Absent while the document is not authorized.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Goes well beyond the annotations (destructiveHint, idempotentHint, readOnlyHint) by detailing the fiscal/accounting impact, the verbatim submission of reason to the tax authority, and the exact semantics of idempotency_key (replay first answer vs. genuinely new cancellations). This is critical behavioral context not visible from structured data.

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 only four compact sentences (or a few short paragraphs), each carrying tactical value: the core action, legal conditions, human-in-the-loop rule, reason constraint, and idempotency behavior. No filler, fluff, or redundant restatements.

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?

Given the tool's complexity and destructive nature, the description covers all non-obvious aspects the agent needs: the legal cancellation window, the requirement to ask the human, the verbatim reason, and high-value idempotency semantics. Since an output schema exists, return values are already documented and don't need describing.

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 0%, so the description must compensate. It provides important meaning for two parameters (reason min length and verbatim transfer; idempotency_key retry behavior). Access_key and document_type are left to inference, but document_type's enum is self-explanatory and access_key is predictably the invoice identifier, so the description handles the most nuanced parts.

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 the action clearly ('Cancel an authorized invoice') and grounds it in legal/fiscal/accounting effect within the NFS-e municipality window, which distinguishes it from siblings like correct_invoice or invalidate_numbering.

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?

Explicitly says to ask a human to confirm and never to call it speculatively, giving a clear when-to-use condition. It does not name sibling alternatives for when-not-to (e.g., 'use correct_invoice for adjustments'), so it falls just 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.