Skip to main content
Glama

issue_ar_invoice

Issue a draft — this is the booking step (accountant role).

In one transaction it assigns the next invoice number, posts the journal entry (debit the AR control account, credit revenue per line, credit output VAT per VAT code), opens the receivable open item the customer's payment will settle, freezes the invoice against further edits (status → issued) and renders the PDF+QR snapshot. The turnover reaches the VAT return from here — a draft never does.

Only a draft can be issued: re-issuing an issued invoice is a 409. It is also refused when the invoice is not ready (no customer, no lines, a line without a revenue account…) — call GET …/ar/invoices/{invoice_id}/readiness first, whose blocking list is exactly what this refuses on — when the issue_date is not inside an open accounting period, or when the fiscal year has no AR control account configured.

Returns the issued invoice (now with document_no and commercial_document_id). A renderer outage does not fail the issue: the booking stands and the snapshot stays pending, re-rendered on demand by GET …/ar/invoices/{invoice_id}/pdf. To undo one, reverse its journal entry; there is no un-issue.

Input Schema

NameRequiredDescriptionDefault
company_idYes
invoice_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so richly: it describes the transaction (number assignment, journal entry debits/credits, open item creation), the state transition to issued, the 409 on re-issue, the renderer-outage tolerance, and that there is no un-issue (reverse the journal entry instead). This is the kind of behavioral context annotations could never supply.

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?

Front-loaded with the essential purpose in bold, then structured by transaction behavior, preconditions, returns, and undo path. It is dense and markdown-heavy, but every sentence carries distinct information, so little is wasted for a tool with this much behavior to convey.

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?

Given no output schema, the description still documents the return value (issued invoice with document_no and commercial_document_id), the failure modes, the readiness check, the renderer-outage edge case, and the reversal path. Nothing an agent needs in order to invoke and interpret this 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 coverage is 0%, so the description should compensate, but it only indirectly references invoice_id ('the draft') and never explains company_id or the identifier formats. The two parameters are self-evident strings, so this is adequate rather than deficient, but it adds little meaning beyond the schema.

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 (issue a draft AR invoice) and frames it as 'the booking step (accountant role)', which immediately separates it from create_ar_invoice and get_ar_invoice. An agent can tell what this does without opening any schema.

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?

Explicitly states the precondition (only a draft can be issued) and enumerates refusal conditions: not ready (no customer/lines/revenue account), issue_date outside an open period, no AR control account. It even points to the readiness endpoint whose 'blocking' list maps to the refusals. It does not name sibling tools to use instead (e.g. create_ar_invoice), so 5 is not warranted.

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