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

# Cuentas y conciliación bancaria — bank MCP

> MCP bank: reconcile movements and update bank-account mappings. Live for an empresa.

A company's bank movements, worked as its adviser does in Contabilidad › Por revisar. accounts lists the bank accounts, each with its assigned ledger account (null means unmapped and blocks reconciliation; account\_update assigns a subaccount such as 57200001, cash 570, savings 574 or a credit line 520). Mapping changes are audited; existing reconciliation snapshots and posted entries keep their captured accounts. movements lists the movements newest first (status to\_review: those not reconciled, each with the document Melso proposes, its reasons and batch\_eligible: identifying evidence with no equally strong candidate); movement reads one; documents lists the open invoices and tickets a movement can settle. reconcile records the confirmed matching and prepares a journal proposal without posting: documents it settles (an invoice less its credit note; a difference for a bank's fee or an exchange rate), lines for what no document says (kind tax with its model: 303 paid to 4750 or refunded from 4700, 111, 115, 123 and 216 to 4751, 202 to 473, 200 to 4752 or from 4709; kind account with any account of the plan: a loan 170/520 and its interest 662, capital 100, a partner 551, the Seguridad Social 476, a supplier's or customer's balance carried from imported books), or a transfer to or from another of the company's accounts, which pairs both movements and proposes one transfer entry. An authorized batch may reconcile batch\_eligible proposals with their exact displayed document amounts; conflicts stay pending. A professional reviews and explicitly posts the exact proposal in the app. unreconcile clears the matching and updates proposals; posted entries remain unchanged and require explicit reversal in the app. Bring statements in with bank\_statements. Amounts are EUR decimal strings: movements are positive in, negative out; lines and documents are always positive. Each action accepts only its own fields (\* required): account\_update(id\*, account, name); reconcile(id\*, difference, documents, lines, transfer); unreconcile(id\*).

**Availability:** Empresa.

