Skip to main content
Glama

Create a draft invoice

create_draft_invoice

Use this when a connected user asks to create, make or draft an invoice for one of their clients. Saves a new draft sales invoice for a client of the business. Line descriptions are printed on the tax invoice: write them in English, translating when the user writes in another language (for example "Консультация" becomes "Consultation"). Keep names, brands and model numbers exactly as written. Use another language only when the user explicitly asks for it or quotes the exact text. Lines are priced by Fatura Go as in the app (each line rounded, header = sum of lines; with prices_include_vat the entered price includes VAT, e.g. 26.95 = 25.67 + 1.28 VAT). Returns the stored lines and totals and app_url. Nothing is issued, numbered as a tax invoice or sent: the user reviews and issues it in Fatura Go ("Review and issue in Fatura Go"). due_date defaults to the client's or business's payment terms. Not for converting a quote: that is done in Fatura Go (Convert to invoice), which links the two. Do not use it to change an existing draft (update_draft_invoice), for a quote (create_draft_quote), or to issue or send an invoice: that happens in Fatura Go.

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": {
      "items": "<items>"
    },
    "name": "create_draft_invoice"
  }
}

Input Schema

NameRequiredDescriptionDefault
dateNoYYYY-MM-DD. Default today (UAE).
itemsYesThe lines, 1 to 100. On an update they replace every line.
notesNo
fx_rateNoAED per 1 unit of a foreign currency. USD defaults to the 3.6725 peg.
currencyNoOne of AED, SAR, USD, EUR, GBP, KWD, QAR, BHD, OMR, INR. Default the client's preferred currency, else the business currency.
due_dateNoYYYY-MM-DD, on or after date.
client_idNoFrom list_clients or create_client.
business_idNoFrom list_businesses. May be left out when the connection shares exactly one business.
client_nameNoOnly when the client_id is not known: nothing is written, and the matching clients are returned to pick from.
idempotency_keyNoOptional. A unique string (for example a UUID) for this request: a retry with the same key returns the first result instead of writing again.
prices_include_vatNoWhether unit_price includes the 5% VAT. Default the business setting.
document_language_overrideNoLanguage this document prints in: en, ar or bilingual. Left out: a new draft follows the business setting and an update keeps the current choice; null goes back to the business setting. Only for a document the user asked to print in another language.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / document_language_override
      Added value: +{
      +  "anyOf": [
      +    {
      +      "maxLength": 20,
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "Language this document prints in: en, ar or bilingual. Left out: a new draft follows the business setting and an update keeps the current choice; null goes back to the business setting. Only for a document the user asked to print in another language."
      +}
  2. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare a non-destructive, non-open-world write, and the description builds on that by disclosing that nothing is numbered or sent until the user issues it in Fatura Go, that due_date falls back to payment terms, and that the response contains the stored lines, totals and app_url despite no output schema. It does not discuss the idempotency_key retry behaviour, but the schema covers that field directly.

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 trigger, then the effect, then behavioural caveats, then sibling routing — a sensible order with no filler sentences. It loses a point for restating the line-description translation rule that already appears word-for-word in the schema, which lengthens the text without adding information.

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 12-parameter write tool with no output schema, the description covers the essentials an agent needs: what is created, what is deliberately not done, how totals are computed, and what comes back. Remaining details (currency, unit_code, idempotency) are handled by the unusually rich schema, so little is missing.

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 92%, so the baseline is 3, and the description earns above that by explaining pricing behaviour the schema only implies: each line is rounded, the header is the sum of lines, and with prices_include_vat the entered price includes VAT (26.95 = 25.67 + 1.28). The translation rule for line descriptions is repeated verbatim from the schema rather than extended.

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 and resource ("Saves a new draft sales invoice for a client of the business") and immediately scopes it to the draft state, which distinguishes it from issuing or converting. It names the sibling tools it is not (update_draft_invoice, create_draft_quote), so an agent can route correctly without inspecting schemas.

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?

Gives an explicit trigger ("when a connected user asks to create, make or draft an invoice for one of their clients") plus multiple explicit exclusions: not for converting a quote, not for editing an existing draft, not for a quote, not to issue or send. Each exclusion names where the work actually happens, so the agent has an alternative rather than a dead end.

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