Skip to main content
Glama
ERPNext MCP Server

ERPNext MCP Server

by hatlabs

cancel_document

Cancel a submitted ERPNext document by setting its docstatus to 2, then use the amend workflow to create a corrected copy because cancelled documents cannot be modified.

Instructions

Cancel a submitted document (set docstatus to 2). Cancelled documents cannot be modified — use amend workflow to create a corrected copy.

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": {
      "doctype": "<doctype>",
      "name": "<name>"
    },
    "name": "cancel_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesDocument name/ID
doctypeYesERPNext DocType

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations supplied, the description carries the burden and does disclose the critical side effect: the document becomes unmodifiable and a separate amend workflow is required to continue. It does not cover permissions/auth, effect on linked records, or whether the cancellation itself can be undone, which are meaningful gaps for an irreversible mutation.

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?

Two short sentences, zero filler, with the action and its state effect front-loaded and the follow-up guidance second.

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 two-parameter mutation with no output schema, the definition covers purpose, the resulting state, and the required follow-up path. Missing only peripheral details such as required privileges or the response shape, which keeps it from a 5.

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?

Both parameters are fully documented in the schema ('Document name/ID', 'ERPNext DocType'), and the description adds no format, constraint, or example beyond that. Baseline 3 is appropriate when schema coverage is 100%.

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 ('Cancel') and resource ('a submitted document'), and even names the underlying state transition (docstatus to 2). The 'submitted' qualifier plus the amend note makes it distinguishable from submit_document and update_document without opening their 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?

Implies the correct context (only submitted documents can be cancelled) and directs the agent to the amend workflow when a corrected copy is needed after cancellation. It never states an explicit exclusion (e.g., what to use for drafts) or names an alternative tool by name, so it stops short of full when/when-not guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.