> ## 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. Melso API: https://api.melso.ai/v1, with a company API key or a partner key (early access); invoicing is live and the other operations are marked beta.
>
> 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.

# chat_read MCP

> MCP chat_read: read the person's Melso chat, the latest messages or those after a message.

The person's Melso chat: messages after a chat id (after), else the latest; waiting: still answering.

**Availability:** Self-employed / Company.

Listed once a self-employed person's setup is done, as for `gestiones`.

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 it to read the answer `chat` did not wait for, with `after` set to that message's `id`, or to see the latest messages in the person's Melso chat.

## Input

```json theme={null}
{
  "additionalProperties": false,
  "properties": {
    "after": {
      "description": "A message id from chat or chat_read.",
      "type": "string"
    }
  },
  "type": "object"
}
```

## Output

`messages`, each with `id`, `from` (`person`, `person_ai`, `melso_agent` or `melso_team`), `text` and `created_at`: those after the message named in `after`, else the latest. `waiting` is true while Melso's agent is still answering. `chat_url` is where the person reads the chat.

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": {
    "chat_url": {
      "type": "string"
    },
    "messages": {
      "items": {
        "properties": {
          "created_at": {
            "type": "string"
          },
          "from": {
            "enum": [
              "person",
              "person_ai",
              "melso_agent",
              "melso_team"
            ],
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "text": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "from",
          "text",
          "created_at"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "waiting": {
      "type": "boolean"
    }
  },
  "required": [
    "messages",
    "waiting"
  ],
  "type": "object"
}
```

## Example

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": "chat_read",
    "arguments": {}
  }
}
JSON
```


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