Skip to main content
Glama

update_document

Updates an existing ERPNext document by DocType, document ID, and changed fields. Use smart mode for validation and clearer error handling during record modifications.

Instructions

Update an existing document in ERPNext

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>",
      "data": "<data>"
    },
    "name": "update_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
dataYesDocument data to update
modeNoUpdate mode: 'smart' (default) or 'standard' (legacy). Smart mode performs validation & enhanced error handling.smart
nameYesDocument name/ID
doctypeYesERPNext DocType (e.g., Customer, Item)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.8/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden. It does not say whether 'data' merges into the existing document or replaces fields, whether the update is reversible, what permissions are needed, or what happens on validation failure — all critical for a mutation tool with a free-form nested 'data' object.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

One short sentence with no filler, but its brevity reflects under-specification rather than discipline. It is front-loaded with the verb and resource, which is good, but there is nothing after that to earn the agent's confidence.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with a nested, schema-unconstrained 'data' object, no annotations, and no output schema, the description should explain merge/replace semantics and the practical difference between 'smart' and 'standard' modes. It leaves those gaps for the schema alone to cover.

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 description coverage is 100%, with all four parameters documented in the schema itself, including the enum and default for 'mode'. The description adds no meaning beyond that, so the baseline of 3 is appropriate.

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?

The description states a specific verb ('Update') and resource ('an existing document in ERPNext'), so the operation is immediately clear. It stops short of distinguishing this from siblings such as bulk_update_documents or rollback_document, leaving the agent to infer which variant applies.

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

Usage Guidelines2/5

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

There is no guidance on when to choose this single-document update over bulk_update_documents, or when rollback_document would be the correct recovery path. No prerequisites, no exclusions, no conditions are stated.

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