File a pending leave draft: leave recorded on an employee’s behalf (a person approves in Taokeh)
create_leave_draftFiles a pending draft of Record leave on the Leave page: leave entered on an employee's behalf, approved as it is recorded. Nothing changes until an admin, the Payroll role or a Bookkeeper + payroll login approves in Taokeh; approval records it exactly as Record leave does, with the approver as the person who approved it, and it counts against the balance at once. leaveType is one of ANNUAL, SICK, HOSPITALIZATION, MATERNITY, PATERNITY, UNPAID; endDate left out means a one-day leave; halfDay applies to a single date. The result carries the counted days (Sundays and the public holidays the employee observes are not counted, and are named), the balance left for that type after it, and, for unpaid leave in a month whose payroll run is still a draft, the months whose run rows need the unpaid days entered by hand. Refused at filing and approval in the page's words: an employee who is not active, dates across two years, no working days in the range, leave overlapping leave already recorded or applied for, more days than the balance, unpaid leave in a month whose payroll run is finalized or posted. One draft per employee and date range waits at a time. Admin, or bookkeeper with the payroll role, only; any other connection is refused.
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": {
"employeeId": "<employeeId>",
"leaveType": "<leaveType>",
"startDate": "<startDate>"
},
"name": "create_leave_draft"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | A short note for the reviewer: where the figures came from. | |
| reason | No | The reason, as the Record leave form takes it (up to 500 characters). | |
| endDate | No | The last day, YYYY-MM-DD (left out: the start date, a one-day leave). Same calendar year as the start. | |
| halfDay | No | true for half a day; a single date only. | |
| leaveType | Yes | The leave type. | |
| startDate | Yes | The first day, YYYY-MM-DD. | |
| employeeId | Yes | The employee, from leave_register or payroll_summary (`staff: true`). | |
| needsReview | No | true flags the draft for the reviewer. |