Skip to main content
Prepare and issue the company’s invoices. prepare saves an unnumbered draft (from_invoice_id copies one); correct drafts the corrective invoice of an issued one. issue registers the exact saved version from get only when the owner asks from this client; a draft request does not authorize it. Report it issued only once its registration, PDF and delivery states say so; after an uncertain answer retry the same invoice and version. void cancels for good an issued invoice that should never have existed (issued twice, a test, an operation that never happened), only when the owner asks, with their reason; a wrong amount, a paid invoice or one in an approved or filed quarter needs correct instead. Actions (* required): prepare(issue_date*, …); issue(id*, expected_version*); void(id*, expected_version*, reason*); correct(invoice_id*, customer_id*, issue_date*, lines*, activity_id, due_date, irpf_rate, notes). Availability: Self-employed / Company. Issuing sends the invoice to VERI*FACTU through Melso’s own sender, and only the owner issues it. Your own system can do the same with the Melso API. The live tool list is authoritative: the company’s plan and your role can narrow this contract. Understand access.

When to use

Use invoices for correct, issue, prepare, void. Use invoices_read for the companion actions. The live tool list determines availability.

Input

Actions

The tool’s schema combines the fields of every action. Each action accepts only its own fields below; send action with them.

Write actions

These actions change data. The server lists them only with a plan that includes the tools.
Prepare a corrective draft with signed financial differences referencing an issued original. Negative unit prices credit or cancel the original; positive prices increase the amount. For a full credit of 1200 EUR, use unit_price=-1200 with positive quantity. The original stays immutable. Request human approval again.
Issue the exact saved invoice version when its owner explicitly asks, through the owner’s external Melso OAuth connection. Read get first and pass its version unchanged as expected_version. Requires paid tools and verified supplier authority. Reserves one legal number and makes its legal PDF; once the owner authorized the company’s certificate it records it in the company’s VERIFACTU chain and sends it to the AEAT, and otherwise issues it without VERIFACTU (verifactu_status none), as the invoices page does. Configured payment-link creation and email delivery may follow registration. Read verifactu_status, pdf_ready and delivery state: a reserved number or pending provider is not confirmed registration or delivery. Retry only this same id and expected_version after an uncertain response; never prepare a replacement. No action approves, files or pays a tax return.
Validate an invoice and save an unnumbered draft (or replace an unapproved draft via id). It needs customer_id and lines, or from_invoice_id to repeat an earlier invoice. Never issues, sends or records VeriFactu. Read the saved draft and, when the owner asks to issue it, use issue with its version as expected_version. request_approval offers web review instead.
Void (anular) an issued invoice that should never have existed, only when its owner explicitly asks in this conversation: a duplicate, a test, or a service or sale that never happened. Ask for the reason in the owner’s words and pass it. Read get first and pass its version unchanged as expected_version. Never for a wrong amount, customer or date: prepare a corrective invoice instead (correct). Refused for a paid invoice, one the bank collected (even in part), one a corrective invoice already corrects, one whose quarter or year has an approved or filed return, one whose record still waits for the AEAT, or one not registered by Melso’s own VERIFACTU sender. The invoice becomes void, its VERIFACTU cancellation record goes to the AEAT, it leaves the books and the returns, and its number is never reused; it cannot be undone here.

Output

prepare and correct return a saved unnumbered draft. issue reserves a legal number and submits the invoice; read verifactu_status, pdf_ready and delivery state before reporting confirmed registration. The result uses MCP content blocks; JSON payloads are encoded in text and may also appear in structuredContent. Check isError before reading a success payload. When the server declares an outputSchema, it is reproduced below. Check the action result and its declared fields before reporting success.

Declared output schema

Example

Use the actions of this tool in the order shown; its companion tool covers the other actions. These are the arguments of each call, in order.
1

Save an unnumbered draft

The first call as a request. Use an OAuth access token issued for this MCP resource and replace the example identifiers with values from your own company. Write actions change data.