Skip to main content
Glama

create_ar_invoice

Create an outgoing (sales) invoice as a draft — nothing is booked yet (accountant role).

A draft changes no ledger balance, gets no invoice number and appears in no VAT return; it exists so it can be edited. Posting happens later, at POST …/ar/invoices/{invoice_id}/issue.

Body: issue_date (required), counterparty_id (the customer — required before it can be issued), currency/language, due_date (filled from the customer's payment terms when omitted), doc_type (invoice, the default — a credit_note draft can never be issued: credit an issued invoice with POST …/ar/invoices/{invoice_id}/credit-note instead), and lines: each line carries quantity, unit_price, a revenue account_code and a vat_code_id (the id from GET …/gl/vat-codes; a line without one declares no VAT). Totals, per-line net/VAT/gross and discounts are computed server-side — do not send them.

Returns the created invoice with its lines and computed totals. Check GET …/ar/invoices/{invoice_id}/readiness for what still blocks issuing.

Input Schema

NameRequiredDescriptionDefault
linesNo
notesNo
currencyNoCHF
doc_typeNoinvoice
due_dateNo
languageNo
company_idYes
issue_dateYes
legal_textNo
footer_textNo
counterparty_idNo
payment_terms_idNo
issuer_profile_idNo
service_period_endNo
credited_invoice_idNo
service_period_startNo
invoice_discount_kindNonone
invoice_discount_valueNo0

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

No annotations are provided, so the description carries the full burden and does so richly: a draft changes no ledger balance, gets no invoice number, appears in no VAT return; the accountant role is required; totals/VAT/discounts are computed server-side and must not be sent; issuing is a separate call. This is the behavioral context an agent needs for a mutation tool.

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?

Front-loads the single most important fact (this creates a DRAFT, nothing is booked), then organizes the body parameters, then the return value and the readiness check. Every sentence carries new information; nothing is redundant.

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 an 18-parameter mutation tool with no annotations and no output schema, the definition covers the draft semantics, required fields, key body fields, server-side computation, and the return shape ('created invoice with its lines and computed totals'). It falls short only on the secondary draft fields, which an agent may still have to infer from schema alone.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 18 parameters and 0% schema description coverage, the description compensates well for the tricky ones: issue_date and counterparty_id requirements, currency/language, due_date defaulting from payment terms, doc_type semantics, line quantity/unit_price/account_code/vat_code_id, and the 'do not send totals' rule. However, roughly half the schema is unexplained (payment_terms_id, issuer_profile_id, credited_invoice_id, service periods, invoice/line discount kinds and values, legal/footer/notes text).

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+resource+lifecycle state: 'Create an outgoing (sales) invoice as a draft.' It clearly distinguishes itself from the sibling issue_ar_invoice by naming the later posting step, so an agent can route correctly without opening either 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 says when to use it (draft exists so it can be edited; posting happens later at POST …/ar/invoices/{invoice_id}/issue) and when NOT to use it for credit notes (a credit_note draft can never be issued — use POST …/credit-note instead). Names alternatives and the conditions that select them.

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