Skip to main content
Glama

createInvoiceItem

Add a custom item to a draft invoice, or a pending item to a subscription, billed on the subscription's next invoice. Returns the created item. Pass exactly one of invoiceItem.invoiceRef (from getInvoices, a draft) or invoiceItem.subscriptionRef (from getSubscriptions). Leave companyRef and membershipRef out: the owner comes from the invoice or the subscription. product.title is the item title, quantity a whole number, and unitAmount the price of one unit in major units (12.5 is 12.50). Pass tax.rate only to override the location tax rate; it has no effect when the location does not charge tax. The invoice totals are recalculated. Only a draft invoice can get a new item. The route is not idempotent: after a failure or timeout, check the result with the list tool before calling again, or a second record is created. Never invent UUIDs; only use values from prior tool responses.

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": {
      "invoiceItem": "<invoiceItem>"
    },
    "name": "createInvoiceItem"
  }
}

Input Schema

NameRequiredDescriptionDefault
invoiceItemYesInvoice line item to create.

Output Schema

NameRequiredDescriptionDefault
invoiceItemYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior4/5

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

Beyond the annotations (readOnlyHint=false, destructiveHint=false, openWorldHint=false), it discloses real behavioral traits: totals are recalculated, tax.rate has no effect where the location does not charge tax, and most importantly the route is not idempotent, with concrete retry guidance ('check the result with the list tool before calling again, or a second record is created'). The only mild gap is that it does not describe permission or auth requirements, but the non-idempotency warning is exactly the class of information annotations cannot carry.

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?

Purpose comes first, followed by identifier sourcing, field semantics, then side effects and retry warnings, so it is front-loaded and every sentence carries operational weight. It is a dense single block rather than separated clauses, which slightly impedes scanning for a tool with this much conditional logic, but no sentence is redundant.

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 nested-object mutation with an output schema present, the description covers what the agent needs to call it correctly: which reference to pick, which fields to suppress, pricing units, tax override scope, the draft-invoice precondition, and non-idempotent retry behavior. Return values need not be explained because the output schema carries them, and 'Returns the created item' is sufficient framing.

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?

Schema coverage is 100%, so a 3 would be the baseline, but the description adds meaning the schema cannot express: the exactly-one-of constraint between invoiceRef and subscriptionRef (the schema has no oneOf/allOf for this), the instruction to omit companyRef and membershipRef, the denomination example ('unitAmount the price of one unit in major units (12.5 is 12.50)'), and the limited scope of tax.rate as an override.

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 opens with a specific verb and two clearly bounded resources: 'Add a custom item to a draft invoice, or a pending item to a subscription, billed on the subscription's next invoice.' That second clause distinguishes it from the sibling createSubscriptionItem and from createInvoice, so an agent can route 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?

It states the exclusive selection rule ('Pass exactly one of invoiceItem.invoiceRef ... or invoiceItem.subscriptionRef'), names where each identifier must come from (getInvoices for a draft, getSubscriptions), and explicitly excludes optional fields ('Leave companyRef and membershipRef out'). It also states the precondition 'Only a draft invoice can get a new item', giving when-not guidance alongside when-to-use.

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