Skip to main content
Glama

Create invoice from previous

create_invoice_from_previous
Destructive

Creates a new invoice by copying the most recently created invoice for a recipient (exact company name): its recipient details, line items and discounts. Use it for recurring work, such as the same invoice as last month with different hours. Invoice number, dates, line items, currency, VAT rate, shipping, note, style and buyer reference can be overridden; recipient details and discounts cannot; update_invoice can change those afterwards. invoiceDate and dueDate are written in the sender's date format, the dateFormat field of get_sender_settings (for example DD.MM.YYYY). A date that cannot be read as day, month and year in that format is rejected. The check goes no further: a date written in another format with the same separator is read in the expected order (03/04/2026 is 3 April in DD/MM/YYYY and 4 March in MM/DD/YYYY), a day past the end of its month rolls into the next one (31.02.2026 becomes 3 March), and a two-digit year is read as 19xx (26 is 1926). By default it creates a draft, which is free. With isDraft=false it creates a finalized invoice and spends credits. Finalizing uses one free invoice if any remain, otherwise it deducts the per-invoice price from the credit balance. It fails when the balance is too low, and the charge is not refunded. It fails if the recipient has no earlier invoice. Side effect: the recipient gets a customer record if none exists under that company name, created from the recipient details of the invoice, and the invoice is linked to it. An existing customer record is not changed. It does not email anyone. Each call creates another invoice.

Input Schema

NameRequiredDescriptionDefault
dueDateNoOverride due date, in the sender's date format (dateFormat from get_sender_settings). Defaults to today + payment terms.
isDraftNoCreate as draft (free, default) or final (charges credits)
currencyNoOverride currency
lineItemsNoOverride line items. If omitted, copies from previous invoice.
vatRateBpsNoOverride VAT rate
invoiceDateNoOverride invoice date, in the sender's date format (dateFormat from get_sender_settings). Defaults to today.
invoiceNoteNoOverride invoice note
invoiceStyleNoOverride invoice style
invoiceNumberNoOverride invoice number
shippingCentsNoOverride shipping
buyerReferenceNoOverride buyer reference
recipientCompanyNameYesRecipient company name to find the previous invoice for

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

The description goes well beyond the annotations by disclosing that drafts are free, final invoices spend credits, charges are not refunded, low balances and missing prior invoices cause failure, and a customer record may be created as a side effect. It also states no email is sent and each call creates another invoice, which is exactly the behavioral context needed for a non-idempotent, destructive mutation.

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?

The description is front-loaded with purpose and then proceeds through usage, override behavior, date handling, cost, and side effects in a logical order. It is fairly long, but most details are justified by the tool's complexity; the date-parsing edge cases are useful though slightly verbose.

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 a complex 12-parameter mutation, the description covers costs, failure modes, side effects, date formatting, and override rules thoroughly. It does not describe what the tool returns, and because there is no output schema, that is a remaining gap for an agent that needs to know the result of the creation.

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?

Schema coverage is 100%, so parameter documentation is already strong. The description still adds meaningful semantics by listing which fields can be overridden, stating that recipient details and discounts cannot, explaining the date format dependency on get_sender_settings, and clarifying the draft/final effect of isDraft.

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?

The description opens with a specific verb and resource: it creates a new invoice by copying the most recent invoice for a named recipient. It clearly distinguishes this from creating from scratch or updating an existing invoice by explaining that recipient details and discounts are copied and not overridable.

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?

It gives a clear use case: recurring work such as repeating last month's invoice with different hours. It also points to update_invoice for later changes to copied fields, but it does not explicitly contrast this tool with siblings like create_invoice or duplicate_invoice, so the alternative-selection guidance is not complete.

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