Skip to main content
Record the company’s invoices and receipts. from_document reads one and records it as income when the company issued it, else as an expense, keeping its file in Documents: give a file attached in ChatGPT as file, a link as url, or upload_id after upload and a PUT to its upload_url; in Claude and ChatGPT, upload_files opens Melso’s upload box instead. create records one by hand; update needs expected_version from get. Ask the person only whether an undecided expense belongs to their activity, and save just id, expected_version and deductible. Amounts are EUR decimal strings. An expense covered by a return Melso approved or filed cannot be deleted; one filed outside Melso does not stop that. Actions (* required): create(date*, total*, …); from_document(…); update(id*, expected_version*, …); upload(filename*, content_type*, size_bytes*); delete(id*, reason). Availability: Self-employed / Company / Gestoría. Gestoría: every action, and also batch, in the client the call names: add client, the client’s id from clients_read list. Melso for gestorías explains what a firm’s connection does. The live tool list is authoritative: the company’s plan and your role can narrow this contract. Understand access.

When to use

Use expenses for batch, create, delete, from_document, update, upload. Use expenses_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.
Record up to 100 expenses in one call: items, each with create’s fields and, for retries, an idempotency_key unique to that expense in your system. Each answers created, replayed (the key’s expense, already recorded) or refused with why, as create refuses it; send a refused one again corrected. After a failed or lost answer, send the keyed items again unchanged; check an item without a key before sending it again.
Record an expense from explicit evidence. A document needs its supplier and commercial amounts, or vat_lines. A without_invoice fiscal record keeps its signed income-tax measure separate, with fiscal_only effects and no invented supplier or payment. For a photo or PDF use from_document instead. The same supplier (by tax ID, or by name when either has none) and number, case and spaces aside, already recorded is refused with already_recorded, naming that expense: update it instead. warnings never refuse it: possible_duplicate names an expense of the same supplier whose number differs only in punctuation, or of the same supplier, day and total whatever its number (a misread or missing one), and vat_rate_mismatch a VAT more than a cent from the base at its rate; tell the person and correct or delete what is wrong.
Delete an expense recorded by mistake, such as a duplicate, after the person confirms. Its file stays in Documents. Refused when a tax return Melso approved or filed covers its date: change it in the web app and file a correction. A return recorded as filed outside Melso does not stop it.
Read an invoice or receipt (PDF or photo) and record it: as income when the company issued it (its tax ID is the issuer’s), as an expense when anyone else did. The server reads it, checks the amounts, judges deductibility and stores it in Documents; each read is billed to the company’s credit. Give exactly one source. attachment_id (a file sent in this chat) is read now and answers the record and review codes. direction_unknown means the document does not show which side the company is on (the issuer reads like the company without its tax ID, or the company’s tax ID reads as the issuer’s on an invoice that bills nobody else): ask whether they issued or received it and retry with direction. own_tax_id_counterparty means the document was read with the company’s own tax ID as its supplier or customer: nothing was recorded; retry once with the direction the person gave, and if it comes back again record it with create, asking them for the other party’s name and tax ID. The record’s total is the invoice’s, base plus VAT; IRPF withheld is irpf_amount, and payable (set when IRPF is withheld) is what is paid or collected after it: show the total as the invoice’s total and payable apart as the líquido, never one in place of the other. country_unknown means ask the supplier/customer country and retry with counterparty_country and the direction from the answer. billed_to_another (source gmail) means a document read from mail bills another company: it stays out of these books. duplicate true means the document is a record already there: an expense with its supplier and number, or income with its number, customer, date and total. number_taken means another invoice is recorded as income under this invoice’s number (existing): two invoices cannot share a number, so tell the person this one must be issued again under a new number. url (an HTTPS download link, such as a file-sharing link) or file_id (a file already in Documents) is read in the background: the call answers a job_id at once and records nothing yet; call document_status to see what each became. Several documents can be queued one call each. upload_id (a file you uploaded with upload) is read in the background too. In ChatGPT, which cannot upload, pass a PDF or photo the person attached as file: it is read in the background like a url. In the Melso chat, an invoice attached to an email in the person’s connected mail is given by mail_message_id instead of a download link: Melso fetches it from the mail, reads it in the background, and in Gmail confirms in that email’s conversation with a note only the person receives.
Edit supplied fields at expected_version. A customer activity answer sends only deductible and preserves technical review codes, even when totals need review. Changed activity clears VAT entitlement; yes preserves professional allocations, no clears expense and VAT deduction overrides. Other edits recheck amounts and file access. Customer edits preserve internal review codes for Melso’s professionals; changed VAT evidence needs fresh fiscal review. Never ask the customer to settle VAT or technical warnings.
Get a link to upload a local PDF or photo (at most 15 MB) when you can run commands: PUT the file to upload_url, then call from_document with upload_id. In ChatGPT, pass a file the person attached to from_document as file instead. Without a shell, give the person web_upload_url to drop the files there.

Output

create, update and from_document return the saved record. upload returns the upload link and a web upload link. delete returns a deletion receipt. 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

Ask for an upload link

2

Read the uploaded file

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.