Skip to main content
Glama

Create an expense draft from a receipt

create_draft_expense

Use this when the user shares a receipt or supplier invoice, or asks to record an expense or purchase. Saves an expense draft from a purchase receipt or supplier invoice for the user to review in Fatura Go ("Review in Fatura Go"); no expense is recorded until they save it there. Pass the fields you read from the receipt. VAT follows the app: only the VAT printed on the receipt, or 5/105 of the total when the receipt says prices include 5% VAT; otherwise no VAT and a "VAT not shown" warning. Returns the stored draft(s), warnings in plain words and the review link. A supplier with the same TRN or exactly the same name is linked; similar names are returned to choose from; no supplier is created. An open draft with the same supplier and invoice number is returned instead of a second one. Do not use it for sales invoices (create_draft_invoice) or to pay a supplier bill.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "create_draft_expense"
  }
}

Input Schema

NameRequiredDescriptionDefault
dateNoYYYY-MM-DD, the receipt date. Default today (UAE).
totalNoThe grand total printed on the receipt, VAT included. Required with the receipt fields.
categoryNoExpense category slug, e.g. fuel, meals, office_supplies, software. Default other.
currencyNoOne of AED, SAR, USD, EUR, GBP, KWD, QAR, BHD, OMR, INR. Default the business currency.
supplierNoThe seller's name as printed.
referenceNoAn order or PO number printed apart from the invoice number.
net_amountNoThe total before VAT, only when printed.
vat_amountNoThe VAT amount ONLY when a VAT line is printed. Leave it out when none is printed; never calculate it.
business_idNoFrom list_businesses. May be left out when the connection shares exactly one business.
supplier_idNoA supplier of the business, from the candidates a previous call returned.
new_supplierNotrue when the user says the supplier is new although similar names exist. Nothing is created now; Fatura Go adds the supplier when the expense is saved.
supplier_trnNoThe SELLER's 15-digit TRN as printed (never the buyer's). Checked as check_trn does.
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.
vat_included_statedNotrue ONLY when the receipt explicitly says the prices include 5% VAT (e.g. "Inclusive of 5% VAT"). A TRN alone is not such a statement.
supplier_invoice_numberNoThe invoice or receipt number as printed.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations only tell the agent this is a non-destructive, non-read-only write; the description adds substantial context beyond that: nothing is recorded until the user saves in Fatura Go, VAT is applied only when printed or when 5% inclusive is stated (otherwise a 'VAT not shown' warning), suppliers are matched by TRN or exact name and never created, and an open duplicate draft is returned instead of a second one. It also discloses the return payload (draft(s), plain-language warnings, review link), which matters because there is no output schema. It stops short of describing required permissions or failure modes, so it is not a full 5.

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 trigger and the primary caveat ('no expense is recorded until they save it there') are front-loaded, and the return payload and edge-case rules follow in a logical order. It is dense and long-sentenced, with several parentheticals, but nearly every clause carries decision-relevant behavior rather than restating the name.

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?

For a 15-parameter write tool with no output schema and no enums, the description covers the trigger, the persistence semantics, the VAT rule, supplier resolution, duplicate handling, and the shape of the response. An agent has enough to call this correctly and to explain the outcome to a user without further inference.

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 the baseline is 3, but the description adds genuine meaning the schema does not: the 5/105 derivation rule for VAT, the warning behavior when no VAT is printed, and the supplier-matching/dedupe logic that governs supplier_id, new_supplier and supplier_trn. It does not explain idempotency_key or business_id beyond what the schema already says.

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 — 'Saves an expense draft from a purchase receipt or supplier invoice' — and immediately scopes the trigger ('user shares a receipt or supplier invoice'). It also names the sibling it is not (create_draft_invoice) so an agent can route without opening 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?

It gives an explicit positive trigger ('shares a receipt or supplier invoice, or asks to record an expense or purchase') and explicit exclusions ('Do not use it for sales invoices (create_draft_invoice) or to pay a supplier bill'). Both the when and the when-not are stated, with the alternative tool named.

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