update-team-holiday
Update an existing team holiday in float.com by specifying the holiday ID and modifying fields such as name, dates, type, recurrence, or notes.
Instructions
Update an existing team holiday
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| holiday_id | Yes | The team holiday ID (holiday_id) | |
| name | No | Holiday name | |
| description | No | Holiday description | |
| start_date | No | Holiday start date (YYYY-MM-DD) | |
| end_date | No | Holiday end date (YYYY-MM-DD) | |
| holiday_type | No | Holiday type (0=full day, 1=partial day) | |
| department_id | No | Department ID for department-specific holiday | |
| region_id | No | Region ID for region-specific holiday | |
| recurring | No | Recurring status (0=one-time, 1=recurring) | |
| recurrence_pattern | No | Recurrence pattern for recurring holidays | |
| active | No | Active status (0=inactive, 1=active) | |
| notes | No | Additional notes | |
| color | No | Hex color code for calendar display | |
| all_day | No | All day status (0=not all day, 1=all day) | |
| timezone | No | Timezone for the holiday |
Implementation Reference
- Handler function for the update-team-holiday tool. Uses createTool wrapper with Zod input schema (requires holiday_id, optional fields for update). Extracts holiday_id and sends a PATCH request to /team-holidays/{holiday_id} via floatApi.patch(), validated with teamHolidaySchema.
// Update team holiday export const updateTeamHoliday = createTool( 'update-team-holiday', 'Update an existing team holiday', z.object({ holiday_id: z.union([z.string(), z.number()]).describe('The team holiday ID (holiday_id)'), name: z.string().optional().describe('Holiday name'), description: z.string().optional().describe('Holiday description'), start_date: z.string().optional().describe('Holiday start date (YYYY-MM-DD)'), end_date: z.string().optional().describe('Holiday end date (YYYY-MM-DD)'), holiday_type: z.number().optional().describe('Holiday type (0=full day, 1=partial day)'), department_id: z.number().optional().describe('Department ID for department-specific holiday'), region_id: z.number().optional().describe('Region ID for region-specific holiday'), recurring: z.number().optional().describe('Recurring status (0=one-time, 1=recurring)'), recurrence_pattern: z.string().optional().describe('Recurrence pattern for recurring holidays'), active: z.number().optional().describe('Active status (0=inactive, 1=active)'), notes: z.string().optional().describe('Additional notes'), color: z.string().optional().describe('Hex color code for calendar display'), all_day: z.number().optional().describe('All day status (0=not all day, 1=all day)'), timezone: z.string().optional().describe('Timezone for the holiday'), }), async (params) => { const { holiday_id, ...updateData } = params; const holiday = await floatApi.patch( `/team-holidays/${holiday_id}`, updateData, teamHolidaySchema ); return holiday; } ); - src/types/float.ts:200-219 (schema)Zod schema for team holiday response validation. Includes all possible fields returned from the Float API for team holidays.
export const teamHolidaySchema = z.object({ holiday_id: z.number().optional(), // Float API uses holiday_id name: z.string(), description: z.string().nullable().optional(), start_date: z.string(), // ISO date format (YYYY-MM-DD) end_date: z.string(), // ISO date format (YYYY-MM-DD) holiday_type: z.number().nullable().optional(), // 0 = full day, 1 = partial day department_id: z.number().nullable().optional(), // Department-specific holiday region_id: z.number().nullable().optional(), // Region-specific holiday recurring: z.number().nullable().optional(), // 0 = one-time, 1 = recurring recurrence_pattern: z.string().nullable().optional(), // For recurring holidays active: z.number().nullable().optional(), // 0 = inactive, 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' created_by: z.number().nullable().optional(), // User ID who created the holiday notes: z.string().nullable().optional(), color: z.string().nullable().optional(), // Hex color code for calendar display all_day: z.number().nullable().optional(), // 0 = not all day, 1 = all day timezone: z.string().nullable().optional(), // Timezone for the holiday }); - src/tools/index.ts:294-295 (registration)Tool registered in the legacyTools array for backward compatibility. Exported and included in both 'tools' and 'allTools' arrays.
updateTeamHoliday, deleteTeamHoliday, - src/tools/index.ts:143-153 (registration)Import of updateTeamHoliday from the team-holidays module in the central tools index.
import { listTeamHolidays, getTeamHoliday, createTeamHoliday, updateTeamHoliday, deleteTeamHoliday, listTeamHolidaysByDepartment, listTeamHolidaysByDateRange, listRecurringTeamHolidays, getUpcomingTeamHolidays, } from './time-management/team-holidays.js'; - src/services/float-api.ts:654-661 (helper)The FloatApi.patch() method used by the update-team-holiday handler to make the actual HTTP PATCH request to the Float API.
async patch<T>( url: string, data: unknown, schema?: z.ZodType<T>, format: ResponseFormat = 'json' ): Promise<T> { return this.handleRateLimitRetry(() => this.makeRequest<T>('PATCH', url, data, schema, format)); }