file, request_approval, in the client the call names: add client, the client’s id from clients_read list. Melso for gestorías explains what a firm’s connection does.
The live tool list is authoritative: the company’s plan and your role can narrow this contract. Understand access.
When to use
Usepayroll_read for changes, contract_document, contract_submissions, contracts, documents, employees, file, leaves, liquidations, payslip, preview, red_responses, request_approval, run, runs, settings, siltra_files, strikes. Use payroll for the companion actions. The live tool list determines availability.
Input
Actions
The tool’s schema combines the fields of every action. Each action accepts only its own fields below; sendaction with them.
Read actions
These actions only read. They change nothing.changes
changes
What changed in an employee’s data and when, newest first, as the web app’s history shows it.
contract_document
contract_document
What the written employment contract of a registered contract would say, with the collective agreement’s terms Melso holds, and what keeps it from being made: missing lists each fact to ask the person for (never write a placeholder or ‘según convenio’; when the contract includes remote work, that list is every item of the acuerdo de trabajo a distancia, Ley 10/2021 art. 7, saved as document.remote_agreement with remote_work, and none of it is drafted), warnings what to tell them. agreement.classes lists the groups and levels the agreement describes, with the categories each covers: propose the one that fits the job and confirm it with the person; never change a fact only to see whether the document comes out. model names the SEPE’s official model the PDF follows (indefinido for 100 and 200, temporal for 402, 502, 410 and 510, practica_profesional for 420 and 520), its cláusulas específicas and its annexes (the essential elements, the covenant of complementary hours, the training plan); a clave without one keeps Melso’s own layout. contract_pdf makes the PDF once nothing is missing.
contract_submissions
contract_submissions
A contract’s sends to Contrat@, the latest first, each with status (pending, received, rejected or unknown), its number or refusal, and the SEPE’s verdict on the latest received one.
contracts
contracts
An employee’s contracts as the SEPE and the Seguridad Social know them, oldest first: initial ones, extensions and conversions, each with its id, clave (code), dates, account, occupation, group, hours and the written contract’s terms (document). The latest sets the employee’s payroll terms.
documents
documents
An employee’s documents: per contract, generated (the contract_pdf PDF), basic_copy (its copia básica, made with it), signed and notice, its documento informativo (RD 723/2026, RDL 39/2026): rule before_start or on_change (by due_on), on_request (request_days días hábiles from requested_on) or not_required; delivered_on, channel, file_id (copy received), missing, overdue, late. agreements: each work centre’s agreement. notice_models: the SEPE’s model; Melso does not fill it in. red_resolutions: the resoluciones of altas and bajas done in Sistema RED (action, date, file_id). file_id is a Documentos file
employees
employees
The company’s employees: each one’s id, name, start_date, end_date, active, settled_on (the day an approved month’s finiquito ended the contract; later months leave them out), leaving_on (the date of a baja recorded in a draft month, until it is approved) and profile (the contract and the modelo 145 its payslips are calculated from). An empty profile () keeps the employee out of the payroll until it is filled.
file
file
One of the official payroll files as content_base64 (above 256 KB a person’s own AI client gets download_url, a link for 5 minutes, instead) with filename and content_type; write the decoded bytes unchanged. scope run (id: a month): payslips and settlements (PDF, a zip when several; employee_id narrows them to one). A month not approved yet gives these two named and stamped BORRADOR on every page, for the person to check, never to sign or hand over, and the communications whose term runs from the event, not the month (afi, fdi, certifica, contrata), from the month as it is now, to make again if it changes; its other files answer payroll_not_approved. From an approved month: sepa (the bank’s pain.001 transfer order), bases, vacation-bases and arrears-bases (Sistema RED bases L00, L13 and L03), cra, afi (the month’s bajas, and the strikes’ starts and ends that fall in it, each once), fdi (the Fichero de Datos de IT: the economic data of the month’s sick leaves, also those entered by hand), certifica (SEPE Certific@2 certificates of the contracts that end) and contrata (SEPE Contrat@ of the month’s contracts, extensions and conversions not communicated yet). scope year (year): certificates (withholding PDFs) and register (registro retributivo CSV). scope contract (contract_ids, the employees’ contracts kept in the web app): contrata (SEPE Contrat@ XML of contracts, extensions or conversions, one kind per file) and afi (altas and contract changes). scope strike (id: a strike, from strikes): afi, its MIN movements, the start with its tipo (2 total, 3 partial with the part of the day worked) and, once it has ended, the end on the first day back at work; afi_end the end alone. Melso sends none of them but a contract to Contrat@ (contract_submit): the gestoría or the company uploads them to SILTRA, Contrat@, Certific@2 or the bank. A file the data does not allow names what it lacks (payroll_file_incomplete): complete the labour data (settings_update) or the contract (contract_update). At most 15 MB.
leaves
leaves
The company’s sick leaves (incapacidad temporal) as the INSS reported them in the FIE files imported, the open ones first: each one’s employee_id and employee_name, status (open, discharged by the INSS, or cancelled when the INSS annulled the parte de baja), kind (common or professional) with accident, the INSS’s contingency (1 common illness, 2 non-occupational accident, 3 accident at work, 4 occupational illness, 5 observation period), start, end (the discharge, empty while it lasts) with end_cause, relapse with initial_start and accumulated_days, estimated_days (the duration the parte de baja expects), next_review, exhausts_365 (the day it reaches 365 days), confirmations (each parte de confirmación’s date and number), entity (the INSS’s code of who pays the benefit) and account (the CCC). Every month’s draft payroll takes the leaves that touch it; employee_id narrows them to one employee.
liquidations
liquidations
The company’s approved months with the TGSS, the latest first, as the Seguridad Social tab of Nóminas lists them: today (the day in Spain) and liquidations, each with run_id, period, run_status, status (pending until a Fichero de Cálculos is imported, errors, differences or matches), imports (SILTRA files imported; 0 means none yet), errors and differences (counts; red_responses with run_id reads them), calculated, employees in the Régimen General, due (what the payroll pays the TGSS) and tgss (what the TGSS liquidated, once calculated), and terms: presentation (last day to send the bases and ask for the calculation, art. 29.2 LGSS), direct_debit (last day to confirm the liquidation in SILTRA to pay by cargo en cuenta: the 22nd of the month after, the 20th in February and December; later it is paid electronically), charge (the day the bank charges it, the last working day of that month) and payment (the end of the term to pay it). Melso does not know what was confirmed or paid in SILTRA.
payslip
payslip
One payslip whole: its days, earnings and deductions line by line, the Seguridad Social bases and contributions, how the IRPF rate was calculated, the totals, warnings and the incidents it was calculated with.
preview
preview
Calculate one month’s payslip for a contract without saving anything: what a hire, a raise or a change would cost the company and pay the employee, with the payslip’s earnings, deductions, Seguridad Social bases and contributions, the IRPF rate and totals (company_cost, net). It reads none of Melso’s earlier payslips: for a month after January, profile.year_to_date gives what was paid, withheld and contributed earlier in the year, or the rate sees only the months left.
red_responses
red_responses
What the TGSS answered about an approved month through SILTRA, as imported (imports: each file’s kind, name, liquidation and summary), and the month’s reconciliation with its payslips as they are now. status is pending until a Fichero de Cálculos is imported, errors, differences or matches (it cuadra). liquidations: each one’s type (L00, L13, L03, L90, L91), number, TGSS state, confirmed, term_ends and in_term (the presentation term), and its total by Melso and the TGSS. messages: the current Respuesta’s errors and warnings with code, severity, the TGSS’s description, the manual’s explanation and motive, and the employee, tramo and datum they are about (not_processed: what the TGSS left out). differences: one row per employee, tramo (absent for the whole month) and concept, with kind (value, employee_only_tgss, employee_only_melso, tramo_only_tgss, tramo_only_melso, identity), concept code and label, measure (days, base, the employee’s or the employer’s quota, amount of a compensation, ipf), and Melso’s value, the TGSS’s and the difference. not_compared: concepts Melso does not calculate, with the TGSS’s amount. proposal: what mends each liquidation and the run file that does it (file action with scope run): bases again in term, rectification-bases for a confirmed one, after the term l90-bases for higher bases and l91-bases for what the TGSS never liquidated; cannot_lower when the payroll has lower bases than the TGSS after the term.
request_approval
request_approval
Answer the authenticated web page where the company, or its gestoría, reviews a month: share approval_url when the person wants to review it there. When they ask you to approve it, approve does it at the version they reviewed.
run
run
One month’s payroll as runs lists it, with each payslip’s id, employee, incidents, applied_rate (the IRPF withholding rate), totals and warnings. payslip reads one payslip whole.
runs
runs
The company’s monthly payrolls, the latest first: each one’s id, period (YYYY-MM), pay_date, status (draft, approved, paid), version, issues (employees without a payslip and why) and totals (employees, gross, net, the employee’s and the company’s Seguridad Social, withholding, company_cost, social_security_due, tax_due).
settings
settings
The company’s labour data and its version: the RED authorization, the CNAE, each Seguridad Social account (CCC) with its work centre, collective agreement code (REGCON) and mutua colaboradora (at_ep_insurer and common_contingencies_insurer, a number of mutual_insurers, which lists each mutua’s website, or inss: its employees’ mutua for a leave or an accident at work), the account its salaries leave from, whether the staff has legal representatives, and the person who signs its contracts and certificates.
siltra_files
siltra_files
An approved month’s SILTRA cycle: confirmed (SILTRA says its L00 is confirmed), next_kind (the file to send next, empty when none) and the files generated to send the TGSS, the latest attempt first, with id, attempt, kind, status (queued while Melso writes it, ready, failed with error code and message: payroll_file_incomplete names what the data lacks), filename, size, files (one per account), created_at, finished_at and what the TGSS answered: answer (awaiting until its SILTRA answer is imported, errors, accepted), errors (its latest Fichero de Respuesta’s) and responses (each import’s kind, filename, imported_at and errors). red_responses explains each error. Read it again until a queued attempt is ready; file with scope siltra and the attempt’s id gives the file.
strikes
strikes
The employees’ strikes as recorded, the latest first: each one’s id, employee_id, employee_name, kind (total, or partial with worked, the thousandths of the usual day the employee worked: 750 is three quarters), start, end (the last day of strike, empty while it lasts) and return (the first day back at work). Every month’s draft payroll takes the strikes that touch it: a total strike’s days are neither paid nor contributed, a partial one’s pay and contribute the part worked. The affiliation file (file, scope strike, kind afi) communicates each one to the Seguridad Social. employee_id narrows them to one employee.
Output
employees returns each employee with id, name, dates, active and the profile their payslips are calculated from. runs returns the monthly payrolls, latest first, with period, pay_date, status (draft, approved, paid), version, issues and totals; run one month with its payslips and payslip one payslip whole. preview returns an unsaved payslip with company_cost and net. file returns an official file as content_base64 with filename and content_type; a month not approved yet gives its payslips stamped BORRADOR. request_approval returns the approval_url of the month’s review page. liquidations, red_responses and siltra_files return what the TGSS answered as imported; Melso does not know what was presented or paid in SILTRA.
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 thearguments of each call, in order.
1
List the months
2
Read the draft month
3
Get the page where the person reviews it