> ## Documentation Index
> Fetch the complete documentation index at: https://docs.melso.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Melso MCP: https://mcp.melso.ai/mcp (OAuth; one company per connection). Documentation-search MCP: https://docs.melso.ai/mcp; it does not act on customer accounts.
>
> Use the live tool list and respect company membership. Ask the person to approve the exact invoice or tax return version in the signed-in app. Melso's professionals prepare and file included returns after approval; an AI assistant does not file. A prepared file or an approval is not evidence of filing: only the AEAT's reference and receipt are. Keep credentials out of chat and logs.

# Documentos fiscales — documents MCP

> MCP documents: upload and save fiscal files for this company. Live in the app and MCP.

The company's documents in one place, wherever Melso keeps them: invoices it issued, quotes, expenses (received invoices and tickets), tax returns and their AEAT receipts, the company's own records (escrituras, estatutos, NIF, modelo 036/037, alta en el RETA, poderes, certificado de titularidad bancaria), contracts and others. They come from the files stored for the company, the expenses and income it recorded, the invoices it issued and what Melso's professionals delivered in its Gestiones. list finds them newest first by type, words (q) and dates; get reads one; read returns its file as content\_base64. save keeps a file as a document with its type: a client that keeps files reserves it with upload, PUTs its bytes to upload\_url and saves it with upload\_id. Saving the same upload again keeps one document. No action changes or deletes a document. Each action accepts only its own fields (\* required): upload(filename\*, content\_type\*, size\_bytes\*); save(type\*, attachment\_id, date, description, title, upload\_id).

**Availability:** Autónomo / Empresa.

