Skip to main content
Glama

regenerate_invoice

Destructive

Regenerate the PDF for an invoice by id. Overwrites the stored billing details on the invoice with the current ones from the source payment and its customer, overwrites the PO number when the payment has one, and fills in the customer email, customer name and product title only where the invoice has none. It then replaces the existing hosted PDF - the previous PDF is not kept. Preserves line items, amounts, taxes, and status. The returned invoiceUrl is a fresh signed link.

Input Schema

NameRequiredDescriptionDefault
idYesThe ID of the invoice to regenerate.

Output Schema

NameRequiredDescriptionDefault
dataYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedOutput schema / properties / data / properties / processingFeeContribution
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": false,
      +      "properties": {
      +        "amount": {
      +          "description": "Contribution in the smallest currency unit.",
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "name": {
      +          "description": "Name shown on the invoice, frozen at payment.",
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        }
      +      },
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "What the customer chose to add to cover the processing fee, added after tax and never taxed. Not one of `fees`."
      +}
  2. Changed1 schema field changed
    • changedOutput schema / properties / data / properties / fees / anyOf
      Previous value: -[
      -  {
      -    "items": {
      -      "additionalProperties": false,
      -      "properties": {
      -        "amount": {
      -          "description": "Fee amount in the smallest currency unit.",
      -          "type": [
      -            "number",
      -            "null"
      -          ]
      -        },
      -        "name": {
      -          "description": "Display name for the fee (e.g. \"Shipping\", \"Processing\").",
      -          "type": [
      -            "string",
      -            "null"
      -          ]
      -        },
      -        "percentage": {
      -          "description": "Fee as a percentage of the subtotal (0-100), when defined that way.",
      -          "type": [
      -            "number",
      -            "null"
      -          ]
      -        }
      -      },
      -      "type": "object"
      -    },
      -    "type": "array"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "items": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "amount": {
      +          "description": "Fee amount in the smallest currency unit. For a fee with both a percentage and a fixed amount, the sum of `percentageAmount` and `fixedAmount`.",
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "fixedAmount": {
      +          "description": "The fixed part of `amount`, in the smallest currency unit, already multiplied by quantity or tickets when the fee multiplies. Only set on a fee with both a percentage and a fixed amount.",
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "name": {
      +          "description": "Display name for the fee (e.g. \"Shipping\", \"Processing\").",
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "percentage": {
      +          "description": "Fee as a percentage of the subtotal (0-100), when defined that way.",
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "percentageAmount": {
      +          "description": "The part of `amount` from the percentage, in the smallest currency unit. Only set on a fee with both a percentage and a fixed amount. Can be 0, e.g. when a 100% coupon leaves nothing for the percentage to apply to.",
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "type": "array"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
  3. First observed

TDQS

A4.3/5.0
Behavior5/5

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

Annotations already mark this as destructive and non-read-only, but the description adds substantial context: it overwrites billing details and PO numbers, fills missing customer fields only when absent, replaces the existing hosted PDF without keeping the prior version, preserves line items/amounts/taxes/status, and returns a fresh signed URL.

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 front-loads the core action and then details destructive effects in a logical order. Every sentence adds relevant information, and there is no filler or repetition.

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?

With annotations covering safety semantics and an output schema covering return structure, the description fills the remaining gap by explaining exactly what data is overwritten, what is preserved, and what happens to the previous PDF. It is complete for this operation.

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?

There is one required parameter, id, and schema coverage is 100%. The description says 'by id' but adds no format, source, or lookup semantics beyond what the schema already provides, so the baseline of 3 for high schema coverage is appropriate.

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: 'Regenerate the PDF for an invoice by id.' It clearly distinguishes the operation from read-only siblings like get_invoice and list_invoices by describing the regeneration and overwrite behavior.

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

Usage Guidelines3/5

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

The description implies when the tool is useful, namely when an invoice's stored billing details or hosted PDF need refreshing from current payment/customer data. However, it does not explicitly state when to choose this over alternatives such as updating an invoice or fetching it, so usage is only implied.

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