Skip to main content
Glama

get-public-holiday

Retrieve comprehensive details of a public holiday by providing its unique ID. Get name, date, and other attributes for scheduling or absence tracking.

Instructions

Get detailed information about a specific public holiday

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
holiday_idYesThe public holiday ID

Implementation Reference

  • The handler function for the 'get-public-holiday' tool. It calls floatApi.get with the holiday ID and validates the response against publicHolidaySchema.
    // Get public holiday details
    export const getPublicHoliday = createTool(
      'get-public-holiday',
      'Get detailed information about a specific public holiday',
      z.object({
        holiday_id: z.union([z.string(), z.number()]).describe('The public holiday ID'),
      }),
      async (params) => {
        const holiday = await floatApi.get(
          `/public-holidays/${params.holiday_id}`,
          publicHolidaySchema
        );
        return holiday;
      }
    );
  • The Zod schema (publicHolidaySchema) that validates the public holiday data returned by the API.
    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
    });
  • The 'getPublicHoliday' tool is imported from public-holidays.ts and registered in the legacyTools array (line 287) for use by the MCP server.
      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];
  • The createTool factory function that wraps the handler with schema validation and error handling.
    export const createTool = <T, P extends z.ZodType>(
      name: string,
      description: string,
      schema: P,
      handler: (params: z.infer<P>) => Promise<T>
    ): {
      name: string;
      description: string;
      inputSchema: P;
      handler: (params: unknown) => Promise<ToolResponse<T>>;
    } => {
      return {
        name,
        description,
        inputSchema: schema,
        handler: async (params: unknown): Promise<ToolResponse<T>> => {
          try {
            const validatedParams = schema.parse(params);
            const result = await handler(validatedParams);
    
            // Extract format from params if available
            const responseFormat =
              ((validatedParams as Record<string, unknown>).format as ResponseFormat) || 'json';
    
            return { success: true, data: result, format: responseFormat };
          } catch (error) {
            logger.error(`Error in ${name} tool:`, error);
    
            // Handle Float API errors with enhanced formatting
            if (error instanceof FloatApiError) {
              return FloatErrorHandler.formatErrorForMcp(error) as ToolResponse<T>;
            }
    
            // Handle parameter validation errors
            if (error instanceof z.ZodError) {
              return {
                success: false,
                error: `Parameter validation failed: ${error.errors.map((e) => `${e.path.join('.')}: ${e.message}`).join(', ')}`,
                errorCode: 'PARAMETER_VALIDATION_ERROR',
                details: {
                  validationErrors: error.errors,
                },
              } as ToolResponse<T>;
            }
    
            // Handle other errors
            return {
              success: false,
              error: error instanceof Error ? error.message : 'Unknown error occurred',
              errorCode: 'UNKNOWN_ERROR',
            } as ToolResponse<T>;
          }
        },
      };
    };
  • The floatApi.get method used by the handler to make GET requests to the Float API.
    async get<T>(url: string, schema?: z.ZodType<T>, format: ResponseFormat = 'json'): Promise<T> {
      return this.handleRateLimitRetry(() =>
        this.makeRequest<T>('GET', url, undefined, schema, format)
      );
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description must disclose behavioral traits. It only states 'Get detailed information', implying a read operation, but does not mention error handling (e.g., if holiday_id is invalid), authentication needs, or any side effects. The absence of such details is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is one sentence, which is concise and front-loaded with the key action and resource. However, it lacks additional useful details that could be added without significant bloat, such as mentioning the unique identifier requirement.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple tool with one parameter and no output schema, the description does not specify what 'detailed information' entails (e.g., fields returned), error behavior for missing holidays, or any prerequisites. The agent may struggle to understand the full context of using this tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% coverage, documenting holiday_id as 'The public holiday ID'. The tool description does not add any additional meaning or context for the parameter, such as expected format or examples. Baseline 3 is appropriate since the schema already describes the parameter adequately.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get detailed information about a specific public holiday' clearly states the action (Get) and the resource (detailed information about a specific public holiday). It distinguishes from sibling list-public-holidays by implying a single holiday focus.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like list-public-holidays for multiple holidays or create-public-holiday for adding new ones. The agent is left to infer usage from the name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/asachs01/float-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server