Calculate net pay (payslip)
calculate_net_payCalculates one month's net pay for a Malaysian employee by applying EPF, SOCSO, SKBBK, EIS and MTD/PCB deductions, employer contributions, and total cost with cited sources.
Instructions
Works out one month's payslip for one employee in Malaysia: EPF, SOCSO, SKBBK, EIS and MTD (PCB) deductions, net pay, and the employer's contributions and total cost. Runs the same calculations as calculate_epf, calculate_socso_eis and calculate_mtd, feeding the employee EPF into MTD, and cites the source of every line. For a non_malaysian employee, say whether they are tax resident (taxResident). Fixed monthly salaries and standard reliefs only; no bonuses or zakat. Include the result's disclaimer in the answer to the user.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"monthlySalary": "<monthlySalary>",
"age": "<age>",
"citizenship": "<citizenship>"
},
"name": "calculate_net_pay"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| age | Yes | The employee's age in whole years. | |
| children | No | Qualifying children at RM2,000 relief each: unmarried and under 18, or 18 and over in full-time education below diploma level. Must be 0 in category 1. Defaults to 0. Children in higher education or with a disability (which LHDN counts as 4 or 8) are not supported. | |
| payPeriod | No | The calendar month the salary is paid for, as YYYY-MM. It decides which rate tables apply. Defaults to the current month in Malaysia. | |
| tp1Reliefs | No | Other reliefs the employee claimed through payroll this month on form TP1 (LP1), in RM. Defaults to 0. | |
| yearToDate | No | Required from February. Totals from earlier months of the same calendar year, including any previous employer's (all 0 for someone with no earlier income this year). Or "same_salary_all_year" if every earlier month had this salary and EPF, no TP1 reliefs, and its MTD deducted. | |
| citizenship | Yes | malaysian, permanent_resident, or non_malaysian (a foreign worker without PR). | |
| skbbkStatus | No | SOCSO's 24-hour protection scheme (SKBBK, Lindung 24 Jam). Everyone is covered by default; opted_out only if PERKESO approved the employee's opt-out, which foreign workers can't do. Defaults to covered. | |
| taxCategory | No | Required for a tax resident. LHDN tax category. 1: single. 2: married and the spouse has no income (or is jointly assessed). 3: married with a working spouse, or divorced, widowed, or single with an adopted child. | |
| taxResident | No | Required for a non_malaysian employee; defaults to true otherwise. true if tax resident in Malaysia (usually 182 days or more in the calendar year). false for the flat 30% non-resident MTD, with no reliefs: taxCategory, children, tp1Reliefs and yearToDate are then ignored. | |
| monthlySalary | Yes | Monthly salary in RM, at most 2 decimal places: basic pay plus fixed allowances. Excludes overtime, commission, bonuses and arrears. | |
| eisPayableBefore57 | No | Required for employees aged 57 to 59: true if EIS contributions were payable for them before they turned 57 (even if never paid). Can't be worked out from age. | |
| registeredWithEpfBefore1Aug1998 | No | Only for non_malaysian: true if the employee registered with EPF before 1 Aug 1998, which puts them on the Malaysian rates. Defaults to false. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| basis | Yes | The rules each calculation used. Call calculate_epf, calculate_socso_eis or calculate_mtd for the full working. | |
| netPay | Yes | RM, monthly salary minus every statutory deduction | |
| citations | Yes | ||
| payPeriod | Yes | ||
| deductions | Yes | What comes off the employee's pay. | |
| disclaimer | Yes | ||
| explanation | Yes | ||
| employerCost | Yes | RM, monthly salary plus the employer's contributions | |
| monthlySalary | Yes | ||
| employerContributions | Yes | What the employer pays on top of the salary. |