Skip to main content
Glama

Preview Invoice Tool

preview-invoice
Read-only

Calculates a deterministic invoice preview without saving, charging, sending, or creating an invoice. Use to preview invoice in the connected business. Returns document_type, customer_id, pricing, persisted, charged, sent, scope.

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": {
      "customer_id": "<customer_id>",
      "items": "<items>"
    },
    "name": "preview-invoice"
  }
}

Input Schema

NameRequiredDescriptionDefault
itemsYesInvoice line items.
tax_modeNoTax calculation mode: none or manual.
coupon_codeNoOptional coupon code evaluated by the authorized pricing service.
customer_idYesResolved customer ID; required for an invoice preview.
tax_rate_idNoBusiness-owned tax rate identifier for manual tax calculation.
document_discount_typeNoDocument-wide discount mode: none, percentage, or fixed.
document_discount_valueNoDocument-wide discount amount or percentage for the selected discount mode.

Output Schema

NameRequiredDescriptionDefault
sentYesSent flag; previews do not perform this action.
scopeYesAuthorization scope of this result; data remains restricted to the connected business.
chargedYesCharged flag; previews do not perform this action.
pricingYesPricing data returned by the authorized safe projection.
persistedYesPersisted flag; previews do not perform this action.
customer_idYesCustomer id for the returned result.
document_typeYesType of the previewed document.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changed
    • addedInput schema / properties / coupon_code / description
      Added value: +"Optional coupon code evaluated by the authorized pricing service."
    • addedInput schema / properties / document_discount_type / description
      Added value: +"Document-wide discount mode: none, percentage, or fixed."
    • addedInput schema / properties / document_discount_value / description
      Added value: +"Document-wide discount amount or percentage for the selected discount mode."
    • addedInput schema / properties / tax_mode / description
      Added value: +"Tax calculation mode: none or manual."
    • addedInput schema / properties / tax_rate_id / description
      Added value: +"Business-owned tax rate identifier for manual tax calculation."
    • addedInput schema / required
      Added value: +[
      +  "customer_id",
      +  "items"
      +]
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "charged": {
      +      "description": "Charged flag; previews do not perform this action.",
      +      "enum": [
      +        false
      +      ],
      +      "type": "boolean"
      +    },
      +    "customer_id": {
      +      "description": "Customer id for the returned result.",
      +      "type": [
      +        "integer",
      +        "null"
      +      ]
      +    },
      +    "document_type": {
      +      "description": "Type of the previewed document.",
      +      "enum": [
      +        "invoice"
      +      ],
      +      "type": "string"
      +    },
      +    "persisted": {
      +      "description": "Persisted flag; previews do not perform this action.",
      +      "enum": [
      +        false
      +      ],
      +      "type": "boolean"
      +    },
      +    "pricing": {
      +      "description": "Pricing data returned by the authorized safe projection.",
      +      "type": "object"
      +    },
      +    "scope": {
      +      "description": "Authorization scope of this result; data remains restricted to the connected business.",
      +      "enum": [
      +        "connection_business"
      +      ],
      +      "type": "string"
      +    },
      +    "sent": {
      +      "description": "Sent flag; previews do not perform this action.",
      +      "enum": [
      +        false
      +      ],
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "document_type",
      +    "customer_id",
      +    "pricing",
      +    "persisted",
      +    "charged",
      +    "sent",
      +    "scope"
      +  ],
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.4/5.0
Behavior5/5

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

The annotations already declare readOnlyHint and non-destructive behavior, but the description adds concrete guarantees: deterministic calculation, no saving, charging, sending, or creating, and return flags persisted, charged, and sent. This tells the agent the preview is safe to run repeatedly and does not commit billable actions.

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 description uses three short sentences and front-loads the critical non-mutation guarantee. The final return-field list is somewhat redundant with the output schema, but overall the wording is efficient.

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 full input schema, read-only annotations, and existing output schema, the description supplies what structured fields do not: deterministic non-persistent preview semantics and explicit no-charge/no-send behavior. It is complete for calling this tool correctly.

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?

Schema description coverage is 100%, so the input schema already documents all seven parameters, including enums and nested item fields. The description does not add syntax or meaning beyond mentioning customer_id among the return fields, so it does not improve parameter semantics.

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 names a specific verb and resource: it calculates an invoice preview. It also distinguishes the tool from mutating invoice operations by stating it does not save, charge, send, or create an invoice. An agent can identify this as the non-persistent invoice calculation tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly says 'Use to preview invoice in the connected business' and clarifies that the operation has no side effects, giving clear context for when to choose it. It does not name a sibling alternative such as get-invoice or explain when not to use it, so guidance stops short of full routing.

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