Skip to main content
Glama

ERPNext: Create sales invoice

erpnext_create_sales_invoice

ERPNext: Saves a draft sales invoice with item lines, dates and a tax template. Saves a Sales Invoice as a draft and returns its ID and totals. A draft has no ledger effect and nothing is sent to the customer, and you can delete it in ERPNext, so this call does not ask for confirmation. The customer supplies the address, currency and price list defaults. Net total is the sum of the line amounts. To make the invoice final, call submit_sales_invoice. Needs the user's Cotlet API key with access to this app.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYesLines as objects: item_code (from list_items), qty and rate.
companyNoCompany name. Default: the default company of the signed-in user.
customerYesCustomer ID from list_customers.
due_dateNoPayment Due Date, YYYY-MM-DD. Decides when the invoice becomes Overdue.
posting_dateNoYYYY-MM-DD. Default: today.
taxes_templateNoName of a Sales Taxes and Charges template from your site.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Goes well past the annotations by disclosing that a draft has no ledger effect, nothing is sent to the customer, it can be deleted in ERPNext, and that it returns the ID and totals. It also names the auth requirement (Cotlet API key with access to this app), which the readOnlyHint/openWorldHint annotations do not convey.

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?

Dense and front-loaded, with the key routing sentence near the end. Slightly penalized for redundancy: 'Saves a draft sales invoice with item lines...' and 'Saves a Sales Invoice as a draft and returns its ID and totals' restate the same act.

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 what the response contains (ID and totals), the side-effect profile (no ledger effect, no customer notification, deletable), the auth prerequisite, and the follow-up path to finalization. Nothing an agent needs to call it correctly 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 description coverage is 100%, so the six parameters are already documented in the schema; that sets the baseline at 3. The description adds some derivational context (the customer supplies address, currency and price-list defaults), but nothing about the items payload or date formats beyond what the schema states.

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 ('Saves a draft sales invoice') and pins the scope to a draft, which distinguishes it from the sibling submit_sales_invoice that makes it final. An agent can identify the operation without opening the schema.

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

Usage Guidelines5/5

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

Explicitly routes the agent: 'To make the invoice final, call submit_sales_invoice.' It also explains the confirmation posture ('this call does not ask for confirmation') so the agent knows a follow-up submit is a separate, more consequential step.

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