cancel_leave
Withdraw a hostel leave application on VTOP through a two-step preview and confirmation, so you can check approval status before completing the withdrawal.
Instructions
Withdraw a hostel leave application on VTOP. THIS WRITES TO VTOP, so it is deliberately two-step like apply_leave. Call 1 (preview): pass leaveId with confirm OMITTED or false. Nothing is withdrawn. You get back the leave's current record — type, dates, and approval status exactly as VTOP prints it — plus whether VTOP publishes a withdraw control for it, and a previewToken. Call 2 (withdraw): repeat the SAME leaveId plus confirm=true and the previewToken. The token is bound to this exact leave id and caller. Always show the user the preview — including the approval state — and get their agreement before calling with confirm=true. An already-approved leave may no longer offer a withdraw control; the preview says so. Never invent a previewToken or set confirm=true on a first call. Requires login.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| confirm | No | Leave this unset/false for the first call: nothing is withdrawn, and you get back the leave's current status plus a previewToken. Re-call with confirm=true and the SAME leaveId and token to actually withdraw. Never set confirm=true on the first call. | |
| leaveId | Yes | The leave id to withdraw, e.g. 'L9000001' (see get_leave_status). | |
| previewToken | No | The token returned by the preview call. Required with confirm=true. It is bound to this exact leave id and caller, so a different id or a forged token invalidates it — re-run the preview. |