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

# Consultar documentos fiscales — documents_read MCP

> MCP documents_read: list fiscal files, inspect their details and read their content. Live in the app and MCP.

Read-only actions. 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): list(from, limit, q, to, type); get(id\*); read(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_read` for `get`, `list`, `read`. Use [`documents`](https://docs.melso.ai/mcp/tools/documents) for the companion actions. The live tool list determines availability.

## Input

```json theme={null}
{
  "additionalProperties": false,
  "oneOf": [
    {
      "additionalProperties": false,
      "properties": {
        "action": {
          "const": "list"
        },
        "from": {
          "description": "Only documents dated on or after this day, YYYY-MM-DD.",
          "type": "string"
        },
        "limit": {
          "description": "How many to return, 25 by default and at most 100.",
          "maximum": 100,
          "minimum": 1,
          "type": "integer"
        },
        "q": {
          "description": "Words every document must contain in its title, file name, description or related record (supplier, customer, case, return), such as escritura or 303.",
          "type": "string"
        },
        "to": {
          "description": "Only documents dated on or before this day, YYYY-MM-DD.",
          "type": "string"
        },
        "type": {
          "description": "Only documents of this type.",
          "enum": [
            "invoice",
            "quote",
            "receipt",
            "tax_filing",
            "corporate",
            "contract",
            "other"
          ],
          "type": "string"
        }
      },
      "required": [
        "action"
      ],
      "type": "object"
    },
    {
      "additionalProperties": false,
      "properties": {
        "action": {
          "const": "get"
        },
        "id": {
          "description": "The document's id, from list.",
          "type": "string"
        }
      },
      "required": [
        "action",
        "id"
      ],
      "type": "object"
    },
    {
      "additionalProperties": false,
      "properties": {
        "action": {
          "const": "read"
        },
        "id": {
          "description": "The document's id, from list.",
          "type": "string"
        }
      },
      "required": [
        "action",
        "id"
      ],
      "type": "object"
    }
  ],
  "properties": {
    "action": {
      "enum": [
        "list",
        "get",
        "read"
      ],
      "type": "string"
    },
    "from": {
      "description": "Only documents dated on or after this day, YYYY-MM-DD.",
      "type": "string"
    },
    "id": {
      "description": "The document's id, from list.",
      "type": "string"
    },
    "limit": {
      "description": "How many to return, 25 by default and at most 100.",
      "maximum": 100,
      "minimum": 1,
      "type": "integer"
    },
    "q": {
      "description": "Words every document must contain in its title, file name, description or related record (supplier, customer, case, return), such as escritura or 303.",
      "type": "string"
    },
    "to": {
      "description": "Only documents dated on or before this day, YYYY-MM-DD.",
      "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"
    }
  },
  "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.

### Read actions

These actions only read. They change nothing.

> [accordion] get
>
> Read one document's details by its id.
>
> ```json theme={null}
> {
>   "additionalProperties": false,
>   "properties": {
>     "id": {
>       "description": "The document's id, from list.",
>       "type": "string"
>     }
>   },
>   "required": [
>     "id"
>   ],
>   "type": "object"
> }
> ```

> [accordion] list
>
> List the company's documents, newest first, narrowed by type, words and dates.
>
> ```json theme={null}
> {
>   "additionalProperties": false,
>   "properties": {
>     "from": {
>       "description": "Only documents dated on or after this day, YYYY-MM-DD.",
>       "type": "string"
>     },
>     "limit": {
>       "description": "How many to return, 25 by default and at most 100.",
>       "maximum": 100,
>       "minimum": 1,
>       "type": "integer"
>     },
>     "q": {
>       "description": "Words every document must contain in its title, file name, description or related record (supplier, customer, case, return), such as escritura or 303.",
>       "type": "string"
>     },
>     "to": {
>       "description": "Only documents dated on or before this day, YYYY-MM-DD.",
>       "type": "string"
>     },
>     "type": {
>       "description": "Only documents of this type.",
>       "enum": [
>         "invoice",
>         "quote",
>         "receipt",
>         "tax_filing",
>         "corporate",
>         "contract",
>         "other"
>       ],
>       "type": "string"
>     }
>   },
>   "type": "object"
> }
> ```

> [accordion] read
>
> Read one document's file as content\_base64 with its filename and content\_type, at most 15 MB.
>
> ```json theme={null}
> {
>   "additionalProperties": false,
>   "properties": {
>     "id": {
>       "description": "The document's id, from list.",
>       "type": "string"
>     }
>   },
>   "required": [
>     "id"
>   ],
>   "type": "object"
> }
> ```

## Output

`list` returns company documents matching the filters. `get` returns one document's details. `read` returns `content_base64`, `filename` and `content_type` for its file, up to 15 MB.

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

```json theme={null}
{
  "properties": {
    "content_base64": {
      "type": "string"
    },
    "content_type": {
      "type": "string"
    },
    "filename": {
      "type": "string"
    }
  },
  "required": [
    "filename",
    "content_type",
    "content_base64"
  ],
  "type": "object"
}
```

## 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. Find deeds**

```json theme={null}
{
  "action": "list",
  "q": "escritura"
}
```

**2. Read the selected document**

```json theme={null}
{
  "action": "read",
  "id": "11111111-1111-4111-8111-111111111111"
}
```

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.

```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_read",
    "arguments": {
      "action": "list",
      "q": "escritura"
    }
  }
}
JSON
```


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