Calculate MTD (PCB) income tax deduction
calculate_mtdCalculates Malaysia's monthly tax deduction (MTD/PCB) for one employee using LHDN's resident formula or the flat 30% non-resident rate, based on fixed salary, EPF and standard reliefs.
Instructions
Works out the monthly tax deduction (MTD, also called PCB) for one employee in Malaysia. For a tax resident it uses LHDN's computerised formula, from the schedule in effect for the pay period, and shows the working; for a non-resident it applies the flat 30%. Fixed monthly salaries and standard reliefs only (individual, spouse, children, EPF, plus a TP1 total); 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>",
"epfEmployee": "<epfEmployee>"
},
"name": "calculate_mtd"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| 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. | |
| epfEmployee | Yes | The employee's EPF contribution this month in RM (the employee share from calculate_epf). 0 if none. | |
| 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 | Defaults to true. false if the employee is not resident, or not known to be resident, in Malaysia for tax (usually under 182 days in the calendar year): MTD is then a flat 30% of the salary, with no reliefs, and taxCategory, children, tp1Reliefs and yearToDate are ignored. | |
| monthlySalary | Yes | Monthly salary in RM, at most 2 decimal places: basic pay plus fixed allowances. Excludes overtime, commission, bonuses and arrears. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mtd | Yes | RM, deducted from pay. | |
| working | No | The LHDN formula's working, so it can be checked line by line. Residents only. | |
| children | Yes | ||
| citations | Yes | ||
| payPeriod | Yes | ||
| disclaimer | Yes | ||
| yearToDate | No | The year-to-date figures used, in RM. Residents only. | |
| explanation | Yes | ||
| taxCategory | Yes | null for a non-resident. | |
| taxResident | Yes | ||
| monthlySalary | Yes |