Skip to main content
Glama

Add line item (draft)

add_invoice_item

Add a line item to a Draft invoice. Totals are recalculated automatically.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
quantityNoQuantity billed. Required for 'item' lines.
tax_rateNoOMIT - do NOT ask the user for a VAT rate. VAT is determined server-side by strict fiscal rules (default rate + automatic 0% for reverse-charge/export scenarios). Only set when the user explicitly states a rate, as a percent (0-100).
line_typeNoLine kind: 'item' (billable, needs quantity and unit_price), 'section' (visual header) or 'description' (text-only sub-line). Defaults to 'item'.
invoice_idYesThe Draft invoice UUID.
unit_priceNoUnit price excl. VAT, in the invoice currency. Required for 'item' lines.
descriptionYesLine text printed on the invoice (1-500 characters).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesLine item UUID.
quantityYesQuantity, null for section/description lines.
tax_rateYesVAT rate in percent, null for non-item lines.
line_typeYesLine kind: item, section or description.
created_atYesCreation timestamp (ISO 8601).
invoice_idYesParent invoice UUID.
line_totalYesLine total incl. VAT, null for non-item lines.
product_idYesLinked product UUID, if any.
unit_priceYesUnit price excl. VAT, null for non-item lines.
updated_atYesLast update timestamp (ISO 8601).
descriptionYesLine text.
tax_rate_keyYesVAT rate key (e.g. standard, reduced), null for non-item lines.
display_orderYes0-based position on the document.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changed
    • addedInput schema / properties / description / description
      Added value: +"Line text printed on the invoice (1-500 characters)."
    • addedInput schema / properties / invoice_id / description
      Added value: +"The Draft invoice UUID."
    • changedInput schema / properties / line_type / description
      Previous value: -"Defaults to 'item'."New value: +"Line kind: 'item' (billable, needs quantity and unit_price), 'section' (visual header) or 'description' (text-only sub-line). Defaults to 'item'."
    • changedInput schema / properties / quantity / description
      Previous value: -"Required for 'item' lines."New value: +"Quantity billed. Required for 'item' lines."
    • changedInput schema / properties / tax_rate / description
      Previous value: -"OMIT — do NOT ask the user for a VAT rate. VAT is determined server-side by strict fiscal rules (default rate + automatic 0% for reverse-charge/export scenarios). Only set when the user explicitly states a rate."New value: +"OMIT - do NOT ask the user for a VAT rate. VAT is determined server-side by strict fiscal rules (default rate + automatic 0% for reverse-charge/export scenarios). Only set when the user explicitly states a rate, as a percent (0-100)."
    • changedInput schema / properties / unit_price / description
      Previous value: -"Required for 'item' lines."New value: +"Unit price excl. VAT, in the invoice currency. Required for 'item' lines."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "created_at": {
      +      "description": "Creation timestamp (ISO 8601).",
      +      "type": "string"
      +    },
      +    "description": {
      +      "description": "Line text.",
      +      "type": "string"
      +    },
      +    "display_order": {
      +      "description": "0-based position on the document.",
      +      "type": "number"
      +    },
      +    "id": {
      +      "description": "Line item UUID.",
      +      "type": "string"
      +    },
      +    "invoice_id": {
      +      "description": "Parent invoice UUID.",
      +      "type": "string"
      +    },
      +    "line_total": {
      +      "anyOf": [
      +        {
      +          "type": "number"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Line total incl. VAT, null for non-item lines."
      +    },
      +    "line_type": {
      +      "description": "Line kind: item, section or description.",
      +      "type": "string"
      +    },
      +    "product_id": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Linked product UUID, if any."
      +    },
      +    "quantity": {
      +      "anyOf": [
      +        {
      +          "type": "number"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Quantity, null for section/description lines."
      +    },
      +    "tax_rate": {
      +      "anyOf": [
      +        {
      +          "type": "number"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "VAT rate in percent, null for non-item lines."
      +    },
      +    "tax_rate_key": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "VAT rate key (e.g. standard, reduced), null for non-item lines."
      +    },
      +    "unit_price": {
      +      "anyOf": [
      +        {
      +          "type": "number"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Unit price excl. VAT, null for non-item lines."
      +    },
      +    "updated_at": {
      +      "description": "Last update timestamp (ISO 8601).",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "id",
      +    "invoice_id",
      +    "line_type",
      +    "description",
      +    "quantity",
      +    "unit_price",
      +    "tax_rate",
      +    "tax_rate_key",
      +    "line_total",
      +    "display_order",
      +    "product_id",
      +    "created_at",
      +    "updated_at"
      +  ],
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.1/5.0
Behavior3/5

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

The description discloses that totals are recalculated automatically, adding some behavioral context beyond the annotations. It does not contradict the readOnlyHint=false or destructiveHint=false annotations, but could mention rejection behavior for non-Draft invoices.

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 tool description is concise and front-loaded with the action and target. Parameter descriptions are informative without being bloated or redundant.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description and parameter metadata cover the operation well for a simple add-item workflow, including the Draft-invoice constraint and automatic recalculation. It does not explain error conditions, but an output schema exists so return details are not required.

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?

Every parameter has a meaningful description, including conditional requirements (e.g., quantity and unit_price required for 'item' lines), enum semantics for line_type, and explicit guidance on tax_rate. This adds substantial clarity beyond the raw schema.

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?

Clearly states the action ('Add a line item') and the target resource ('a Draft invoice'), distinguishing it from sibling tools like update_invoice_item, delete_invoice_item, and reorder_invoice_items.

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 the tool is only for Draft invoices and mentions automatic total recalculation, but it does not explicitly contrast with alternative tools or state when not 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.