**Access:** Live for an empresa, in the app and over MCP when the connection lists `bank`. Listing accounts and movements and recording a reconciliation are private beta on REST. Connecting a bank account and pushing movements are planned, and they are not actions of this tool. Reconciling prepares a journal proposal and does not post it.

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 `bank` for `account_update`, `reconcile`, `unreconcile`. Use [`bank_read`](https://docs.melso.ai/mcp/tools/bank-read) for the companion actions. The live tool list determines availability.

## Input

```json theme={null}
{
  "additionalProperties": false,
  "oneOf": [
    {
      "additionalProperties": false,
      "properties": {
        "account": {
          "description": "Its account in the books: 570 to 576 or 520, or a subaccount of one, up to 12 digits.",
          "type": "string"
        },
        "action": {
          "const": "account_update"
        },
        "id": {
          "description": "The bank account's id, from accounts.",
          "type": "string"
        },
        "name": {
          "description": "The name the person calls it, at most 120 characters.",
          "type": "string"
        }
      },
      "required": [
        "action",
        "id"
      ],
      "type": "object"
    },
    {
      "additionalProperties": false,
      "properties": {
        "action": {
          "const": "reconcile"
        },
        "difference": {
          "additionalProperties": false,
          "description": "With documents: the whole gap between them and the movement, proposed as a result adjustment.",
          "properties": {
            "amount": {
              "description": "EUR decimal string, positive.",
              "type": "string"
            },
            "kind": {
              "enum": [
                "bank_fee",
                "exchange"
              ],
              "type": "string"
            }
          },
          "required": [
            "kind",
            "amount"
          ],
          "type": "object"
        },
        "documents": {
          "description": "The documents the movement settles.",
          "items": {
            "additionalProperties": false,
            "properties": {
              "amount": {
                "description": "EUR decimal string: how much of it the movement settles, always positive; omit for all it still owes.",
                "type": "string"
              },
              "expected_fingerprint": {
                "description": "The proposal fingerprint from the single-movement read, when confirming its reviewed evidence. Changed evidence is refused.",
                "type": "string"
              },
              "id": {
                "description": "The document's id, from documents.",
                "type": "string"
              },
              "type": {
                "description": "The document's type, from documents.",
                "enum": [
                  "expense",
                  "income",
                  "invoice"
                ],
                "type": "string"
              }
            },
            "required": [
              "type",
              "id"
            ],
            "type": "object"
          },
          "maxItems": 100,
          "type": "array"
        },
        "id": {
          "description": "The movement's id, from movements.",
          "type": "string"
        },
        "lines": {
          "description": "What the movement settles that no document says.",
          "items": {
            "additionalProperties": false,
            "properties": {
              "account": {
                "description": "account: the account of the plan or its subaccount, e.g. 5200 for a loan's short-term principal, 662 for its interest, 100 for capital, 551 for a partner, 476 for the Seguridad Social, 40000012 for a supplier's balance carried from imported books. Never VAT (472, 477), the result (129) or the movement's own bank account.",
                "type": "string"
              },
              "amount": {
                "description": "EUR decimal string, always positive: the movement says which way.",
                "type": "string"
              },
              "concept": {
                "description": "What the line is, at most 300 characters, e.g. Intereses préstamo octubre.",
                "type": "string"
              },
              "kind": {
                "description": "tax: a return paid or refunded, by model. account: any account of the books.",
                "enum": [
                  "tax",
                  "account"
                ],
                "type": "string"
              },
              "model": {
                "description": "tax: the return. 303 settles 4750 (paid) or 4700 (refunded); 111, 115, 123 and 216 settle 4751; 202 is paid on account (473); 200 settles 4752 (paid) or 4709 (refunded).",
                "enum": [
                  "303",
                  "111",
                  "115",
                  "123",
                  "216",
                  "202",
                  "200"
                ],
                "type": "string"
              }
            },
            "required": [
              "kind",
              "amount"
            ],
            "type": "object"
          },
          "maxItems": 20,
          "type": "array"
        },
        "transfer": {
          "additionalProperties": false,
          "description": "The movement is money moved to or from another of the company's accounts; alone.",
          "properties": {
            "bank_account_id": {
              "description": "The other account's id, from accounts.",
              "type": "string"
            },
            "movement_id": {
              "description": "Its other side, when Melso should not find it: the other account's movement of the opposite amount within ten days.",
              "type": "string"
            }
          },
          "required": [
            "bank_account_id"
          ],
          "type": "object"
        }
      },
      "required": [
        "action",
        "id"
      ],
      "type": "object"
    },
    {
      "additionalProperties": false,
      "properties": {
        "action": {
          "const": "unreconcile"
        },
        "id": {
          "description": "The movement's id, from movements.",
          "type": "string"
        }
      },
      "required": [
        "action",
        "id"
      ],
      "type": "object"
    }
  ],
  "properties": {
    "account": {
      "description": "Its account in the books: 570 to 576 or 520, or a subaccount of one, up to 12 digits.",
      "type": "string"
    },
    "action": {
      "enum": [
        "account_update",
        "reconcile",
        "unreconcile"
      ],
      "type": "string"
    },
    "difference": {
      "additionalProperties": false,
      "description": "With documents: the whole gap between them and the movement, proposed as a result adjustment.",
      "properties": {
        "amount": {
          "description": "EUR decimal string, positive.",
          "type": "string"
        },
        "kind": {
          "enum": [
            "bank_fee",
            "exchange"
          ],
          "type": "string"
        }
      },
      "required": [
        "kind",
        "amount"
      ],
      "type": "object"
    },
    "documents": {
      "description": "The documents the movement settles.",
      "items": {
        "additionalProperties": false,
        "properties": {
          "amount": {
            "description": "EUR decimal string: how much of it the movement settles, always positive; omit for all it still owes.",
            "type": "string"
          },
          "expected_fingerprint": {
            "description": "The proposal fingerprint from the single-movement read, when confirming its reviewed evidence. Changed evidence is refused.",
            "type": "string"
          },
          "id": {
            "description": "The document's id, from documents.",
            "type": "string"
          },
          "type": {
            "description": "The document's type, from documents.",
            "enum": [
              "expense",
              "income",
              "invoice"
            ],
            "type": "string"
          }
        },
        "required": [
          "type",
          "id"
        ],
        "type": "object"
      },
      "maxItems": 100,
      "type": "array"
    },
    "id": {
      "anyOf": [
        {
          "anyOf": [
            {
              "description": "The bank account's id, from accounts.",
              "type": "string"
            },
            {
              "description": "The movement's id, from movements.",
              "type": "string"
            }
          ]
        },
        {
          "description": "The movement's id, from movements.",
          "type": "string"
        }
      ],
      "description": "account_update: the bank account's id, from accounts; movement, documents, reconcile and unreconcile: the movement's id, from movements."
    },
    "lines": {
      "description": "What the movement settles that no document says.",
      "items": {
        "additionalProperties": false,
        "properties": {
          "account": {
            "description": "account: the account of the plan or its subaccount, e.g. 5200 for a loan's short-term principal, 662 for its interest, 100 for capital, 551 for a partner, 476 for the Seguridad Social, 40000012 for a supplier's balance carried from imported books. Never VAT (472, 477), the result (129) or the movement's own bank account.",
            "type": "string"
          },
          "amount": {
            "description": "EUR decimal string, always positive: the movement says which way.",
            "type": "string"
          },
          "concept": {
            "description": "What the line is, at most 300 characters, e.g. Intereses préstamo octubre.",
            "type": "string"
          },
          "kind": {
            "description": "tax: a return paid or refunded, by model. account: any account of the books.",
            "enum": [
              "tax",
              "account"
            ],
            "type": "string"
          },
          "model": {
            "description": "tax: the return. 303 settles 4750 (paid) or 4700 (refunded); 111, 115, 123 and 216 settle 4751; 202 is paid on account (473); 200 settles 4752 (paid) or 4709 (refunded).",
            "enum": [
              "303",
              "111",
              "115",
              "123",
              "216",
              "202",
              "200"
            ],
            "type": "string"
          }
        },
        "required": [
          "kind",
          "amount"
        ],
        "type": "object"
      },
      "maxItems": 20,
      "type": "array"
    },
    "name": {
      "description": "The name the person calls it, at most 120 characters.",
      "type": "string"
    },
    "transfer": {
      "additionalProperties": false,
      "description": "The movement is money moved to or from another of the company's accounts; alone.",
      "properties": {
        "bank_account_id": {
          "description": "The other account's id, from accounts.",
          "type": "string"
        },
        "movement_id": {
          "description": "Its other side, when Melso should not find it: the other account's movement of the opposite amount within ten days.",
          "type": "string"
        }
      },
      "required": [
        "bank_account_id"
      ],
      "type": "object"
    }
  },
  "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.

### Reconciliation actions

These actions record or clear a matching, or map an account in the books, and need a plan with the tools. A reconciliation prepares a journal proposal; it never posts an entry, and posted entries change only by reversal in the app.

> [accordion] account\_update
>
> Name a bank account, or set the account in the books it is kept in: a subaccount of 572 (57200001), a savings account (574), cash (570) or a credit line drawn (520). New reconciliations capture this account; existing snapshots and posted entries stay unchanged. Mapping changes are audited. Only when the person asks.
>
> ```json theme={null}
> {
>   "additionalProperties": false,
>   "properties": {
>     "account": {
>       "description": "Its account in the books: 570 to 576 or 520, or a subaccount of one, up to 12 digits.",
>       "type": "string"
>     },
>     "id": {
>       "description": "The bank account's id, from accounts.",
>       "type": "string"
>     },
>     "name": {
>       "description": "The name the person calls it, at most 120 characters.",
>       "type": "string"
>     }
>   },
>   "required": [
>     "id"
>   ],
>   "type": "object"
> }
> ```

> [accordion] reconcile
>
> Record a confirmed movement matching and prepare its journal proposal without posting: with documents (each settles what it still owes unless amount says less; together never more than the movement, what is left over is on account), with lines for what no document says (a tax return, an account of the books; without documents they add up to the movement), or alone as a transfer to or from another of the company's accounts (each account needs its own account in the books; its other side is reconciled with it). difference proposes a bank's fee or an exchange difference against the documents (kind bank\_fee or exchange, at most 50 € or 5 %). Each bank needs an explicit ledger mapping. A professional reviews and explicitly posts the exact proposal in the app; posted entries remain unchanged. When the person authorizes a batch, process its batch\_eligible proposals with their exact displayed amounts after checking both banks are mapped; review conflicts and ambiguous proposals separately. Never invent a document or line the person did not confirm; unexplained movements stay to review. Refusals name their code.
>
> ```json theme={null}
> {
>   "additionalProperties": false,
>   "properties": {
>     "difference": {
>       "additionalProperties": false,
>       "description": "With documents: the whole gap between them and the movement, proposed as a result adjustment.",
>       "properties": {
>         "amount": {
>           "description": "EUR decimal string, positive.",
>           "type": "string"
>         },
>         "kind": {
>           "enum": [
>             "bank_fee",
>             "exchange"
>           ],
>           "type": "string"
>         }
>       },
>       "required": [
>         "kind",
>         "amount"
>       ],
>       "type": "object"
>     },
>     "documents": {
>       "description": "The documents the movement settles.",
>       "items": {
>         "additionalProperties": false,
>         "properties": {
>           "amount": {
>             "description": "EUR decimal string: how much of it the movement settles, always positive; omit for all it still owes.",
>             "type": "string"
>           },
>           "expected_fingerprint": {
>             "description": "The proposal fingerprint from the single-movement read, when confirming its reviewed evidence. Changed evidence is refused.",
>             "type": "string"
>           },
>           "id": {
>             "description": "The document's id, from documents.",
>             "type": "string"
>           },
>           "type": {
>             "description": "The document's type, from documents.",
>             "enum": [
>               "expense",
>               "income",
>               "invoice"
>             ],
>             "type": "string"
>           }
>         },
>         "required": [
>           "type",
>           "id"
>         ],
>         "type": "object"
>       },
>       "maxItems": 100,
>       "type": "array"
>     },
>     "id": {
>       "description": "The movement's id, from movements.",
>       "type": "string"
>     },
>     "lines": {
>       "description": "What the movement settles that no document says.",
>       "items": {
>         "additionalProperties": false,
>         "properties": {
>           "account": {
>             "description": "account: the account of the plan or its subaccount, e.g. 5200 for a loan's short-term principal, 662 for its interest, 100 for capital, 551 for a partner, 476 for the Seguridad Social, 40000012 for a supplier's balance carried from imported books. Never VAT (472, 477), the result (129) or the movement's own bank account.",
>             "type": "string"
>           },
>           "amount": {
>             "description": "EUR decimal string, always positive: the movement says which way.",
>             "type": "string"
>           },
>           "concept": {
>             "description": "What the line is, at most 300 characters, e.g. Intereses préstamo octubre.",
>             "type": "string"
>           },
>           "kind": {
>             "description": "tax: a return paid or refunded, by model. account: any account of the books.",
>             "enum": [
>               "tax",
>               "account"
>             ],
>             "type": "string"
>           },
>           "model": {
>             "description": "tax: the return. 303 settles 4750 (paid) or 4700 (refunded); 111, 115, 123 and 216 settle 4751; 202 is paid on account (473); 200 settles 4752 (paid) or 4709 (refunded).",
>             "enum": [
>               "303",
>               "111",
>               "115",
>               "123",
>               "216",
>               "202",
>               "200"
>             ],
>             "type": "string"
>           }
>         },
>         "required": [
>           "kind",
>           "amount"
>         ],
>         "type": "object"
>       },
>       "maxItems": 20,
>       "type": "array"
>     },
>     "transfer": {
>       "additionalProperties": false,
>       "description": "The movement is money moved to or from another of the company's accounts; alone.",
>       "properties": {
>         "bank_account_id": {
>           "description": "The other account's id, from accounts.",
>           "type": "string"
>         },
>         "movement_id": {
>           "description": "Its other side, when Melso should not find it: the other account's movement of the opposite amount within ten days.",
>           "type": "string"
>         }
>       },
>       "required": [
>         "bank_account_id"
>       ],
>       "type": "object"
>     }
>   },
>   "required": [
>     "id"
>   ],
>   "type": "object"
> }
> ```

> [accordion] unreconcile
>
> Clear a movement's matching and return it to review. Its unposted proposal is removed or recalculated; posted entries remain unchanged and require explicit reversal in the app. The other side of a transfer stays matched on its own. Only when the person asks.
>
> ```json theme={null}
> {
>   "additionalProperties": false,
>   "properties": {
>     "id": {
>       "description": "The movement's id, from movements.",
>       "type": "string"
>     }
>   },
>   "required": [
>     "id"
>   ],
>   "type": "object"
> }
> ```

## Output

`reconcile` records the confirmed matching and prepares an unposted journal proposal. `unreconcile` returns the movement to review. `account_update` returns the renamed or remapped account. These actions never post an entry.

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 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. Reconcile it with the expense the person confirmed**

```json theme={null}
{
  "action": "reconcile",
  "id": "11111111-1111-4111-8111-111111111111",
  "documents": [
    {
      "type": "expense",
      "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. 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": "bank",
    "arguments": {
      "action": "reconcile",
      "id": "11111111-1111-4111-8111-111111111111",
      "documents": [
        {
          "type": "expense",
          "id": "11111111-1111-4111-8111-111111111111"
        }
      ]
    }
  }
}
JSON
```


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