Skip to main content
Glama

Apply provisions to invoice

apply_provisions_to_invoice

Deduct one or more PAID provisions from a DRAFT final invoice of the same client (and of the same matter when one is attached). Updates the invoice's advances_total and amount_due. Reversible while the invoice is still Draft (remove_provision_from_invoice).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
invoice_idYesThe Draft final invoice UUID.
provision_idsYesPaid provision UUIDs to apply (use list_available_provisions).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
amount_dueYesGross total minus applied provisions, in the document currency.
advances_totalYesSum of provisions now applied to the invoice, in the document currency.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "advances_total": {
      +      "description": "Sum of provisions now applied to the invoice, in the document currency.",
      +      "type": "number"
      +    },
      +    "amount_due": {
      +      "description": "Gross total minus applied provisions, in the document currency.",
      +      "type": "number"
      +    }
      +  },
      +  "required": [
      +    "advances_total",
      +    "amount_due"
      +  ],
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.8/5.0
Behavior4/5

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

The description discloses the main side effects (updates advances_total and amount_due) and reversibility, which is helpful given the sparse annotations. It does not mention edge cases like duplicate applications or invalid invoice state, but the core behavior is transparent enough for correct invocation.

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 concise, using three short sentences that cover purpose, effect, and reversibility without redundant wording. It is well-structured and easy to parse.

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?

The description covers the essential invocation context: prerequisites (DRAFT, PAID, same client/matter), the effect on invoice totals, and the reversal path. With input schema coverage at 100% and an output schema present, no critical information is missing for correct use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Both parameters are fully described in the schema: invoice_id is clearly identified as the Draft final invoice UUID, and provision_ids is described as Paid provision UUIDs with a direct pointer to list_available_provisions. No additional parameter explanation is needed.

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 the action (deduct provisions), the target (DRAFT final invoice), the constraints (PAID provisions, same client/matter), and the effect (updates advances_total and amount_due). It also distinguishes itself from the sibling remove_provision_from_invoice by explicitly naming it as the reversal operation.

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?

The description provides clear usage conditions: apply only PAID provisions to a DRAFT final invoice of the same client/matter. It also references list_available_provisions as the source for provision IDs and notes the operation is reversible via remove_provision_from_invoice, giving the agent sufficient guidance on when and how to use it.

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.