add_line_item
Add a new line item to an existing invoice. Automatically recalculates invoice totals. Description supports multi-line: first line = bold title, lines after \\n = sub-description.
What add_line_item does
Adds or removes a sub-resource attached to a parent record (e.g. line items on an invoice, payment methods on a customer).
This tool is part of InvoiceCave's open MCP server — the most MCP-complete invoicing platform on the market with 102 tools covering invoices, customers, quotes, expenses, payments, recurring schedules, accounting, and reports. Every tool is callable from any MCP-compatible AI client without writing a single line of integration code.
How an AI uses add_line_item
Useful when the AI needs to incrementally build up a record — "add another hour of consulting to the existing invoice" — without rewriting the whole parent. All changes are reflected in the next list_* or get_* call.
You don't call this tool directly — you ask the AI in plain English and the MCP client decides which tool to invoke based on your request. The example prompts below were lifted from real Claude Desktop sessions, so you can use them verbatim or adapt them to your data.
Parameters
add_line_item accepts 5 parameters — 3 required, 2 optional. The AI fills these in from your natural-language prompt; you never write them by hand.
| Parameter | Type | Required | Description |
|---|---|---|---|
| invoiceId | string | required | Invoice ID to add line item to |
| description | string | required | MULTI-LINE: First line = bold title. Use \\n for sub-description. Example: "Graphics Package\\nProject: Sellwithmarino" |
| rate | number | required | Rate per unit |
| quantity | number | optional | Quantity (default 1) |
| tax | number | optional | Tax percentage |
Request example
Under the hood, your AI client sends a JSON-RPC 2.0 tools/call request to InvoiceCave's MCP endpoint at https://www.invoicecave.com/api/mcp/mcp. Here's what a add_line_item call looks like:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "add_line_item",
"arguments": {
"invoiceId": "inv_a1b2c3d4",
"description": "Thanks for your business",
"rate": 10,
"quantity": 30,
"tax": 10
}
}
}You won't write this yourself — it's shown so developers can see exactly what the MCP client generates. The arguments object maps 1:1 to the parameters above. Authentication is handled by the Authorization: Bearer header with your API key.
Example AI prompts
Type any of these into Claude Desktop, Claude Code, or Cursor — InvoiceCave's MCP server will route them to add_line_item automatically.
“Run the "add line item" action for me.”
Use it in 30 seconds
Related tools
More from the Items & Catalog category.
list_itemsList products/services (items) in the organization. Optionally search by name.
create_itemCreate a new product or service item.
edit_itemUpdate an existing product or service item.
delete_itemDelete a product or service item.
remove_line_itemRemove a line item from an invoice by index (0-based) or by matching description text. Recalculates totals.
update_line_itemUpdate a line item on an invoice. Find by index (0-based) or searchDescription. Can change description, quantity, rate, tax. Use this to fix mistakes instead of creating new invoices. Recalculates totals.
get_itemGet full details for a single product/service item by ID.
FAQ — add_line_item
What is add_line_item?▾
add_line_item is one of 102 tools in InvoiceCave's MCP server. Adds or removes a sub-resource attached to a parent record (e.g. line items on an invoice, payment methods on a customer). It's invoked automatically when an AI client like Claude or Cursor decides the user's request maps to this action.
Which AI clients can call add_line_item?▾
Any MCP-compatible client. We've tested it with Claude Desktop, Claude Code, Cursor, Windsurf, and Codex. The MCP protocol is open, so any AI tool that speaks MCP can call this endpoint with a valid InvoiceCave API key.
Is calling add_line_item secure?▾
Yes. Every call is authenticated by the API key you mint in the dashboard, scoped to a single organization, rate-limited per key, and recorded in the audit log with source='mcp'. Sensitive fields (SMTP passwords, encryption keys) are never returned to the AI client.
What parameters does add_line_item take?▾
add_line_item accepts 5 parameters — 3 required (invoiceId, description, rate) and 2 optional. The AI populates these from your plain-English prompt — see the parameter table and request example above.
Does add_line_item count against any quota?▾
MCP tool calls are unmetered on the free plan up to a generous monthly limit. Once you connect Stripe and start charging your customers, every call still counts against the same per-key rate limit but doesn't add to your bill.
Ready to wire this up?
Free plan — no credit card. 102 tools at your AI's disposal.