Skip to main content
Read and record this company’s expenses, and read any invoice or receipt with from_document, which records it as an expense or an income. Monetary amounts are EUR decimal strings. update requires the saved expected_version, preserves fiscal evidence rules and invalidates any prior owner review. Deductible is a classification, not approval of a deduction. category is the AEAT expense concept code; deductibility is Melso’s estimate (likely, review or unlikely) with the rule behind it, never a confirmed deduction. Each action accepts only its own fields (* required): list; get(id*); create(supplier_name*, date*, subtotal*, vat_amount*, total*, attachment_id, category, deductible, document_number, file_id, irpf_amount, irpf_rate, source, supplier_country, supplier_tax_id, vat_rate, vat_treatment); from_document(attachment_id, counterparty_country, direction, file_id, filename, upload_id, url); document_status(job_id); update(id*, expected_version*, attachment_id, category, date, deductible, document_number, file_id, irpf_amount, irpf_rate, subtotal, supplier_country, supplier_name, supplier_tax_id, total, vat_amount, vat_rate, vat_treatment); upload(filename*, content_type*, size_bytes*); delete(id*). Availability: Autónomo / Empresa. Catalog: Core (tools/list). The live catalog is authoritative: company type, membership, plan, connected apps and execution context can narrow this contract. Understand access.

Input

Autónomo / Company schema

Actions

The family schema combines fields for discovery. Each action accepts only its own fields below; add action when calling the family.
Record an expense typed by hand with its client-owned evidence. For a photo or PDF use from_document instead.
Delete an expense recorded by mistake, such as a duplicate, after the person confirms. Its file stays in Documents. Refused when a tax return covering its date was already approved or filed: change it in the web app and file a correction.
What documents queued with from_document became: one job by job_id, or the company’s latest twenty. Each says queued, done (with the expense or income recorded, its review codes and deductibility) or failed (with a code; direction_unknown means ask and queue it again with direction; country_unknown means ask the supplier/customer country and retry with counterparty_country and the direction from the error).
Read an invoice or receipt (PDF or photo) and record it: as an expense when the company received it, as income when it issued it (decided from the tax IDs). 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 ask whether they issued or received it and retry with direction; a name match alone also needs this confirmation. country_unknown means ask the supplier/customer country and retry with counterparty_country and the direction from the answer. url (an HTTPS download link, such as one a connected Drive returns) or file_id (a file already in Documents) is read in the background: the call answers a job_id at once; call document_status later 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.
Read one expense belonging to this company, including its saved version, deductibility and review codes.
List the company’s expenses, amounts, AEAT category (category_proposed when Melso proposed it and nobody reviewed it), deductible classifications, Melso’s deductibility estimate and saved versions.
Edit only supplied fields at expected_version. Rechecks amounts and client file access, and clears the review codes.
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. Without a shell, give the person web_upload_url to drop the files there instead.

Output

The selected expense records, saved changes, document status, or an upload link/receipt according to the action. Extraction can remain pending; inspect document status before relying on its fields. 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. The server does not currently declare an outputSchema, so treat additional fields as extensible. Result handling.

Example

Use an OAuth access token issued for this MCP resource (a Run token for Run-only tools). Replace example identifiers with values from your own account. Write actions change data.