Skip to main content
Glama

Create invoice draft

create_invoice_draft

Creates an invoice draft or an open proforma for a customer of a company, optionally with item lines. An invoice draft gets no number and nothing is issued or sent; a proforma is numbered at once. The seller data and the default bank account of the company are copied to the document. Item lines that can't be added are listed in item_errors with their index; the document is kept with the other lines.

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": {
      "company_id": "<company_id>",
      "customer_id": "<customer_id>"
    },
    "name": "create_invoice_draft"
  }
}

Input Schema

NameRequiredDescriptionDefault
vatNoThe default VAT rate of the document in percent, e.g. 22; new items get it. null: no rate.
dateNoThe date of the document, YYYY-MM-DD; today in the time zone of the company when not given.
itemsNoThe item lines of the document, in this order.
notesNoThe notes printed on the document; null clears them.
due_dateNoThe due date, YYYY-MM-DD, not before the date; null clears it.
languageNoThe language of the printed document; the language of the user when not given.
proformaNotrue: an open proforma (numbered at once) instead of an invoice draft.
vat_noteNoThe VAT note printed on the document; null clears it.
company_idYesThe id of the company, from list_companies.
customer_idYesThe id of the customer of the company, from list_customers; its data is copied to the document.
supply_dateNoThe date of supply of the goods or services, YYYY-MM-DD; null clears it.
valid_untilNoProformas only: the last day the proforma is valid, YYYY-MM-DD; from the validity days of the company when not given.
vat_categoryNoThe default VAT category of the document.
payment_termsNoThe payment terms printed on the document; those of the customer when not given.
buyer_referenceNoThe buyer reference required by the customer on e-invoices (one line); that of the customer when not given.
order_referenceNoThe order (purchase order) reference of the customer (one line); null clears it.
vat_exemption_reasonNoThe VAT exemption reason for an exempt category; null clears it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare a non-destructive, non-idempotent write, so the description's value is in the extra behavior: seller data and the default bank account are copied onto the document, and item lines that fail are reported in item_errors with their index while the document is still kept. That partial-success semantics is exactly the kind of trait annotations cannot convey. It does not mention permissions or what the returned document looks like, but no output schema exists so that gap is partly excusable.

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?

Three tight sentences, front-loaded with the core action followed by the mode distinction and then the copy/error behavior. No filler sentences, though the item_errors detail is dense and could be slightly better separated.

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 17-parameter creation tool with no output schema, the description covers the essentials an agent needs: the two modes, side effects (copied seller/bank data, numbering), and partial-failure handling via item_errors. Combined with 100% schema coverage, an agent can call this correctly without further context.

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 baseline is 3; every parameter is already documented in the schema. The description adds some meaning beyond that by clarifying the proforma flag's effect and the copy-from-company/customer defaults, but it does not touch the 17 parameters' formats, defaults, or enum semantics in any depth.

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 and resource ('creates an invoice draft or an open proforma for a customer of a company') and immediately differentiates the two output modes. It stops short of naming sibling tools like issue_invoice or update_invoice_draft, so the boundary with the rest of the invoice family is left implicit.

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

Usage Guidelines3/5

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

The draft-vs-proforma distinction ('gets no number and nothing is issued or sent' vs 'numbered at once') gives useful context for choosing the proforma flag. However, there is no explicit guidance on when to use this versus update_invoice_draft, add_invoice_item, or issue_invoice, and no stated prerequisites beyond referencing list_companies/list_customers in the schema.

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