Skip to main content
Glama

create_client_invoice

Destructive

Create the exact invoice previously returned by prepare_client_invoice. This is a confirmed write: it revalidates the report snapshot and client identity, creates a private editable Google Doc plus private PDF and DOCX copies, records the issued invoice, and supersedes an older active invoice for the same report. It does not send email or create an Income row. If tax is positive, confirmTax must be true.

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": {
      "preparationId": "<preparationId>"
    },
    "name": "create_client_invoice"
  }
}

Input Schema

NameRequiredDescriptionDefault
confirmTaxNoTrue only after the user confirms the displayed tax label and rate.
operationIdNoOptional retry key. Reuse it after an uncertain response.
preparationIdYesShort-lived ID returned by prepare_client_invoice.

Output Schema

NameRequiredDescriptionDefault
totalNo
pdfUrlNo
statusNo
docxUrlNo
dueDateNo
successYes
currencyNo
invoiceIdNo
issueDateNo
recoveredNo
clientNameNo
grandTotalNo
documentUrlNo
invoiceNumberNo
advanceAppliedNo
sourceReportIdNo
artifactWarningNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • removedOutput schema / properties / dueDate / format
      Removed value: -"date"
    • removedOutput schema / properties / issueDate / format
      Removed value: -"date"
  2. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "properties": {
      +    "advanceApplied": {
      +      "type": "number"
      +    },
      +    "artifactWarning": {
      +      "type": "string"
      +    },
      +    "clientName": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "currency": {
      +      "type": "string"
      +    },
      +    "documentUrl": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "docxUrl": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "dueDate": {
      +      "format": "date",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "grandTotal": {
      +      "type": "number"
      +    },
      +    "invoiceId": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "invoiceNumber": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "issueDate": {
      +      "format": "date",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "pdfUrl": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "recovered": {
      +      "type": "boolean"
      +    },
      +    "sourceReportId": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "status": {
      +      "type": "string"
      +    },
      +    "success": {
      +      "type": "boolean"
      +    },
      +    "total": {
      +      "type": "number"
      +    }
      +  },
      +  "required": [
      +    "success"
      +  ],
      +  "type": "object"
      +}
  3. 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
  4. Changed16 schema fields changed
    • addedInput schema / additionalProperties
      Added value: +false
    • removedInput schema / properties / advanceApplied
      Removed value: -{
      -  "minimum": 0,
      -  "type": "number"
      -}
    • removedInput schema / properties / billToEmail
      Removed value: -{
      -  "type": "string"
      -}
    • removedInput schema / properties / clientAddress
      Removed value: -{
      -  "type": "string"
      -}
    • removedInput schema / properties / clientName
      Removed value: -{
      -  "description": "In in-app chat, the full client name shown on the invoice.",
      -  "type": "string"
      -}
    • removedInput schema / properties / customLineItems
      Removed value: -{
      -  "items": {
      -    "properties": {
      -      "amount": {
      -        "exclusiveMinimum": 0,
      -        "type": "number"
      -      },
      -      "description": {
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "description",
      -      "amount"
      -    ],
      -    "type": "object"
      -  },
      -  "maxItems": 25,
      -  "type": "array"
      -}
    • removedInput schema / properties / invoiceNumber
      Removed value: -{
      -  "type": "string"
      -}
    • removedInput schema / properties / issueDate
      Removed value: -{
      -  "description": "In in-app chat, a calendar-valid YYYY-MM-DD invoice date.",
      -  "type": "string"
      -}
    • removedInput schema / properties / markupPct
      Removed value: -{
      -  "maximum": 100,
      -  "minimum": 0,
      -  "type": "number"
      -}
    • removedInput schema / properties / mentionSupportingReceipts
      Removed value: -{
      -  "type": "boolean"
      -}
    • removedInput schema / properties / paymentTerms
      Removed value: -{
      -  "enum": [
      -    "due_on_receipt",
      -    "net7",
      -    "net14",
      -    "net15",
      -    "net30",
      -    "net45",
      -    "net60"
      -  ],
      -  "type": "string"
      -}
    • removedInput schema / properties / receiptIds
      Removed value: -{
      -  "items": {
      -    "type": "string"
      -  },
      -  "type": "array"
      -}
    • removedInput schema / properties / reportId
      Removed value: -{
      -  "description": "In in-app chat, the saved report ID to prepare and confirm.",
      -  "type": "string"
      -}
    • removedInput schema / properties / taxLabel
      Removed value: -{
      -  "type": "string"
      -}
    • removedInput schema / properties / taxPct
      Removed value: -{
      -  "maximum": 100,
      -  "minimum": 0,
      -  "type": "number"
      -}
    • addedInput schema / required
      Added value: +[
      +  "preparationId"
      +]
  5. Added

TDQS

A4.9/5.0
Behavior5/5

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

Annotations only mark it destructive/open-world/non-readonly; the description adds the concrete consequences an agent needs: it revalidates the report snapshot and client identity, produces a private editable Google Doc plus private PDF and DOCX copies, records the issued invoice, and supersedes an older active invoice for the same report. The explicit statement of what it does NOT do (email, Income row) is exactly the kind of side-effect boundary the annotations cannot convey.

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 first sentence establishes the prerequisite, the second front-loads the write semantics and side effects, the third narrows scope, and the fourth gives the tax gate. No sentence is redundant and each carries a distinct constraint.

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 destructive, open-world write with an output schema and fully documented parameters, the description covers prerequisites, side effects, supersession of prior invoices, and explicit non-actions. An agent has everything needed to decide whether to call it and what state it will leave behind, without needing the return shape spelled out.

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 semantics beyond the schema by making confirmTax a conditional requirement tied to positive tax rather than a freely optional flag, and by restating preparationId's provenance. The operationId retry key is left entirely to the schema, which is acceptable but leaves one parameter uncontextualized in the description.

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 ('Create the exact invoice') and anchors it to the sibling that produces its input ('previously returned by prepare_client_invoice'), so an agent can distinguish it from prepare_client_invoice and get_client_invoice without opening a schema.

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?

Explicitly names the required predecessor (prepare_client_invoice) and states two exclusions the agent would otherwise assume: 'It does not send email or create an Income row.' It also gives a conditional gate ('If tax is positive, confirmTax must be true'), so the when-to-use and when-not-to-call conditions are both covered.

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.