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.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
previewYes
successYes
expiresAtYes
preparationIdYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "properties": {
      +    "expiresAt": {
      +      "format": "date-time",
      +      "type": "string"
      +    },
      +    "preparationId": {
      +      "type": "string"
      +    },
      +    "preview": {
      +      "additionalProperties": true,
      +      "properties": {
      +        "advanceApplied": {
      +          "type": "number"
      +        },
      +        "balanceDue": {
      +          "type": "number"
      +        },
      +        "clientName": {
      +          "type": "string"
      +        },
      +        "clientTag": {
      +          "type": "string"
      +        },
      +        "currency": {
      +          "type": "string"
      +        },
      +        "customLineCount": {
      +          "minimum": 0,
      +          "type": "integer"
      +        },
      +        "dueDate": {
      +          "format": "date",
      +          "type": "string"
      +        },
      +        "expenseCount": {
      +          "minimum": 0,
      +          "type": "integer"
      +        },
      +        "grandTotal": {
      +          "type": "number"
      +        },
      +        "hasTaxRegistration": {
      +          "type": "boolean"
      +        },
      +        "invoiceNumber": {
      +          "type": "string"
      +        },
      +        "issueDate": {
      +          "format": "date",
      +          "type": "string"
      +        },
      +        "markupAmount": {
      +          "type": "number"
      +        },
      +        "markupPct": {
      +          "type": "number"
      +        },
      +        "paymentTerms": {
      +          "type": "string"
      +        },
      +        "reportId": {
      +          "type": "string"
      +        },
      +        "reportTitle": {
      +          "type": "string"
      +        },
      +        "subtotal": {
      +          "type": "number"
      +        },
      +        "taxAmount": {
      +          "type": "number"
      +        },
      +        "taxConfirmationRequired": {
      +          "type": "boolean"
      +        },
      +        "taxLabel": {
      +          "type": "string"
      +        },
      +        "taxPct": {
      +          "type": "number"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "success": {
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "success",
      +    "preparationId",
      +    "expiresAt",
      +    "preview"
      +  ],
      +  "type": "object"
      +}
  2. 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
  3. 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."
  4. Changed1 schema field changed
    • addedInput schema / properties / issueDate / format
      Added value: +"date"
  5. Added

TDQS

A4.9/5.0
Behavior5/5

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

The annotations already state destructiveHint=false and openWorldHint=false, but the description adds the crucial contract: it reserves the invoice number and preparationId for 30 minutes, returns no persistence, and explicitly lists what it does not create ('no invoice, document, Income row, email, or payment'). This is substantive behavioral transparency beyond the annotations.

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?

The description is dense but every sentence earns its place: purpose, behavior, workflow, and side-effect limitations are all front-loaded and concise. It avoids padding while covering a multi-step, state-reserving operation.

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?

Given the lifecycle complexity (requirements parameters, short-lived reservation, and linking to create_client_invoice), the description gives the exact sequence and side-effect model needed to call it correctly. Output schema already covers return values, so missing return details are not a gap.

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?

Although the schema already documents all 14 parameters thoroughly (100% coverage), the description enriches the meaning of key parameters by explaining canonical report rows, unique invoice number allocation, client ledger verification, advance verification, and preparationId. That moves it beyond a bare schema restatement.

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 clearly states a specific action ('Prepare a client invoice'), the resource ('a saved ExpenseBot report'), and the key constraint ('without creating it'). It also distinguishes itself from the sibling create_client_invoice by defining the prepare-then-confirm workflow, so an agent can select this tool rather than its sibling.

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 ordering and conditions: 'Call this first, show the preview to the user, then call create_client_invoice after explicit confirmation.' This directly tells the agent when to use this tool and when the alternative applies, leaving no ambiguity.

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.