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

# obligations MCP

> MCP obligations for a gestoría: the portfolio's tax obligations and this month's payroll of every employer client.

The portfolio's work: list gives tax obligations and incomplete profiles, or one client's (a period with no draft is a reminder, never a return); payroll, this month's payroll of each employer client and last month's Social Security due. Actions (\* required): list(client); payroll.

**Availability:** Gestoría.

Listed only on a gestoría's connection, for the clients the person works. [Melso for gestorías](https://docs.melso.ai/mcp/gestorias.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 it to plan the portfolio's work: `list` for each client's tax obligations and what blocks them, `payroll` for this month's payroll of every client that employs someone. Then work one client with its tools and `client`.

## Input

```json theme={null}
{
  "additionalProperties": false,
  "properties": {
    "action": {
      "enum": [
        "list",
        "payroll"
      ],
      "type": "string"
    },
    "client": {
      "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] list
>
> Read actual portfolio tax obligations, incomplete profiles and evidence-derived states. No drafts are invented. client narrows it to one client; a portfolio longer than the limit answers its first rows with truncated, total and a notice.
>
> ```json theme={null}
> {
>   "additionalProperties": false,
>   "properties": {
>     "client": {
>       "description": "A client's id from clients list.",
>       "type": "string"
>     }
>   },
>   "type": "object"
> }
> ```

> [accordion] payroll
>
> This month's payroll (month, YYYY-MM, as of today in Spain) of every client the person works that employs someone this month, has this month's payroll or an earlier one in draft, or owes the TGSS last month's liquidation, as the console's Nóminas lists it: each client's workspace\_id (the client every payroll call takes), client\_name, employees (this month's), drafts\_before (earlier months still in draft), pay\_date (the day this month is paid, YYYY-MM-DD: its run's, else the one the client's agreed pay\_day gives, empty when neither says; calculate the nearest first), run (null while nobody calculated the month, else its id, period, pay\_date, status, issues and totals) and social\_security (last month's liquidation, due this month, or null: its run\_id and run\_status, due in the Régimen General and terms: presentation, direct\_debit and payment). Melso does not know what was presented or paid in SILTRA. Read a client's month with payroll run. In Melso's chat, a client whose agent the firm switched off refuses it.
>
> ```json theme={null}
> {
>   "additionalProperties": false,
>   "properties": {},
>   "type": "object"
> }
> ```

## Output

`list` returns the portfolio's tax obligations, incomplete profiles and their states from the clients' records, or one client's with `client`; a period without a draft is a reminder, never an invented return. `payroll` returns this month's payroll of each employer client: `workspace_id` (the `client` every payroll call takes), `client_name`, `employees`, `drafts_before`, `pay_date`, `run` and `social_security` (last month's liquidation due now, or `null`).

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

See what the portfolio has due, then this month's payroll. These are the `arguments` of each call, in order.

**1. Read the obligations**

```json theme={null}
{
  "action": "list"
}
```

**2. Read this month's payroll of every employer client**

```json theme={null}
{
  "action": "payroll"
}
```

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


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