reject-timeoff
Reject pending time off requests by specifying the time off ID. Optionally include rejection notes to provide context for the denial.
Instructions
Reject a pending time off request
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| timeoff_id | Yes | The time off ID | |
| rejected_by | No | User ID who is rejecting | |
| notes | No | Optional rejection notes |
Implementation Reference
- Handler for 'reject-timeoff' operation inside the consolidated manage-time-tracking tool. Sets status to 3 (rejected) and optionally sets rejected_by and rejected_at on the timeoff entry via PATCH /timeoffs/{id}.
case 'reject-timeoff': { const rejector_id = otherParams.rejected_by || 1; // Default to system user return floatApi.patch( `/timeoffs/${id}`, { status: 3, // 3 = rejected (numeric status) rejected_by: rejector_id, rejected_at: new Date().toISOString(), }, timeOffSchema, format ); } - Standalone legacy handler for the 'reject-timeoff' tool. Uses createTool with name 'reject-timeoff', validates timeoff_id, rejected_by, and notes, then sets status to 3 (rejected) via PATCH /timeoffs/{id}.
// Reject time off request export const rejectTimeOff = createTool( 'reject-timeoff', 'Reject a pending time off request', z.object({ timeoff_id: z.union([z.string(), z.number()]).describe('The time off ID'), rejected_by: z.number().optional().describe('User ID who is rejecting'), notes: z.string().optional().describe('Optional rejection notes'), }), async (params) => { const { timeoff_id, rejected_by, notes } = params; const updateData = { status: 3, // 3 = rejected in Float API rejected_by, rejected_at: new Date().toISOString(), notes, }; const timeOff = await floatApi.patch(`/timeoffs/${timeoff_id}`, updateData, timeOffSchema); return timeOff; } ); - Schema definitions for the consolidated tool including 'reject-timeoff' as a valid operation enum value in timeTrackingOperationTypeSchema.
const timeTrackingEntityTypeSchema = z.enum([ 'logged-time', 'timeoff', 'timeoff-types', 'public-holidays', 'team-holidays', ]); // Time tracking operation types enum for decision tree routing const timeTrackingOperationTypeSchema = z.enum([ 'list', 'get', 'create', 'update', 'delete', // Logged time specific operations 'bulk-create-logged-time', 'get-person-logged-time-summary', 'get-project-logged-time-summary', 'get-logged-time-timesheet', 'get-billable-time-report', // Time off specific operations 'bulk-create-timeoff', 'approve-timeoff', 'reject-timeoff', 'get-timeoff-calendar', 'get-person-timeoff-summary', // Team holiday specific operations 'list-team-holidays-by-department', 'list-team-holidays-by-date-range', 'list-recurring-team-holidays', 'get-upcoming-team-holidays', ]); - Input schema for the standalone reject-timeoff tool: timeoff_id (required), rejected_by (optional), notes (optional).
z.object({ timeoff_id: z.union([z.string(), z.number()]).describe('The time off ID'), rejected_by: z.number().optional().describe('User ID who is rejecting'), notes: z.string().optional().describe('Optional rejection notes'), }), - src/tools/index.ts:124-278 (registration)Registration of rejectTimeOff in the legacy tools array, imported from time-management/timeoff.ts. Also the tool definition itself via createTool registers it under name 'reject-timeoff'.
rejectTimeOff, listTimeOffTypes, getTimeOffCalendar, getPersonTimeOffSummary, } from './time-management/timeoff.js'; import { listTimeOffTypes as listTimeOffTypesConfig, getTimeOffType, createTimeOffType, updateTimeOffType, deleteTimeOffType, } from './time-management/timeoff-types.js'; import { listPublicHolidays, getPublicHoliday, createPublicHoliday, updatePublicHoliday, deletePublicHoliday, } from './time-management/public-holidays.js'; import { listTeamHolidays, getTeamHoliday, createTeamHoliday, updateTeamHoliday, deleteTeamHoliday, listTeamHolidaysByDepartment, listTeamHolidaysByDateRange, listRecurringTeamHolidays, getUpcomingTeamHolidays, } from './time-management/team-holidays.js'; import { listLoggedTime, getLoggedTime, createLoggedTime, updateLoggedTime, deleteLoggedTime, bulkCreateLoggedTime, getPersonLoggedTimeSummary, getProjectLoggedTimeSummary, getLoggedTimeTimesheet, getBillableTimeReport, } from './time-management/logged-time.js'; // Reporting tools import { getTimeReport, getProjectReport, getPeopleUtilizationReport, } from './reporting/reports.js'; // Legacy tools export (preserved for backward compatibility) export const legacyTools = [ // Core entity tools listPeople, getPerson, createPerson, updatePerson, deletePerson, listDepartments, getDepartment, createDepartment, updateDepartment, deleteDepartment, listStatuses, getStatus, createStatus, updateStatus, deleteStatus, getDefaultStatus, setDefaultStatus, getStatusesByType, listRoles, getRole, createRole, updateRole, deleteRole, getRolesByPermission, getRolePermissions, updateRolePermissions, getRoleHierarchy, checkRoleAccess, listAccounts, getAccount, updateAccount, manageAccountPermissions, createAccount, deactivateAccount, reactivateAccount, getCurrentAccount, updateAccountTimezone, setAccountDepartmentFilter, bulkUpdateAccountPermissions, // Project management tools listProjects, getProject, createProject, updateProject, deleteProject, listTasks, getTask, createTask, updateTask, deleteTask, listClients, getClient, createClient, updateClient, deleteClient, listAllocations, getAllocation, createAllocation, updateAllocation, deleteAllocation, listMilestones, getMilestone, createMilestone, updateMilestone, deleteMilestone, getProjectMilestones, getUpcomingMilestones, getOverdueMilestones, completeMilestone, getMilestoneReminders, listPhases, getPhase, createPhase, updatePhase, deletePhase, listPhasesByProject, getPhasesByDateRange, getActivePhases, getPhaseSchedule, listProjectTasks, getProjectTask, createProjectTask, updateProjectTask, deleteProjectTask, getProjectTasksByProject, getProjectTasksByPhase, bulkCreateProjectTasks, reorderProjectTasks, archiveProjectTask, getProjectTaskDependencies, // Time management tools listTimeOff, getTimeOff, createTimeOff, updateTimeOff, deleteTimeOff, bulkCreateTimeOff, approveTimeOff, rejectTimeOff, listTimeOffTypes,