Skip to main content
Glama

Invoice generator

hopi_invoice_generator
Read-onlyIdempotent

Work out the totals for a UK invoice or full VAT invoice from its line items, in whole pence. Each line has a quantity, a unit price before VAT and, when vatRegistered is true, a VAT rate of 20, 5, 0, exempt or outside (the scope of VAT). VAT is rounded to the nearest penny on each line and summed per rate, as HMRC VAT Notice 700 allows. Returns line, per-rate and invoice totals, the total VAT in sterling for a foreign-currency VAT invoice (needs exchangeRate), the due date from termsDays, whether a simplified VAT invoice is allowed, the late payment compensation band and a list of missing details. Totals only: the printable invoice and PDF are made on the page, and descriptions are never echoed back. Source: https://hopi.co.uk/invoice-generator/

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": {
      "lineItems": "<lineItems>"
    },
    "name": "hopi_invoice_generator"
  }
}

Input Schema

NameRequiredDescriptionDefault
currencyNoCurrency the invoice is inGBP
lineItemsYesThe lines on the invoice, up to 200
termsDaysNoDays the customer has to pay; 0 means on receipt
supplyDateNoDate the goods or services were supplied (the tax point), YYYY-MM-DD
invoiceDateNoDate of the invoice, YYYY-MM-DD
exchangeRateNoHow much of the currency £1 buys, such as 1.17 for euros. Needed for a VAT invoice not in GBP, so the total VAT can be shown in sterling
vatRegisteredNoTrue for a full VAT invoice with VAT on each line; false for a plain invoice with no VAT
detailsIncludedNoWhich other details the invoice will show, to list anything missing. Leave a key out if unknown

Output Schema

NameRequiredDescriptionDefault
netNo
vatNo
grossNo
linesNo
notesNo
dueDateNo
netTextNo
summaryYes
vatTextNo
currencyNo
warningsNo
lineCountNo
termsDaysNo
totalTextNo
vatByRateNo
source_urlYesThe tool's page on hopi.co.uk (cite or open to check the figure)
supplyDateNo
invoiceDateNo
exchangeRateNo
vatInSterlingNo
vatRegisteredNo
latePaymentCompensationNo
simplifiedInvoiceAllowedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed10 schema fields changed
    • changedInput schema / properties / lineItems / items / properties / quantity / description
      Previous value: -"How many, above 0, up to 3 decimal places"New value: +"How many, above 0, up to 3 decimal places. A number, or text such as '1,000'"
    • changedInput schema / properties / lineItems / items / properties / quantity / type
      Previous value: -"number"New value: +[
      +  "number",
      +  "string"
      +]
    • changedInput schema / properties / lineItems / items / properties / unitPrice / description
      Previous value: -"Price of one unit before VAT, up to 2 decimal places. Negative for a discount line"New value: +"Price of one unit before VAT, up to 2 decimal places. Negative for a discount line. A number, or text such as '£1,234.50'"
    • changedInput schema / properties / lineItems / items / properties / unitPrice / type
      Previous value: -"number"New value: +[
      +  "number",
      +  "string"
      +]
    • changedOutput schema / properties / dueDate / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / exchangeRate / type
      Previous value: -"number"New value: +[
      +  "number",
      +  "null"
      +]
    • changedOutput schema / properties / invoiceDate / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / latePaymentCompensation / type
      Previous value: -"number"New value: +[
      +  "number",
      +  "null"
      +]
    • changedOutput schema / properties / supplyDate / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / vatInSterling / type
      Previous value: -"number"New value: +[
      +  "number",
      +  "null"
      +]
  2. Added

TDQS

A4/5.0
Behavior5/5

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

Goes well beyond the readOnly/idempotent annotations: it discloses the rounding rule (per-line VAT to the nearest penny, summed per rate, per HMRC VAT Notice 700), the foreign-currency sterling VAT requirement, due-date derivation from termsDays, simplified-invoice eligibility, late payment compensation, and a missing-details list. It also explicitly states descriptions are validated but never echoed back, which prevents a wrong assumption about output.

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 purpose then scope, and densely packed with useful constraints. It runs long and ends with a source URL that does nothing for an agent deciding how to call it, so it is not maximally tight.

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?

An output schema exists, so return values need not be spelled out, yet the description still names the aggregate levels (line, per-rate, invoice) and the ancillary outputs. Combined with the schema's enum and constraint coverage, an agent has everything needed to call this correctly.

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 every parameter is already documented, and the description largely restates it (vatRate values, exchangeRate necessity, termsDays). Baseline 3 is appropriate; it adds the HMRC rationale for rounding but no new parameter syntax or constraints.

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 ('work out the totals') and a precise resource ('a UK invoice or full VAT invoice from its line items, in whole pence'), and explicitly bounds scope with 'Totals only'. It does not name the nearest sibling (hopi_vat_calculator) to say how it differs, so an agent must infer the distinction.

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?

Usage is implied by the input requirements (lineItems required, vatRegistered gates VAT) and the 'Totals only'/no-PDF sentence rules out document generation. However, there is no explicit when-to-use statement or named alternative, so selecting it over hopi_vat_calculator or hopi_due_date_calculator is left to inference.

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