Skip to main content
Glama

Octobooks

Draft a sales invoice

invoice_draft

Make or change a sales invoice draft. customer: the code of a customer; or new_customer: {code, name, line1, postcode, city, country, vat_number, email, language (en or de), buyer_reference, payment_terms_days} to create or update one with the draft. lines: [{description, quantity, unit_price, tax_code, account (optional: else the revenue account this tax code went to before, or the chart's), unit (UN/ECE code, default C62), item_code, order_line (the position in the customer's order, BT-132; an Austrian federal order number asks it on every line), discount (an amount off the line) or discount_percent (10 for 10 %)}]; amounts are text with a dot. amounts_are: exclusive (the default: unit prices without VAT), inclusive (unit prices with VAT; each rate's gross is kept to the cent) or no_tax (every line on the code for no VAT). A line with item_code (a product code, or any part of its code or name that fits one product) and quantity alone is enough: description, unit_price, tax_code and account come from the product, its price and its defaults; a customer whose VAT treatment charges none (not registered, export, reverse charge) keeps that treatment, and vat_reason says why in one line. A product not on the list yet: A product not on file yet is added to the product list with name, tax_code, account and unit_price, and then drafted by its item_code. The same idempotency_key again replaces the draft while it is a draft; invoice_id names a draft to change. Dates are YYYY-MM-DD and optional: the invoice date is the day of issue unless given. series: one of the company's invoice series; in its online series (template online_series) the invoice takes the shop's order number from order_reference (order 1042 is WEB-1042). currency: EUR, USD and so on for an invoice in another currency than the books' (a draft keeps the one it began in); it is booked at the day's rate and prints its VAT in the books' currency too. fx_rate: one unit of that currency in the books' (0.8591); the units to one of the books' (1.1640) is read too where the rate on file sets the two apart, not near parity or without one; rate_read in the answer says the rate as read. from_last=true with customer and no lines starts the draft from that customer's last invoice: its lines, references, notes, currency, series and payment terms, dated anew (the dates and lines given win). Round 794 (Xero's draft): a draft saves with what there is: no customer yet, no lines yet, or lines without a description, price, tax_code or account; the answer's missing names every gap in one list, and the issue asks for all of them. A draft is deleted with the invoice actions' what=delete. Past invoices (round 811): past: {invoice_no, document_id} for an invoice issued before the books came to Octobooks: invoice_no as printed on it (INV-003), document_id its file uploaded with kind sales_invoice, issue_date its date; the issue books it on that date with that number and file, draws no new PDF and sends nothing, and the series runs on after the highest number. server_name: the connector's name in this Claude for the panel page that comes with a draft while there is no panel (default Octobooks MCP). ai_checks: the checks the AI made of the draft through its own channels (mail, drive, warehouse system), shown on the panel's invoice sheet under Checked by: [{name, source, result}], name one of unit_price, warehouse, delivery, po, vat_rate, vat_number, email (discounts and special agreements), source the place looked at in one line (Warehouse log 21 Nov), result agrees, differs or not_checked; merged by name. With invoice_id and no lines it records the checks alone. Nothing in the books changes here.

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": {
      "idempotency_key": "<idempotency_key>"
    },
    "name": "invoice_draft"
  }
}

Input Schema

NameRequiredDescriptionDefault
pastNo
linesNo
notesNo
seriesNo
companyNo
fx_rateNo
projectNo
currencyNo
customerNo
due_dateNo
languageNo
ai_checksNo
from_lastNo
ship_fromNo
invoice_idNo
issue_dateNo
amounts_areNo
server_nameNo
skonto_daysNo
supply_dateNo
new_customerNo
skonto_percentNo
buyer_referenceNo
idempotency_keyYes
order_referenceNo
delivery_addressNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.6/5.0
Behavior4/5

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

Annotations only declare readOnly=false, destructive=false and openWorld=false, so the description must carry the rest, and it does: 'Nothing in the books changes here', drafts save with incomplete data and the answer's 'missing' lists every gap, reusing an idempotency_key replaces an existing draft, and past-invoice booking draws no PDF and sends nothing. It does not address permissions, error/failure behavior, or what the panel/output actually contains beyond the 'missing' field.

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

Conciseness2/5

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

The definition is one enormous run-on block mixing parameter docs, validation behavior, sibling routing and version notes ('Round 794', 'round 811'), with at least one duplicated sentence ('A product not on the list yet: A product not on file yet is added...'). Useful facts are buried and an agent parsing it under time pressure will miss rules; it is under-structured rather than concise.

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

Completeness3/5

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

An output schema exists, so return values need not be explained, and the description covers the most consequential behaviors (draft tolerance, idempotency, past-invoice import, FX booking). For a 26-parameter mutation tool it still leaves many parameters undocumented and offers no failure modes or preconditions, so it is informative but not complete.

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 0% across 26 parameters, so the description is the only source and it explains customer, new_customer (including nested fields), lines subfields, amounts_are, fx_rate/rate_read, series, currency, past and ai_checks in real detail. However, roughly half the parameters - company, project, notes, due_date, supply_date, skonto_days, skonto_percent, delivery_address, ship_from, top-level language and buyer_reference - get no explanation at all, leaving a substantial compensation gap.

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 opening clause 'Make or change a sales invoice draft' gives a specific verb and resource, and the text later separates it from siblings ('A draft is deleted with the invoice actions' what=delete', 'the issue asks for all of them'). The differentiation exists but is scattered deep inside a dense block rather than stated up front, so an agent must read far to distinguish it from invoice_builder or invoice_issue.

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

Usage Guidelines4/5

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

Conditional usage rules are stated concretely: 'A line with item_code ... and quantity alone is enough', 'The same idempotency_key again replaces the draft while it is a draft', 'from_last=true with customer and no lines starts the draft from that customer's last invoice', and 'With invoice_id and no lines it records the checks alone.' It also routes deletion to a named alternative tool. What is missing is any explicit statement of when to choose this over invoice_builder or invoice_preview.

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