**Access:** Live in the Melso app and over MCP for a signed-in person. Where the partner REST API covers the same area, that path is private beta until Melso enables your account. See [Access and pricing](https://docs.melso.ai/api/access.md).

The live tool list is authoritative: the company's plan and your role can narrow this contract. [Understand access](https://docs.melso.ai/mcp/permissions.md).

## When to use

Use `documents` for `save`, `upload`. Use [`documents_read`](https://docs.melso.ai/mcp/tools/documents-read) for the companion actions. The live tool list determines availability.

## Input

```json theme={null}
{
  "additionalProperties": false,
  "oneOf": [
    {
      "additionalProperties": false,
      "properties": {
        "action": {
          "const": "upload"
        },
        "content_type": {
          "description": "application/pdf, image/jpeg, image/png, image/webp or image/gif.",
          "type": "string"
        },
        "filename": {
          "description": "The file's name, such as certificado-censal.pdf.",
          "type": "string"
        },
        "size_bytes": {
          "description": "The file's exact size in bytes.",
          "maximum": 15728640,
          "minimum": 1,
          "type": "integer"
        }
      },
      "required": [
        "action",
        "filename",
        "content_type",
        "size_bytes"
      ],
      "type": "object"
    },
    {
      "additionalProperties": false,
      "properties": {
        "action": {
          "const": "save"
        },
        "attachment_id": {
          "description": "For a file already sent in the signed-in Melso app's chat. External MCP clients use upload_id from upload.",
          "type": "string"
        },
        "date": {
          "description": "The document's own date, YYYY-MM-DD, such as the day a quote or a deed was signed.",
          "type": "string"
        },
        "description": {
          "description": "A short description search also finds, such as what a quote offers and its total.",
          "type": "string"
        },
        "title": {
          "description": "How the document is named in Documentos, such as Presupuesto 2026-014 · Estudio Norte; the file's name when omitted.",
          "type": "string"
        },
        "type": {
          "description": "The document's type.",
          "enum": [
            "invoice",
            "quote",
            "receipt",
            "tax_filing",
            "corporate",
            "contract",
            "other"
          ],
          "type": "string"
        },
        "upload_id": {
          "description": "The upload_id upload answered, once the file's bytes are PUT.",
          "type": "string"
        }
      },
      "required": [
        "action",
        "type"
      ],
      "type": "object"
    }
  ],
  "properties": {
    "action": {
      "enum": [
        "upload",
        "save"
      ],
      "type": "string"
    },
    "attachment_id": {
      "description": "For a file already sent in the signed-in Melso app's chat. External MCP clients use upload_id from upload.",
      "type": "string"
    },
    "content_type": {
      "description": "application/pdf, image/jpeg, image/png, image/webp or image/gif.",
      "type": "string"
    },
    "date": {
      "description": "The document's own date, YYYY-MM-DD, such as the day a quote or a deed was signed.",
      "type": "string"
    },
    "description": {
      "description": "A short description search also finds, such as what a quote offers and its total.",
      "type": "string"
    },
    "filename": {
      "description": "The file's name, such as certificado-censal.pdf.",
      "type": "string"
    },
    "size_bytes": {
      "description": "The file's exact size in bytes.",
      "maximum": 15728640,
      "minimum": 1,
      "type": "integer"
    },
    "title": {
      "description": "How the document is named in Documentos, such as Presupuesto 2026-014 · Estudio Norte; the file's name when omitted.",
      "type": "string"
    },
    "type": {
      "description": "list: only documents of this type; save: the document's type. invoice is one the company issued, quote a presupuesto, receipt an expense's invoice or ticket, tax_filing a return or its AEAT receipt, corporate the company's own records, contract a contract.",
      "enum": [
        "invoice",
        "quote",
        "receipt",
        "tax_filing",
        "corporate",
        "contract",
        "other"
      ],
      "type": "string"
    },
    "upload_id": {
      "description": "The upload_id upload answered, once the file's bytes are PUT.",
      "type": "string"
    }
  },
  "required": [
    "action"
  ],
  "type": "object"
}
```

## 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.

> [accordion] save
>
> Keep a file as one of the company's documents: one sent or built in the Melso chat (attachment\_id), or one PUT through upload (upload\_id).
>
> ```json theme={null}
> {
>   "additionalProperties": false,
>   "properties": {
>     "attachment_id": {
>       "description": "For a file already sent in the signed-in Melso app's chat. External MCP clients use upload_id from upload.",
>       "type": "string"
>     },
>     "date": {
>       "description": "The document's own date, YYYY-MM-DD, such as the day a quote or a deed was signed.",
>       "type": "string"
>     },
>     "description": {
>       "description": "A short description search also finds, such as what a quote offers and its total.",
>       "type": "string"
>     },
>     "title": {
>       "description": "How the document is named in Documentos, such as Presupuesto 2026-014 · Estudio Norte; the file's name when omitted.",
>       "type": "string"
>     },
>     "type": {
>       "description": "The document's type.",
>       "enum": [
>         "invoice",
>         "quote",
>         "receipt",
>         "tax_filing",
>         "corporate",
>         "contract",
>         "other"
>       ],
>       "type": "string"
>     },
>     "upload_id": {
>       "description": "The upload_id upload answered, once the file's bytes are PUT.",
>       "type": "string"
>     }
>   },
>   "required": [
>     "type"
>   ],
>   "type": "object"
> }
> ```

> [accordion] upload
>
> Reserve the upload of a local PDF or image of at most 15 MB: PUT its exact bytes to upload\_url with the returned headers, then call save with upload\_id.
>
> ```json theme={null}
> {
>   "additionalProperties": false,
>   "properties": {
>     "content_type": {
>       "description": "application/pdf, image/jpeg, image/png, image/webp or image/gif.",
>       "type": "string"
>     },
>     "filename": {
>       "description": "The file's name, such as certificado-censal.pdf.",
>       "type": "string"
>     },
>     "size_bytes": {
>       "description": "The file's exact size in bytes.",
>       "maximum": 15728640,
>       "minimum": 1,
>       "type": "integer"
>     }
>   },
>   "required": [
>     "filename",
>     "content_type",
>     "size_bytes"
>   ],
>   "type": "object"
> }
> ```

## Output

`upload` returns an `upload_id`, the `upload_url` and headers for a PUT. `save` keeps the uploaded file with its type and details. Saving a document does not issue an invoice or file a return.

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.

## Example

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.

```bash theme={null}
curl --fail-with-body https://mcp.melso.ai/mcp \
  -H "Authorization: Bearer $MELSO_MCP_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  --data-binary @- <<'JSON'
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "documents",
    "arguments": {
      "action": "save",
      "type": "invoice"
    }
  }
}
JSON
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.