list-public-holidays
Filter and list public holidays by date range, region, country, active status, moveable, recurring, year, and pagination. This tool returns holidays matching your specified criteria.
Instructions
List all public holidays with optional filtering by date range, region, and status
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| start_date | No | Start date filter (YYYY-MM-DD) | |
| end_date | No | End date filter (YYYY-MM-DD) | |
| region | No | Filter by region or country code | |
| country | No | Filter by country name | |
| active | No | Filter by active status (0=archived, 1=active) | |
| moveable | No | Filter by moveable status (0=fixed, 1=moveable) | |
| recurring | No | Filter by recurring status (0=one-time, 1=recurring) | |
| year | No | Filter by year | |
| page | No | Page number for pagination | |
| per-page | No | Number of items per page (max 200) |
Implementation Reference
- The 'listPublicHolidays' tool handler created via createTool() with name 'list-public-holidays'. It accepts optional filters (start_date, end_date, region, country, active, moveable, recurring, year, page, per-page) and calls floatApi.getPaginated() to GET /public-holidays.
export const listPublicHolidays = createTool( 'list-public-holidays', 'List all public holidays with optional filtering by date range, region, and status', z.object({ start_date: z.string().optional().describe('Start date filter (YYYY-MM-DD)'), end_date: z.string().optional().describe('End date filter (YYYY-MM-DD)'), region: z.string().optional().describe('Filter by region or country code'), country: z.string().optional().describe('Filter by country name'), active: z.number().optional().describe('Filter by active status (0=archived, 1=active)'), moveable: z.number().optional().describe('Filter by moveable status (0=fixed, 1=moveable)'), recurring: z .number() .optional() .describe('Filter by recurring status (0=one-time, 1=recurring)'), year: z.number().optional().describe('Filter by year'), page: z.number().optional().describe('Page number for pagination'), 'per-page': z.number().optional().describe('Number of items per page (max 200)'), }), async (params) => { const response = await floatApi.getPaginated( '/public-holidays', params, publicHolidaysResponseSchema ); return response; } ); - Input schema (Zod) for list-public-holidays tool defining optional filter parameters: start_date, end_date, region, country, active, moveable, recurring, year, page, per-page.
z.object({ start_date: z.string().optional().describe('Start date filter (YYYY-MM-DD)'), end_date: z.string().optional().describe('End date filter (YYYY-MM-DD)'), region: z.string().optional().describe('Filter by region or country code'), country: z.string().optional().describe('Filter by country name'), active: z.number().optional().describe('Filter by active status (0=archived, 1=active)'), moveable: z.number().optional().describe('Filter by moveable status (0=fixed, 1=moveable)'), recurring: z .number() .optional() .describe('Filter by recurring status (0=one-time, 1=recurring)'), year: z.number().optional().describe('Filter by year'), page: z.number().optional().describe('Page number for pagination'), 'per-page': z.number().optional().describe('Number of items per page (max 200)'), }), - src/types/float.ts:368-385 (schema)PublicHoliday schema (Zod) defining the shape of a public holiday object, and publicHolidaysResponseSchema (array of publicHolidaySchema) for response validation.
// Public Holiday schema - based on Float API v3 structure export const publicHolidaySchema = z.object({ holiday_id: z.union([z.string(), z.number()]).optional(), // Float API uses holiday_id name: z.string(), date: z.string(), // ISO date format (YYYY-MM-DD) region: z.string().nullable().optional(), // Region or country code country: z.string().nullable().optional(), // Country name type: z.string().nullable().optional(), // Holiday type (bank_holiday, observed, etc.) active: z.number().nullable().optional(), // 0 = archived, 1 = active created: z.string().nullable().optional(), // Float API uses 'created', not 'created_at' modified: z.string().nullable().optional(), // Float API uses 'modified', not 'updated_at' moveable: z.number().nullable().optional(), // 0 = fixed date, 1 = moveable year: z.number().nullable().optional(), // Year for the holiday recurring: z.number().nullable().optional(), // 0 = one-time, 1 = recurring notes: z.string().nullable().optional(), // Additional notes }); export const publicHolidaysResponseSchema = z.array(publicHolidaySchema); - src/services/float-api.ts:684-696 (helper)getPaginated() method on FloatApi class that builds query params, defaults per-page to 200, and performs a GET request. Used by the listPublicHolidays handler.
async getPaginated<T>( url: string, params?: Record<string, unknown>, schema?: z.ZodType<T[]>, format: ResponseFormat = 'json' ): Promise<T[]> { const queryString = this.buildQueryParams({ ...params, 'per-page': params?.['per-page'] || 200, // Float API max page size }); return this.get<T[]>(`${url}${queryString}`, schema, format); } - src/tools/index.ts:136-319 (registration)listPublicHolidays is imported from './time-management/public-holidays.ts' (line 137) and registered in the legacyTools array (line 286), which is exported as part of the 'tools' and 'allTools' arrays.
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, getTimeOffCalendar, getPersonTimeOffSummary, listTimeOffTypesConfig, getTimeOffType, createTimeOffType, updateTimeOffType, deleteTimeOffType, listPublicHolidays, getPublicHoliday, createPublicHoliday, updatePublicHoliday, deletePublicHoliday, listTeamHolidays, getTeamHoliday, createTeamHoliday, updateTeamHoliday, deleteTeamHoliday, listTeamHolidaysByDepartment, listTeamHolidaysByDateRange, listRecurringTeamHolidays, getUpcomingTeamHolidays, listLoggedTime, getLoggedTime, createLoggedTime, updateLoggedTime, deleteLoggedTime, bulkCreateLoggedTime, getPersonLoggedTimeSummary, getProjectLoggedTimeSummary, getLoggedTimeTimesheet, getBillableTimeReport, // Reporting tools getTimeReport, getProjectReport, getPeopleUtilizationReport, ]; // Primary export: Optimized tools (4 consolidated tools replacing 246+ granular tools) // Also includes legacy tools for backward compatibility with existing tests export const tools = [...optimizedTools, ...legacyTools];