Skip to main content
Glama

Generate a Romanian e-Factura XML

generate_efactura
Read-onlyIdempotent

Builds a valid RO e-Factura (CIUS-RO 1.0.1, UBL 2.1) invoice XML from simple JSON: seller/buyer (just the CUI is enough: name, address, county code and VAT status are auto-filled from ANAF), lines with quantity, unit price and VAT rate (default 21%; categories S, Z, E, AE reverse charge, K, G, O not subject). Computes line, VAT and grand totals and returns the XML plus ANAF's validation verdict (public validation service). Does NOT submit to SPV. Costs 2 credits; not billed on errors or if ANAF's validator is unreachable (the XML is still returned).

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": {
      "number": "<number>",
      "seller": "<seller>",
      "buyer": "<buyer>",
      "lines": "<lines>"
    },
    "name": "generate_efactura"
  }
}

Input Schema

NameRequiredDescriptionDefault
noteNoFree-text note printed on the invoice
buyerYesSeller or buyer. A Romanian cui is enough when autofill is true
linesYesInvoice lines, 1 to 500
numberYesInvoice number, e.g. HTR-0001
sellerYesSeller or buyer. A Romanian cui is enough when autofill is true
dueDateNoPayment due date, YYYY-MM-DD
autofillNoFill Romanian parties from ANAF by CUI. Default true
currencyNoISO 4217 currency code. Default RON
issueDateNoIssue date, YYYY-MM-DD. Default today
paymentTermsNoPayment terms note. Default 'Plata la receptie / due on receipt' when dueDate is omitted
vatToRonRateNoRON per 1 unit of currency, e.g. the BNR rate. Required when currency is not RON

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed44 schema fields changed
    • changedInput schema / properties / autofill / description
      Previous value: -"Fill parties from ANAF by CUI (default true)"New value: +"Fill Romanian parties from ANAF by CUI. Default true"
    • addedInput schema / properties / buyer / description
      Added value: +"Seller or buyer. A Romanian cui is enough when autofill is true"
    • addedInput schema / properties / buyer / properties / bank / description
      Added value: +"Bank name printed next to the IBAN"
    • changedInput schema / properties / buyer / properties / city / description
      Previous value: -"For Bucharest use 'Sector N'"New value: +"City. For Bucharest use 'Sector N', e.g. Sector 1"
    • changedInput schema / properties / buyer / properties / country / description
      Previous value: -"ISO 2-letter, default RO"New value: +"ISO 3166-1 alpha-2 country code. Default RO"
    • changedInput schema / properties / buyer / properties / county / description
      Previous value: -"County name or code (Cluj, CJ, RO-CJ, B)"New value: +"Romanian county name or code: Cluj, CJ, RO-CJ, or B"
    • changedInput schema / properties / buyer / properties / cui / description
      Previous value: -"Romanian CUI; with autofill, name/address/VAT status come from ANAF"New value: +"Romanian CUI; with autofill, name, address and VAT status come from ANAF"
    • addedInput schema / properties / buyer / properties / email / description
      Added value: +"Contact email, optional"
    • changedInput schema / properties / buyer / properties / iban / description
      Previous value: -"Seller IBAN for payment"New value: +"Seller IBAN used as the payment account, e.g. RO49AAAA1B31007593840000"
    • addedInput schema / properties / buyer / properties / name / description
      Added value: +"Legal name. Required unless autofill can fill it from cui"
    • addedInput schema / properties / buyer / properties / phone / description
      Added value: +"Contact phone, optional"
    • addedInput schema / properties / buyer / properties / postalCode / description
      Added value: +"Postal code, e.g. 010101"
    • addedInput schema / properties / buyer / properties / street / description
      Added value: +"Street and number. Required unless autofill fills it"
    • changedInput schema / properties / buyer / properties / vatId / description
      Previous value: -"VAT id (e.g. RO14399840 or DE123456789 for foreign parties)"New value: +"VAT id, e.g. RO14399840 or DE123456789 for a foreign party"
    • addedInput schema / properties / buyer / properties / vatRegistered / description
      Added value: +"True when this party is VAT-registered. Autofill overwrites this from ANAF for Romanian CUIs"
    • changedInput schema / properties / currency / description
      Previous value: -"Default RON"New value: +"ISO 4217 currency code. Default RON"
    • addedInput schema / properties / dueDate / description
      Added value: +"Payment due date, YYYY-MM-DD"
    • changedInput schema / properties / issueDate / description
      Previous value: -"YYYY-MM-DD, default today"New value: +"Issue date, YYYY-MM-DD. Default today"
    • addedInput schema / properties / lines / description
      Added value: +"Invoice lines, 1 to 500"
    • addedInput schema / properties / lines / items / description
      Added value: +"One invoice line"
    • addedInput schema / properties / lines / items / properties / description / description
      Added value: +"Optional longer line description"
    • addedInput schema / properties / lines / items / properties / name / description
      Added value: +"Line item name, e.g. Consultanta"
    • addedInput schema / properties / lines / items / properties / quantity / description
      Added value: +"Quantity. Negative for a return or discount line"
    • changedInput schema / properties / lines / items / properties / unitCode / description
      Previous value: -"UN/ECE rec 20, default H87 (piece); HUR hour, KGM kg"New value: +"UN/ECE Rec 20 unit. Default H87 (piece); HUR hour, KGM kg"
    • addedInput schema / properties / lines / items / properties / unitPrice / description
      Added value: +"Unit price before VAT. Must be >= 0"
    • addedInput schema / properties / lines / items / properties / vatCategory / description
      Added value: +"VAT category: S standard, Z zero, E exempt, AE reverse charge, K intra-EU, G export, O not subject. Default S, or O when the seller is not VAT-registered"
    • addedInput schema / properties / lines / items / properties / vatRate / description
      Added value: +"VAT percent for category S. Default 21. Use 11, 19, 9 or 5 only when that rate applies"
    • addedInput schema / properties / note / description
      Added value: +"Free-text note printed on the invoice"
    • addedInput schema / properties / paymentTerms / description
      Added value: +"Payment terms note. Default 'Plata la receptie / due on receipt' when dueDate is omitted"
    • addedInput schema / properties / seller / description
      Added value: +"Seller or buyer. A Romanian cui is enough when autofill is true"
    • addedInput schema / properties / seller / properties / bank / description
      Added value: +"Bank name printed next to the IBAN"
    • changedInput schema / properties / seller / properties / city / description
      Previous value: -"For Bucharest use 'Sector N'"New value: +"City. For Bucharest use 'Sector N', e.g. Sector 1"
    • changedInput schema / properties / seller / properties / country / description
      Previous value: -"ISO 2-letter, default RO"New value: +"ISO 3166-1 alpha-2 country code. Default RO"
    • changedInput schema / properties / seller / properties / county / description
      Previous value: -"County name or code (Cluj, CJ, RO-CJ, B)"New value: +"Romanian county name or code: Cluj, CJ, RO-CJ, or B"
    • changedInput schema / properties / seller / properties / cui / description
      Previous value: -"Romanian CUI; with autofill, name/address/VAT status come from ANAF"New value: +"Romanian CUI; with autofill, name, address and VAT status come from ANAF"
    • addedInput schema / properties / seller / properties / email / description
      Added value: +"Contact email, optional"
    • changedInput schema / properties / seller / properties / iban / description
      Previous value: -"Seller IBAN for payment"New value: +"Seller IBAN used as the payment account, e.g. RO49AAAA1B31007593840000"
    • addedInput schema / properties / seller / properties / name / description
      Added value: +"Legal name. Required unless autofill can fill it from cui"
    • addedInput schema / properties / seller / properties / phone / description
      Added value: +"Contact phone, optional"
    • addedInput schema / properties / seller / properties / postalCode / description
      Added value: +"Postal code, e.g. 010101"
    • addedInput schema / properties / seller / properties / street / description
      Added value: +"Street and number. Required unless autofill fills it"
    • changedInput schema / properties / seller / properties / vatId / description
      Previous value: -"VAT id (e.g. RO14399840 or DE123456789 for foreign parties)"New value: +"VAT id, e.g. RO14399840 or DE123456789 for a foreign party"
    • addedInput schema / properties / seller / properties / vatRegistered / description
      Added value: +"True when this party is VAT-registered. Autofill overwrites this from ANAF for Romanian CUIs"
    • changedInput schema / properties / vatToRonRate / description
      Previous value: -"Required if currency != RON (RON per unit, e.g. BNR rate)"New value: +"RON per 1 unit of currency, e.g. the BNR rate. Required when currency is not RON"
  2. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Goes well beyond the supplied annotations: discloses credit cost (2 credits), the no-charge conditions (errors, unreachable validator), that the XML is still returned when validation fails, that totals are computed, and that Romanian party data is auto-filled from ANAF. The compute-only, non-persisting nature is consistent with readOnlyHint/idempotentHint, so nothing is contradicted.

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?

One dense, front-loaded paragraph: the artifact comes first, then inputs, then outputs, then cost — a sensible ordering. Parenthetical asides make some sentences heavy, but essentially every clause carries operational information.

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?

There is no output schema, yet the description compensates fully by stating the return payload (XML plus ANAF validation verdict) and the partial-failure behavior. Combined with the cost model and the ANAF autofill dependency, an agent has everything needed to call this correctly on a nested, 11-parameter tool.

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 coverage is 100% and the schema is richly annotated, so the baseline is 3. The description restates the key semantics (CUI autofill, default 21% VAT, the S/Z/E/AE/K/G/O category set) but adds no format or edge-case detail the schema does not already carry.

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?

States a specific verb and artifact (builds a valid RO e-Factura XML) plus the standards it conforms to (CIUS-RO 1.0.1, UBL 2.1) and its input shape (simple JSON). The closing 'Does NOT submit to SPV' carves out clear space from adjacent validation/submission-style siblings.

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?

Gives concrete when-to-use context: build an XML from JSON, with an optional ANAF validation pass, and an explicit exclusion that it does not submit to SPV (so submission is elsewhere). It stops short of naming a specific alternative sibling such as validate_efactura or efactura_to_pdf for the follow-on steps.

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.