Skip to main content
Glama
Storno CLI

Storno CLI

Official
by stornoro

invoices_create

Create a draft invoice with line items and a client or receiver, then edit it until issued; use invoices_issue to finalize and generate XML/PDF.

Instructions

Create a new draft invoice. Requires at least one line item and either a clientId or receiverName/receiverCif. The invoice starts in "draft" status and can be edited until issued. Use invoices_issue to finalize and generate XML/PDF.

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": {
      "issueDate": "<issueDate>",
      "lines": "<lines>"
    },
    "name": "invoices_create"
  }
}

Input Schema

NameRequiredDescriptionDefault
linesYesInvoice line items (at least one required)
notesNoPublic notes visible to the client
collectNoRecord an immediate payment. Pass true for full payment with defaults, or an object with value/type/issueDate/documentNumber/mentions for details.
dueDateNoPayment due date in ISO 8601 format (YYYY-MM-DD)
clientIdNoClient UUID (from clients_list). Either clientId or receiverName should be provided.
currencyNoISO 4217 currency code (default: RON)
issuerIdNoIssuer ID number
languageNoDocument language for PDF generation (default: ro)
mentionsNoAdditional legal mentions on the invoice
seriesIdNoInvoice series UUID (from document_series_list). Uses default if not provided.
companyIdNoCompany UUID override (uses active company if not set)
issueDateYesInvoice issue date in ISO 8601 format (YYYY-MM-DD)
deputyAutoNoDeputy vehicle registration number
deputyNameNoDeputy/representative name
issuerNameNoName of person issuing the invoice
salesAgentNoSales agent name
orderNumberNoPurchase order number
plataOnlineNoEnable online payment via Stripe (default: from company settings)
platitorTvaNoWhether sender is VAT payer (default: false)
receiverCifNoReceiver tax ID / CIF (used together with receiverName when no client entity exists)
vatIncludedNoWhen used with autoApplyVatRules, sets whether unit prices include VAT on all lines. Ensures correct totals after VAT rules change rates.
documentTypeNoDocument type (default: invoice)
exchangeRateNoExchange rate relative to RON (default: 1.0)
internalNoteNoInternal note (not visible to the client)
paymentTermsNoPayment terms description (e.g., "Net 30")
receiverNameNoReceiver name (used when no client entity exists). Either clientId or receiverName should be provided.
taxPointDateNoTax point date if different from issue date (YYYY-MM-DD)
paymentMethodNoPayment method: bank_transfer (default), cash, card, cheque, other
tvaLaIncasareNoVAT on collection / TVA la încasare (default: false)
ublExtensionsNoUBL extension fields for advanced e-Factura compliance. These map directly to UBL XML elements not covered by the standard invoice fields.
buyerReferenceNoBuyer reference identifier (BT-10)
contractNumberNoContract reference number
idempotencyKeyNoIdempotency key to prevent duplicate creation. Scoped to the company: the same key on another company creates a separate invoice. A retry with the same key returns the first invoice, and collect is not applied again once the invoice has a payment.
penaltyEnabledNoEnable late payment penalty (default: false)
invoiceTypeCodeNoTax regime / invoice type code. standard = default commercial invoice; reverse_charge = taxare inversa; the other values map to specific Romanian tax-code articles.
deliveryLocationNoDelivery address
parentDocumentIdNoParent document UUID (required for credit notes / refunds)
penaltyGraceDaysNoGrace period in days before penalty starts applying
projectReferenceNoProject reference number
taxPointDateCodeNoTax point date code
autoApplyVatRulesNoAuto-apply VAT rules (reverse charge for VIES-valid EU clients, OSS destination rate for non-VIES EU clients). Default: false.
showClientBalanceNoShow client balance on invoice (default: false)
deputyIdentityCardNoDeputy ID card number
businessProcessTypeNoBusiness process type (e.g., "urn:cen.eu:en16931:2017#compliant#urn:efactura.mfinante.ro:CIUS-RO:1.0.1")
penaltyPercentPerDayNoDaily penalty percentage (e.g., 0.05 for 0.05% per day)
tenderOrLotReferenceNoTender or lot reference
despatchAdviceReferenceNoDespatch advice reference
buyerAccountingReferenceNoBuyer accounting reference
invoicedObjectIdentifierNoInvoiced object identifier
receivingAdviceReferenceNoReceiving advice reference

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv1.0.59
    • changedInput schema / properties / idempotencyKey / description
      Previous value: -"Idempotency key to prevent duplicate creation"New value: +"Idempotency key to prevent duplicate creation. Scoped to the company: the same key on another company creates a separate invoice. A retry with the same key returns the first invoice, and collect is not applied again once the invoice has a payment."
    • addedInput schema / properties / lines / items / properties / vatCategoryCode
      Added value: +{
      +  "description": "UBL VAT category code. Default S; a 0% rate becomes Z on its own. Set it only for special cases: O (not subject to VAT), E (exempt), AE (reverse charge), K (intra-community), G (export).",
      +  "type": "string"
      +}
    • addedInput schema / properties / lines / items / properties / vatRate
      Added value: +{
      +  "description": "VAT percentage for the line, e.g. 21, 11, 9 or 0. Wins over vatRateId. With neither sent the line gets 21%, so for a company that is not a VAT payer always send 0.",
      +  "type": "number"
      +}
    • changedInput schema / properties / lines / items / properties / vatRateId / description
      Previous value: -"VAT rate UUID (from vat_rates_list). Uses company default if not provided."New value: +"VAT rate UUID from vat_rates_list: the line takes that rate's percentage and category. Send this or vatRate. With neither, the line gets 21% VAT, also when the company is not a VAT payer."
  2. First observedv1.0.17

TDQS

A4.1/5.0
Behavior4/5

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

Annotations only declare the safety profile (readOnlyHint=false, destructiveHint=false); the description adds genuinely new behavior — the record is born in "draft" and stays mutable until issued, which explains why a create call is non-destructive. It says nothing about the idempotencyKey parameter's de-duplication behavior or about what the call returns, leaving some gaps.

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?

Four short sentences, front-loaded with the action, then prerequisites, lifecycle state, and the hand-off sibling in a logical order. Every sentence carries distinct information and nothing is padded.

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

Completeness3/5

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

For a 50-parameter creation tool with deep nested UBL objects and no output schema, the definition is thin: it omits the idempotencyKey contract, the credit_note/parentDocumentId relationship, and any hint of what a successful response contains (e.g., invoice ID for the follow-up issue step). The essentials for a minimal call are present, but not enough for the tool's complexity.

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?

Schema description coverage is 100% across 50 parameters with rich nested objects, so the schema carries the semantics. The description only restates the required-parameter constraints (lines, clientId vs receiverName/receiverCif) already visible in the schema, adding no format or interaction guidance for the many optional fields.

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 first sentence gives a specific verb and resource ("Create a new draft invoice") and the last names the sibling that advances the lifecycle (invoices_issue), so an agent can separate creation from issuance without reading either schema. The draft-state framing further distinguishes it from a finalizing or bulk tool.

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

Usage Guidelines4/5

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

Prerequisites are explicit (at least one line item, plus clientId or receiverName/receiverCif) and the alternative is named with the reason to switch to invoices_issue. It does not address when to prefer proforma_invoices_create or recurring_invoices_create instead, so it falls short of full when/when-not coverage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools