Skip to main content
Glama

create_document

Create a new ERPNext document for any DocType with smart validation and enhanced error handling, or use standard legacy mode for direct creation.

Instructions

Create a new 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>",
      "data": "<data>"
    },
    "name": "create_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
dataYesDocument data
modeNoCreation mode: 'smart' (default) or 'standard' (legacy). Smart mode performs validation & enhanced error handling.smart
doctypeYesERPNext DocType (e.g., Customer, Item)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.9/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 burden, and it says nothing about required permissions, side effects, validation failures, or what a successful response contains. The single sentence 'Create a new document' only restates what the name already conveys.

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?

One short, front-loaded sentence with zero filler. It is efficient, though its brevity borders on under-specification rather than deliberate concision.

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?

This is a write tool with a nested free-form 'data' object, no annotations, and no output schema, so the description should explain permissions, error behavior, or return shape. It does none of that, leaving the agent without the context needed to call it confidently in non-trivial cases.

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%: doctype, data, and the standard/smart mode enum are all documented in the schema, including the note that smart mode performs validation and enhanced error handling. The description adds no meaning beyond that, so the baseline of 3 applies.

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?

States a specific verb ('Create') and resource ('a new document in ERPNext'), which is unambiguous on its own. However, it offers no differentiation from nearby siblings such as bulk_create_documents or update_document, and it does not clarify how this differs from the smart/legacy creation variants present in the catalog.

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 when-to-use or when-not-to-use guidance, no mention of prerequisites such as permissions on the target DocType, and no routing to alternatives like bulk creation. The agent must infer everything about applicability from the name alone.

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