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

# clients MCP

> MCP clients for a gestoría: create and update the firm's clients, invite a client's owner, archive and unarchive.

Keep the firm's clients. invite\_owner returns its owner's WhatsApp invite link. archive (owner or admin) ends its billing, agent authority and signing grants; unarchive undoes it. create's request\_id is a UUID you generate; reuse it to retry. Actions (\* required): create(request\_id\*, name\*, kind\*, ...); update(id\*, ...); invite\_owner/archive/unarchive(id\*); import(exclude\_tax\_ids, file, upload\_id); import\_upload(filename\*, content\_type\*, size\_bytes\*).

**Availability:** Gestoría.

Listed only on a gestoría's connection. A member of the firm sees only the clients assigned to them. [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 `clients` for `archive`, `create`, `import`, `import_upload`, `invite_owner`, `unarchive`, `update`. Use [`clients_read`](https://docs.melso.ai/mcp/tools/clients-read) for the companion actions. The live tool list determines availability.

## Input

```json theme={null}
{
  "additionalProperties": false,
  "properties": {
    "action": {
      "enum": [
        "create",
        "update",
        "invite_owner",
        "archive",
        "unarchive",
        "import",
        "import_upload"
      ],
      "type": "string"
    },
    "activities": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "activity_type": {
            "enum": [
              "profesional",
              "empresarial"
            ],
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "ended_on": {
            "type": "string"
          },
          "iae_code": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "started_on": {
            "type": "string"
          },
          "vat_regime": {
            "enum": [
              "general",
              "recargo_equivalencia",
              "simplificado",
              "reagp",
              "exento",
              "igic_general",
              "igic_simplificado",
              "igic_repep",
              "ipsi",
              ""
            ],
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "iae_code"
        ],
        "type": "object"
      },
      "maxItems": 20,
      "type": "array"
    },
    "activity_description": {
      "type": "string"
    },
    "activity_type": {
      "enum": [
        "profesional",
        "empresarial"
      ],
      "type": "string"
    },
    "address": {
      "type": "string"
    },
    "city": {
      "type": "string"
    },
    "client_types": {
      "items": {
        "enum": [
          "es_business",
          "es_individual",
          "eu_business",
          "non_eu_business"
        ],
        "type": "string"
      },
      "type": "array"
    },
    "company_form": {
      "type": "string"
    },
    "confirmation_token": {
      "type": "string"
    },
    "content_type": {
      "type": "string"
    },
    "declared_facts": {
      "items": {
        "pattern": "^(ad_igi_mensual|ad_igi_semestral|ad_has_employees|ad_work_income_no_cass|ad_pays_capital_income|ad_pays_nonresidents|ad_commerce_registered|ad_year_ends_december)(@[0-9]{4})?$",
        "type": "string"
      },
      "maxItems": 20,
      "type": "array"
    },
    "email": {
      "type": "string"
    },
    "eu_operator": {
      "type": "boolean"
    },
    "exclude_tax_ids": {
      "items": {
        "type": "string"
      },
      "maxItems": 5000,
      "type": "array"
    },
    "file": {
      "additionalProperties": false,
      "properties": {
        "download_url": {
          "type": "string"
        },
        "file_id": {
          "type": "string"
        },
        "file_name": {
          "type": "string"
        },
        "mime_type": {
          "type": "string"
        }
      },
      "required": [
        "download_url",
        "file_id"
      ],
      "type": "object"
    },
    "filename": {
      "type": "string"
    },
    "iae_code": {
      "type": "string"
    },
    "iban": {
      "type": "string"
    },
    "id": {
      "type": "string"
    },
    "invoice_series": {
      "type": "string"
    },
    "irpf_method": {
      "enum": [
        "directa_simplificada",
        "directa_normal",
        "modulos"
      ],
      "type": "string"
    },
    "irpf_retention_rate": {
      "maximum": 100,
      "minimum": 0,
      "type": "number"
    },
    "is_large_company": {
      "type": "boolean"
    },
    "kind": {
      "enum": [
        "freelancer",
        "company"
      ],
      "type": "string"
    },
    "legal_name": {
      "type": "string"
    },
    "naf": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "next_invoice_number": {
      "minimum": 1,
      "type": "integer"
    },
    "phone": {
      "type": "string"
    },
    "postal_code": {
      "type": "string"
    },
    "province": {
      "type": "string"
    },
    "registered_on": {
      "type": "string"
    },
    "registration_status": {
      "enum": [
        "alta",
        "pendiente"
      ],
      "type": "string"
    },
    "request_id": {
      "format": "uuid",
      "type": "string"
    },
    "reta_registered_on": {
      "type": "string"
    },
    "size_bytes": {
      "minimum": 1,
      "type": "integer"
    },
    "tax_id": {
      "type": "string"
    },
    "tax_territory": {
      "enum": [
        "comun",
        "alava",
        "bizkaia",
        "gipuzkoa",
        "navarra",
        "canarias",
        "ceuta",
        "melilla"
      ],
      "type": "string"
    },
    "trade_name": {
      "type": "string"
    },
    "upload_id": {
      "type": "string"
    },
    "vat_redeme": {
      "type": "boolean"
    },
    "vat_regime": {
      "enum": [
        "general",
        "recargo_equivalencia",
        "simplificado",
        "reagp",
        "exento",
        "igic_general",
        "igic_simplificado",
        "igic_repep",
        "ipsi",
        "igi_general",
        "igi_simplificat"
      ],
      "type": "string"
    },
    "vat_sii": {
      "type": "boolean"
    }
  },
  "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.

### Client file actions

These actions save a client as the firm's staff do in the console. Saving a client writes to nobody; `invite_owner` returns a link the professional sends. Only the firm's owner or an admin archives or unarchives a client.

> [accordion] archive
>
> Archive a client: it stops being billed as active, the agent's authority in it is turned off and the firm's signing grants on it are revoked; its books, gestiones and evidence stay. Only the firm's owner or an admin may. unarchive undoes it.
>
> ```json theme={null}
> {
>   "additionalProperties": false,
>   "properties": {
>     "id": {
>       "description": "Company UUID returned by clients.",
>       "type": "string"
>     }
>   },
>   "required": [
>     "id"
>   ],
>   "type": "object"
> }
> ```

> [accordion] create
>
> Create a client billed to this firm with every fiscal detail the professional gives: its NIF (a DNI or NIE for an autónomo, a CIF for a company), fiscal address, activity (activity\_type, activity\_description, iae\_code), alta date and the rest of its fiscal profile, and its email and phone, saved in this one call as staff save them on the client's page. A NIF another of the firm's clients has is refused. Nobody is written to. The answer is the client with its fiscal\_profile, what is still missing, and errors naming any refused field and why. Does not enable agent authority.
>
> ```json theme={null}
> {
>   "additionalProperties": false,
>   "properties": {
>     "activities": {
>       "description": "The company's other activities beside the main one (iae_code, activity_type): one per other IAE heading registered in the census (modelo 036), such as a consultant who also runs a shop. Sending it replaces the list: send every other activity, each saved one with its id from get; one left out is removed, which is refused while invoices, income or expenses belong to it (set its ended_on instead). Invoices, income and expenses name their activity with activity_id. A company's activities are always empresarial.",
>       "items": {
>         "additionalProperties": false,
>         "properties": {
>           "activity_type": {
>             "description": "Professional (IAE section 2 or 3, invoices with income tax withheld) or a business (section 1).",
>             "enum": [
>               "profesional",
>               "empresarial"
>             ],
>             "type": "string"
>           },
>           "description": {
>             "description": "What the activity is, in the person's words.",
>             "type": "string"
>           },
>           "ended_on": {
>             "description": "Its baja, YYYY-MM-DD, once it has ended.",
>             "type": "string"
>           },
>           "iae_code": {
>             "description": "IAE heading (epígrafe), for example 659.9 or 843.1.",
>             "type": "string"
>           },
>           "id": {
>             "description": "The saved activity's id, from get; omit to add one.",
>             "type": "string"
>           },
>           "started_on": {
>             "description": "Its alta, YYYY-MM-DD, when known.",
>             "type": "string"
>           },
>           "vat_regime": {
>             "description": "Its own indirect tax regime only when it differs from the main activity's, such as recargo_equivalencia for a shop; empty follows the main one.",
>             "enum": [
>               "general",
>               "recargo_equivalencia",
>               "simplificado",
>               "reagp",
>               "exento",
>               "igic_general",
>               "igic_simplificado",
>               "igic_repep",
>               "ipsi",
>               ""
>             ],
>             "type": [
>               "string",
>               "null"
>             ]
>           }
>         },
>         "required": [
>           "iae_code"
>         ],
>         "type": "object"
>       },
>       "maxItems": 20,
>       "type": "array"
>     },
>     "activity_description": {
>       "description": "What they do, in their words.",
>       "type": "string"
>     },
>     "activity_type": {
>       "description": "An autónomo's activity: professional or a business. A company's is always empresarial, set by the server.",
>       "enum": [
>         "profesional",
>         "empresarial"
>       ],
>       "type": "string"
>     },
>     "address": {
>       "description": "Fiscal address: street, number, floor.",
>       "type": "string"
>     },
>     "city": {
>       "description": "Municipality.",
>       "type": "string"
>     },
>     "client_types": {
>       "description": "Who they invoice, every kind that applies: es_business (companies or self-employed in Spain: IRPF retention for a professional), es_individual (individuals in Spain), eu_business (businesses in other EU countries: ROI), non_eu_business (businesses outside the EU: services to them are not subject to Spanish VAT, art. 69.Uno.1.º LIVA). Sending it replaces the list. Without eu_business, eu_operator is saved as false.",
>       "items": {
>         "enum": [
>           "es_business",
>           "es_individual",
>           "eu_business",
>           "non_eu_business"
>         ],
>         "type": "string"
>       },
>       "type": "array"
>     },
>     "company_form": {
>       "description": "Company legal form",
>       "type": "string"
>     },
>     "declared_facts": {
>       "description": "Andorra only: facts its tax calendar reads that its records cannot show, each for every year or, as fact@YYYY, for that year only: ad_igi_mensual, ad_igi_semestral, ad_has_employees, ad_work_income_no_cass, ad_pays_capital_income, ad_pays_nonresidents, ad_commerce_registered, ad_year_ends_december. Sending it replaces the list. Refused in Spain.",
>       "items": {
>         "pattern": "^(ad_igi_mensual|ad_igi_semestral|ad_has_employees|ad_work_income_no_cass|ad_pays_capital_income|ad_pays_nonresidents|ad_commerce_registered|ad_year_ends_december)(@[0-9]{4})?$",
>         "type": "string"
>       },
>       "maxItems": 20,
>       "type": "array"
>     },
>     "email": {
>       "description": "The client's email, kept in its file: the address the firm writes to. One address; \"\" removes it on update.",
>       "type": "string"
>     },
>     "eu_operator": {
>       "description": "Whether they are registered as an intra-community operator (ROI) to invoice clients in other EU countries.",
>       "type": "boolean"
>     },
>     "iae_code": {
>       "description": "The main activity's IAE heading (epígrafe), for example 763 or 843.1.",
>       "type": "string"
>     },
>     "iban": {
>       "description": "Bank account for collecting invoices. Ask for it with the first invoice, not during onboarding.",
>       "type": "string"
>     },
>     "invoice_series": {
>       "description": "Invoice series prefix.",
>       "type": "string"
>     },
>     "irpf_method": {
>       "description": "An autónomo's income tax method. Defaults to directa_simplificada; refused for a company.",
>       "enum": [
>         "directa_simplificada",
>         "directa_normal",
>         "modulos"
>       ],
>       "type": "string"
>     },
>     "irpf_retention_rate": {
>       "description": "Income tax withheld on an autónomo's invoices, in percent. Defaults to 15 for a professional; 7 only when they ask for the new-professional rate (the year of registration and the two after); refused for a company.",
>       "maximum": 100,
>       "minimum": 0,
>       "type": "number"
>     },
>     "is_large_company": {
>       "description": "Whether the business is a gran empresa: its volumen de operaciones exceeded 6.010.121,04 € last year, which means filing VAT and withholding monthly and keeping the SII. Melso cannot see last year's turnover of a business that just joined.",
>       "type": "boolean"
>     },
>     "kind": {
>       "enum": [
>         "freelancer",
>         "company"
>       ],
>       "type": "string"
>     },
>     "legal_name": {
>       "description": "Fiscal name: the full name on the DNI or NIE, or the company's registered name.",
>       "type": "string"
>     },
>     "naf": {
>       "description": "An autónomo's Social Security number (NAF, número de afiliación): 12 digits.",
>       "type": "string"
>     },
>     "name": {
>       "description": "Client name: an autónomo's full name or the company's name",
>       "type": "string"
>     },
>     "next_invoice_number": {
>       "description": "The number the person's next invoice takes, continuing their own numbering: their last invoice's number plus one (#009 → 10), or 1 when they have issued none this year. Unset until they say; Melso's invoices go on from it.",
>       "minimum": 1,
>       "type": "integer"
>     },
>     "phone": {
>       "description": "The client's phone, kept in its file: the number, their WhatsApp included, the firm reaches the client on itself. One number, international (+44 …) or Spanish (612 34 56 78), saved as +34612345678; \"\" removes it on update. Saving it invites nobody: invite_owner does.",
>       "type": "string"
>     },
>     "postal_code": {
>       "description": "Five-digit Spanish postal code. Sets the province and the tax territory. Andorra: AD100 to AD700.",
>       "type": "string"
>     },
>     "province": {
>       "description": "Province. Normally deduced from the postal code.",
>       "type": "string"
>     },
>     "registered_on": {
>       "description": "When they registered as self-employed: YYYY-MM with the month they give (the day is never needed, never ask for it), or YYYY-MM-DD only when they said the day.",
>       "type": "string"
>     },
>     "registration_status": {
>       "description": "An autónomo's registration: alta when already registered as self-employed, pendiente when not yet.",
>       "enum": [
>         "alta",
>         "pendiente"
>       ],
>       "type": "string"
>     },
>     "request_id": {
>       "description": "UUID you generate; reuse it to retry. A retry with the same request_id answers the client it created, never a second one.",
>       "format": "uuid",
>       "type": "string"
>     },
>     "reta_registered_on": {
>       "description": "An autónomo's alta in the Seguridad Social's RETA, YYYY-MM-DD: the day it takes effect, as their resolución de alta prints it.",
>       "type": "string"
>     },
>     "tax_id": {
>       "description": "NIF: a DNI, a NIE or a CIF, as written by the person. The control character is checked. Andorra: the NRT.",
>       "type": "string"
>     },
>     "tax_territory": {
>       "description": "Tax territory. Normally deduced from the postal code; set it only to correct that.",
>       "enum": [
>         "comun",
>         "alava",
>         "bizkaia",
>         "gipuzkoa",
>         "navarra",
>         "canarias",
>         "ceuta",
>         "melilla"
>       ],
>       "type": "string"
>     },
>     "trade_name": {
>       "description": "Commercial name, when different from the fiscal name.",
>       "type": "string"
>     },
>     "vat_redeme": {
>       "description": "Whether they are in the monthly VAT refund register (REDEME), which means filing VAT monthly.",
>       "type": "boolean"
>     },
>     "vat_regime": {
>       "description": "Indirect tax regime. Defaults to general VAT, IGIC in the Canary Islands and IPSI in Ceuta and Melilla. reagp is the farming, livestock and fishing regime; exento is for activities that are all VAT-exempt (healthcare, education, insurance); igic_simplificado and igic_repep (the small-business franchise) only apply in the Canary Islands. Andorra: igi_general or igi_simplificat.",
>       "enum": [
>         "general",
>         "recargo_equivalencia",
>         "simplificado",
>         "reagp",
>         "exento",
>         "igic_general",
>         "igic_simplificado",
>         "igic_repep",
>         "ipsi",
>         "igi_general",
>         "igi_simplificat"
>       ],
>       "type": "string"
>     },
>     "vat_sii": {
>       "description": "Whether they keep their VAT books in the AEAT's SII (Suministro Inmediato de Información), compulsory for large companies and optional otherwise. In the Canary Islands, the SII-IGIC.",
>       "type": "boolean"
>     }
>   },
>   "required": [
>     "request_id",
>     "name",
>     "kind"
>   ],
>   "type": "object"
> }
> ```

> [accordion] import
>
> Create the new clients of a list, once the professional has seen what import\_read found and agreed. Each is billed to this firm, with its name, tax ID and address, and no members: nobody is contacted. A client the firm already has is never duplicated. It tries at most 100 per call: repeat while remaining is above 0 and something was created. client\_limit\_reached means the firm holds the most clients it may until its first invoice is paid: say so and stop.
>
> ```json theme={null}
> {
>   "additionalProperties": false,
>   "properties": {
>     "attachment_id": {
>       "description": "In the Melso chat: the attachment_id of the list of clients (CSV or Excel) the person sent, at most 10 MB.",
>       "type": "string"
>     },
>     "exclude_tax_ids": {
>       "description": "Clients the professional leaves out.",
>       "items": {
>         "description": "The tax ID of a client the professional leaves out.",
>         "type": "string"
>       },
>       "maxItems": 5000,
>       "type": "array"
>     },
>     "file": {
>       "additionalProperties": false,
>       "description": "In ChatGPT: the list of clients (CSV or Excel) the person attached in this conversation, which ChatGPT fills in, instead of upload_id.",
>       "properties": {
>         "download_url": {
>           "type": "string"
>         },
>         "file_id": {
>           "type": "string"
>         },
>         "file_name": {
>           "type": "string"
>         },
>         "mime_type": {
>           "type": "string"
>         }
>       },
>       "required": [
>         "download_url",
>         "file_id"
>       ],
>       "type": "object"
>     },
>     "upload_id": {
>       "description": "From another client: the upload_id from upload, once the list of clients (CSV or Excel) was PUT to its upload_url.",
>       "type": "string"
>     }
>   },
>   "type": "object"
> }
> ```

> [accordion] import\_upload
>
> Get a link to upload a list of clients (CSV or Excel, at most 10 MB) when you can run commands: PUT the file to upload\_url, then call import\_read and import with upload\_id. In ChatGPT, pass the file the person attached as file instead. Without a shell, give the person web\_upload\_url to import it in Clientes.
>
> ```json theme={null}
> {
>   "additionalProperties": false,
>   "properties": {
>     "content_type": {
>       "description": "The file's type: text/csv, text/plain, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel or application/octet-stream.",
>       "type": "string"
>     },
>     "filename": {
>       "description": "The file's name, such as clientes.csv.",
>       "type": "string"
>     },
>     "size_bytes": {
>       "description": "The file's exact size in bytes.",
>       "minimum": 1,
>       "type": "integer"
>     }
>   },
>   "required": [
>     "filename",
>     "content_type",
>     "size_bytes"
>   ],
>   "type": "object"
> }
> ```

> [accordion] invite\_owner
>
> Invite the client's owner to Melso by the phone kept in its file, while nobody of the client uses Melso. Only the firm's owner or an admin may, never to the number of someone of the firm, and only once the file keeps the client's NIF. Melso cannot write first: the answer's join\_url is the WhatsApp link the professional sends the client. When the client writes to Melso from that number and gives the last four characters of the company's NIF, they own their company, their chat works in its own records and its usage stays on the firm's bill. Asked again, it answers the same invitation; a pending one to an older number is withdrawn.
>
> ```json theme={null}
> {
>   "additionalProperties": false,
>   "properties": {
>     "id": {
>       "description": "Company UUID returned by clients.",
>       "type": "string"
>     }
>   },
>   "required": [
>     "id"
>   ],
>   "type": "object"
> }
> ```

> [accordion] unarchive
>
> Bring an archived client back as active, billed again from today, as the console does. Only the firm's owner or an admin may. The agent's authority and the signing grants archive revoked stay off until staff give them again in the console.
>
> ```json theme={null}
> {
>   "additionalProperties": false,
>   "properties": {
>     "id": {
>       "description": "Company UUID returned by clients.",
>       "type": "string"
>     }
>   },
>   "required": [
>     "id"
>   ],
>   "type": "object"
> }
> ```

> [accordion] update
>
> Update an affiliated client's email and phone and complete or correct its fiscal details (NIF, address, activity, IAE, alta date and the rest of its fiscal profile) as staff do on its page; only the fields given change. Its name follows its legal\_name or trade\_name. Answers its fiscal\_profile, what is still missing and errors naming any refused field. Cannot change its kind, billing or professional authority.
>
> ```json theme={null}
> {
>   "additionalProperties": false,
>   "properties": {
>     "activities": {
>       "description": "The company's other activities beside the main one (iae_code, activity_type): one per other IAE heading registered in the census (modelo 036), such as a consultant who also runs a shop. Sending it replaces the list: send every other activity, each saved one with its id from get; one left out is removed, which is refused while invoices, income or expenses belong to it (set its ended_on instead). Invoices, income and expenses name their activity with activity_id. A company's activities are always empresarial.",
>       "items": {
>         "additionalProperties": false,
>         "properties": {
>           "activity_type": {
>             "description": "Professional (IAE section 2 or 3, invoices with income tax withheld) or a business (section 1).",
>             "enum": [
>               "profesional",
>               "empresarial"
>             ],
>             "type": "string"
>           },
>           "description": {
>             "description": "What the activity is, in the person's words.",
>             "type": "string"
>           },
>           "ended_on": {
>             "description": "Its baja, YYYY-MM-DD, once it has ended.",
>             "type": "string"
>           },
>           "iae_code": {
>             "description": "IAE heading (epígrafe), for example 659.9 or 843.1.",
>             "type": "string"
>           },
>           "id": {
>             "description": "The saved activity's id, from get; omit to add one.",
>             "type": "string"
>           },
>           "started_on": {
>             "description": "Its alta, YYYY-MM-DD, when known.",
>             "type": "string"
>           },
>           "vat_regime": {
>             "description": "Its own indirect tax regime only when it differs from the main activity's, such as recargo_equivalencia for a shop; empty follows the main one.",
>             "enum": [
>               "general",
>               "recargo_equivalencia",
>               "simplificado",
>               "reagp",
>               "exento",
>               "igic_general",
>               "igic_simplificado",
>               "igic_repep",
>               "ipsi",
>               ""
>             ],
>             "type": [
>               "string",
>               "null"
>             ]
>           }
>         },
>         "required": [
>           "iae_code"
>         ],
>         "type": "object"
>       },
>       "maxItems": 20,
>       "type": "array"
>     },
>     "activity_description": {
>       "description": "What they do, in their words.",
>       "type": "string"
>     },
>     "activity_type": {
>       "description": "An autónomo's activity: professional or a business. A company's is always empresarial, set by the server.",
>       "enum": [
>         "profesional",
>         "empresarial"
>       ],
>       "type": "string"
>     },
>     "address": {
>       "description": "Fiscal address: street, number, floor.",
>       "type": "string"
>     },
>     "city": {
>       "description": "Municipality.",
>       "type": "string"
>     },
>     "client_types": {
>       "description": "Who they invoice, every kind that applies: es_business (companies or self-employed in Spain: IRPF retention for a professional), es_individual (individuals in Spain), eu_business (businesses in other EU countries: ROI), non_eu_business (businesses outside the EU: services to them are not subject to Spanish VAT, art. 69.Uno.1.º LIVA). Sending it replaces the list. Without eu_business, eu_operator is saved as false.",
>       "items": {
>         "enum": [
>           "es_business",
>           "es_individual",
>           "eu_business",
>           "non_eu_business"
>         ],
>         "type": "string"
>       },
>       "type": "array"
>     },
>     "declared_facts": {
>       "description": "Andorra only: facts its tax calendar reads that its records cannot show, each for every year or, as fact@YYYY, for that year only: ad_igi_mensual, ad_igi_semestral, ad_has_employees, ad_work_income_no_cass, ad_pays_capital_income, ad_pays_nonresidents, ad_commerce_registered, ad_year_ends_december. Sending it replaces the list. Refused in Spain.",
>       "items": {
>         "pattern": "^(ad_igi_mensual|ad_igi_semestral|ad_has_employees|ad_work_income_no_cass|ad_pays_capital_income|ad_pays_nonresidents|ad_commerce_registered|ad_year_ends_december)(@[0-9]{4})?$",
>         "type": "string"
>       },
>       "maxItems": 20,
>       "type": "array"
>     },
>     "email": {
>       "description": "The client's email, kept in its file: the address the firm writes to. One address; \"\" removes it on update.",
>       "type": "string"
>     },
>     "eu_operator": {
>       "description": "Whether they are registered as an intra-community operator (ROI) to invoice clients in other EU countries.",
>       "type": "boolean"
>     },
>     "iae_code": {
>       "description": "The main activity's IAE heading (epígrafe), for example 763 or 843.1.",
>       "type": "string"
>     },
>     "iban": {
>       "description": "Bank account for collecting invoices. Ask for it with the first invoice, not during onboarding.",
>       "type": "string"
>     },
>     "id": {
>       "description": "Company UUID returned by clients.",
>       "type": "string"
>     },
>     "invoice_series": {
>       "description": "Invoice series prefix.",
>       "type": "string"
>     },
>     "irpf_method": {
>       "description": "An autónomo's income tax method. Defaults to directa_simplificada; refused for a company.",
>       "enum": [
>         "directa_simplificada",
>         "directa_normal",
>         "modulos"
>       ],
>       "type": "string"
>     },
>     "irpf_retention_rate": {
>       "description": "Income tax withheld on an autónomo's invoices, in percent. Defaults to 15 for a professional; 7 only when they ask for the new-professional rate (the year of registration and the two after); refused for a company.",
>       "maximum": 100,
>       "minimum": 0,
>       "type": "number"
>     },
>     "is_large_company": {
>       "description": "Whether the business is a gran empresa: its volumen de operaciones exceeded 6.010.121,04 € last year, which means filing VAT and withholding monthly and keeping the SII. Melso cannot see last year's turnover of a business that just joined.",
>       "type": "boolean"
>     },
>     "legal_name": {
>       "description": "Fiscal name: the full name on the DNI or NIE, or the company's registered name.",
>       "type": "string"
>     },
>     "naf": {
>       "description": "An autónomo's Social Security number (NAF, número de afiliación): 12 digits.",
>       "type": "string"
>     },
>     "next_invoice_number": {
>       "description": "The number the person's next invoice takes, continuing their own numbering: their last invoice's number plus one (#009 → 10), or 1 when they have issued none this year. Unset until they say; Melso's invoices go on from it.",
>       "minimum": 1,
>       "type": "integer"
>     },
>     "phone": {
>       "description": "The client's phone, kept in its file: the number, their WhatsApp included, the firm reaches the client on itself. One number, international (+44 …) or Spanish (612 34 56 78), saved as +34612345678; \"\" removes it on update. Saving it invites nobody: invite_owner does.",
>       "type": "string"
>     },
>     "postal_code": {
>       "description": "Five-digit Spanish postal code. Sets the province and the tax territory. Andorra: AD100 to AD700.",
>       "type": "string"
>     },
>     "province": {
>       "description": "Province. Normally deduced from the postal code.",
>       "type": "string"
>     },
>     "registered_on": {
>       "description": "When they registered as self-employed: YYYY-MM with the month they give (the day is never needed, never ask for it), or YYYY-MM-DD only when they said the day.",
>       "type": "string"
>     },
>     "registration_status": {
>       "description": "An autónomo's registration: alta when already registered as self-employed, pendiente when not yet.",
>       "enum": [
>         "alta",
>         "pendiente"
>       ],
>       "type": "string"
>     },
>     "reta_registered_on": {
>       "description": "An autónomo's alta in the Seguridad Social's RETA, YYYY-MM-DD: the day it takes effect, as their resolución de alta prints it.",
>       "type": "string"
>     },
>     "tax_id": {
>       "description": "NIF: a DNI, a NIE or a CIF, as written by the person. The control character is checked. Andorra: the NRT.",
>       "type": "string"
>     },
>     "tax_territory": {
>       "description": "Tax territory. Normally deduced from the postal code; set it only to correct that.",
>       "enum": [
>         "comun",
>         "alava",
>         "bizkaia",
>         "gipuzkoa",
>         "navarra",
>         "canarias",
>         "ceuta",
>         "melilla"
>       ],
>       "type": "string"
>     },
>     "trade_name": {
>       "description": "Commercial name, when different from the fiscal name.",
>       "type": "string"
>     },
>     "vat_redeme": {
>       "description": "Whether they are in the monthly VAT refund register (REDEME), which means filing VAT monthly.",
>       "type": "boolean"
>     },
>     "vat_regime": {
>       "description": "Indirect tax regime. Defaults to general VAT, IGIC in the Canary Islands and IPSI in Ceuta and Melilla. reagp is the farming, livestock and fishing regime; exento is for activities that are all VAT-exempt (healthcare, education, insurance); igic_simplificado and igic_repep (the small-business franchise) only apply in the Canary Islands. Andorra: igi_general or igi_simplificat.",
>       "enum": [
>         "general",
>         "recargo_equivalencia",
>         "simplificado",
>         "reagp",
>         "exento",
>         "igic_general",
>         "igic_simplificado",
>         "igic_repep",
>         "ipsi",
>         "igi_general",
>         "igi_simplificat"
>       ],
>       "type": "string"
>     },
>     "vat_sii": {
>       "description": "Whether they keep their VAT books in the AEAT's SII (Suministro Inmediato de Información), compulsory for large companies and optional otherwise. In the Canary Islands, the SII-IGIC.",
>       "type": "boolean"
>     }
>   },
>   "required": [
>     "id"
>   ],
>   "type": "object"
> }
> ```

## Output

`create` and `update` return the client with its `fiscal_profile`, what is still missing and `errors` naming any refused field. `invite_owner` returns the `join_url`, the WhatsApp link the professional sends the client. `archive` stops billing the client as active, turns the agent's authority off and revokes the firm's signing grants, keeping its books; `unarchive` bills it again from today.

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. Save the email the client gave**

```json theme={null}
{
  "action": "update",
  "id": "11111111-1111-4111-8111-111111111111",
  "email": "admin@example.com"
}
```

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": "clients",
    "arguments": {
      "action": "update",
      "id": "11111111-1111-4111-8111-111111111111",
      "email": "admin@example.com"
    }
  }
}
JSON
```


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