Skip to main content
Glama

ERPNext: Cancel sales invoice

erpnext_cancel_sales_invoice

ERPNext: Cancels a submitted sales invoice and reverses its ledger entries. Moves a submitted Sales Invoice to cancelled (docstatus 2) and reverses its ledger effects. ERPNext's guide says to handle linked payments, returns and stock transactions first; the call returns ERPNext's error if something still links to the invoice. A cancelled invoice cannot be edited, so create a new draft to replace it. By default you confirm each call; you can switch that off for this tool. Reaches other people: confirm with the user before each call. Needs the user's Cotlet API key with access to this app.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
invoiceYesSales Invoice ID from list_sales_invoices or create_sales_invoice.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=false, destructiveHint=false and openWorldHint=true; the description goes far beyond by disclosing the state transition (docstatus 2), ledger reversal, prerequisite linked documents, the failure mode (ERPNext error), irreversibility for editing, and the per-call confirmation and Cotlet API key auth requirements.

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?

Front-loaded with the core action and effect, then prerequisites, error behavior, and confirmation/auth context. Slightly redundant since sentence two restates the reversal already implied by sentence one, but nothing is wasted.

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?

For a mutation tool with no output schema, the description covers everything an agent needs: effect, preconditions, error behavior, irreversibility, confirmation policy, and auth. Nothing material 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 coverage is 100% and the single parameter is already documented in the schema ('Sales Invoice ID from list_sales_invoices or create_sales_invoice'). The description adds no extra syntax or format detail, so the baseline 3 applies.

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 a specific verb and resource ('Cancels a submitted sales invoice') and immediately scopes the effect ('reverses its ledger entries', 'docstatus 2'). An agent can distinguish it from submit_sales_invoice or get_sales_invoice without opening any schema.

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 real conditional guidance: handle linked payments, returns and stock transactions first, and the call errors if something still links. Also tells the agent the post-cancel path (create a new draft, since a cancelled invoice cannot be edited). It stops short of naming sibling tools explicitly, so a 4 rather than 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.

Resources