Skip to main content
Glama

prepare_client_invoice

Prepare a client invoice from a saved ExpenseBot report without creating it. Reads canonical report rows, allocates a unique invoice number, verifies the client ledger identity and advance, and returns exact totals plus a short-lived preparationId. Call this first, show the preview to the user, then call create_client_invoice after explicit confirmation. It reserves the invoice number and preview for 30 minutes but creates no invoice, document, Income row, email, or payment.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taxPctNoTax percentage applied after markup and custom line items; use 0 for no tax.
reportIdYesSaved ExpenseBot report ID to invoice.
taxLabelNoTax label such as HST, GST, or VAT.
issueDateYesCalendar-valid invoice date in YYYY-MM-DD format.
markupPctNoMarkup applied only to rebilled expense rows.
clientNameYesFull client or business name shown on the invoice.
receiptIdsNoOptional exact report receipt IDs. Defaults to every current report expense.
billToEmailNoOptional client email printed on the invoice. This does not send email.
paymentTermsNoInvoice due terms. Defaults to the client's billing profile or net30.
clientAddressNoOptional billing address printed in the invoice's Bill To section.
invoiceNumberNoOptional custom invoice number. ExpenseBot allocates one when omitted.
advanceAppliedNoVerified client advance to apply against this invoice.
customLineItemsNoOptional fee/service lines. They are taxed but never marked up.
mentionSupportingReceiptsNoWhen true, note on the invoice that supporting receipts are available.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -{
      -  "additionalProperties": true,
      -  "description": "Standard ExpenseBot tool result envelope. `message` is the human-readable summary the AI cites; `data` is the structured payload (totals, breakdowns, ids, etc.). On failure, `success` is false and `error` carries a code/message/hint triple.",
      -  "properties": {
      -    "data": {
      -      "additionalProperties": true,
      -      "description": "Structured payload. Shape varies per tool — common keys: total, breakdown, comparison, sampleMeta, ids, expenseId, reportId, signupUrl, results.",
      -      "type": "object"
      -    },
      -    "error": {
      -      "additionalProperties": true,
      -      "description": "Present only when success === false.",
      -      "properties": {
      -        "code": {
      -          "type": "string"
      -        },
      -        "hint": {
      -          "type": "string"
      -        },
      -        "message": {
      -          "type": "string"
      -        }
      -      },
      -      "type": "object"
      -    },
      -    "message": {
      -      "description": "Human-readable result text. Always present on success; prefer rendering this verbatim before any further reasoning.",
      -      "type": "string"
      -    },
      -    "sampleMeta": {
      -      "additionalProperties": true,
      -      "description": "Set when the underlying dataset was truncated. isTruncated=true means the agent saw a sample of `sampleCount` of `totalCount` rows; aggregate totals are still accurate.",
      -      "properties": {
      -        "isTruncated": {
      -          "type": "boolean"
      -        },
      -        "sampleCount": {
      -          "type": "integer"
      -        },
      -        "totalCount": {
      -          "type": "integer"
      -        }
      -      },
      -      "type": "object"
      -    },
      -    "success": {
      -      "description": "False on tool errors; check before reading `data`.",
      -      "type": "boolean"
      -    }
      -  },
      -  "type": "object"
      -}New value: +null
  2. Changed6 schema fields changed
    • addedInput schema / properties / clientAddress / description
      Added value: +"Optional billing address printed in the invoice's Bill To section."
    • addedInput schema / properties / customLineItems / items / properties / amount / description
      Added value: +"Positive amount for this fee or service line in the invoice currency."
    • addedInput schema / properties / customLineItems / items / properties / description / description
      Added value: +"User-approved fee or service description shown on the invoice."
    • addedInput schema / properties / mentionSupportingReceipts / description
      Added value: +"When true, note on the invoice that supporting receipts are available."
    • addedInput schema / properties / paymentTerms / description
      Added value: +"Invoice due terms. Defaults to the client's billing profile or net30."
    • addedInput schema / properties / taxPct / description
      Added value: +"Tax percentage applied after markup and custom line items; use 0 for no tax."
  3. Changed1 schema field changed
    • addedInput schema / properties / issueDate / format
      Added value: +"date"
  4. Added

TDQS

A4.7/5.0
Behavior5/5

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

While annotations show readOnlyHint=false and destructiveHint=false, the description adds crucial behavior beyond the schema: it reserves an invoice number/preview, creates no final artifacts, and returns a short-lived preparationId. This disambiguates the side-effect picture even with the annotations present.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences cover the operation, the workflow, and the exact side-effect boundaries. Every clause carries critical information; no filler or repetition beyond the intentional emphasis on non-creation.

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 14-parameter tool with 100% schema coverage and no output schema, the description supplies the necessary override purpose, the sequencing, the time limit, and the key return values (exact totals, preparationId). Nothing required to invoke or orchestrate the tool 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?

The input schema already has 100% description coverage for all 14 parameters, so the baseline is 3. The description provides useful high-level context about validating the client ledger and reserve but adds no per-parameter semantics 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?

The description explicitly identifies the verb ('prepare'), the resource ('client invoice from a saved ExpenseBot report'), and the key constraint ('without creating it'). It clearly distinguishes itself from the sibling create_client_invoice, which an agent needs to call this and later call the create tool.

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 explicit workflow guidance: 'Call this first, show the preview to the user, then call create_client_invoice after explicit confirmation.' It also clarifies the reservation window ('30 minutes') and what is not created, preventing misuse.

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.

TDQS

A3.6/5.0
Disambiguation3/5

Most tools are explicitly scoped, but several analytics/retrieval tools overlap in purpose, such as get_spending_summary vs get_deep_analytics vs get_monthly_books_review, and generic search vs search_expenses vs search_knowledge. The detailed descriptions help, but an agent still has to carefully choose between near-equivalent options like correct_expenses vs update_expense and the three add_income variants.

Naming Consistency5/5

Tool names consistently use lower_snake_case with a recognizable verb prefix: get_*, list_*, add_*, create_*, check_*, scan_*, search_*, and whatif_*. Minor exceptions like fetch and search are still terse retrieval verbs rather than a different naming style, so the overall pattern is predictable.

Tool Count1/5

With 59 tools, this exceeds the 50+ threshold for an extreme tool count and creates a heavy selection surface for an agent. Even though ExpenseBot covers many subdomains, many get_/list_/add_ variants could be consolidated into fewer parameterized tools. The count undermines the otherwise clear naming structure.

Completeness3/5

The surface is strong for creating, reading, and updating expenses, reports, invoices, and Gmail scans, but there are notable lifecycle gaps: no delete/void tools for expenses, income, reports, or invoices, and no update tool for income. Several descriptions explicitly redirect unsupported edits to the web app, confirming that the assistant cannot complete those workflows directly.