Skip to main content
Glama
lis186

Taiwan Holiday MCP Server

by lis186

check_holiday

Determine if a specific date is a holiday in Taiwan by entering the date in YYYY-MM-DD or YYYYMMDD format.

Instructions

檢查指定日期是否為台灣假期

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateYes要查詢的日期,支援格式:YYYY-MM-DD 或 YYYYMMDD

Implementation Reference

  • src/server.ts:75-91 (registration)
    Registration of the 'check_holiday' tool including its name, description, and input schema in the ListToolsRequestSchema handler.
    {
      name: 'check_holiday',
      description: '檢查指定日期是否為台灣假期',
      inputSchema: {
        type: 'object',
        properties: {
          date: {
            type: 'string',
            description: '要查詢的日期,支援格式:YYYY-MM-DD 或 YYYYMMDD',
            pattern: '^(\\d{4}-\\d{2}-\\d{2}|\\d{8})$'
          }
        },
        required: ['date'],
        additionalProperties: false,
      },
    } as Tool,
    {
  • The main handler function for the 'check_holiday' tool, which extracts the date argument, calls the HolidayService, and formats the response.
    private async handleCheckHoliday(args: any) {
      const { date } = args;
      
      if (!date || typeof date !== 'string') {
        throw new Error('缺少必要參數:date');
      }
    
      const holiday = await this.holidayService.checkHoliday(date);
      
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify({
              success: true,
              data: {
                date: date,
                isHoliday: holiday?.isHoliday || false,
                description: holiday?.description || '一般工作日',
                week: holiday?.week || '',
                normalizedDate: holiday?.date || ''
              },
              timestamp: new Date().toISOString(),
              tool: 'check_holiday'
            }, null, 2),
          },
        ],
      };
    }
  • Core logic implementation in HolidayService that parses the date, fetches holidays for the year (using cache), and checks if the date matches any holiday.
    async checkHoliday(dateString: string): Promise<Holiday | null> {
      try {
        const parsedDate = parseDate(dateString);
        const holidays = await this.getHolidaysForYear(parsedDate.year);
        
        return holidays.find(holiday => holiday.date === parsedDate.normalized) || null;
      } catch (error) {
        if (error instanceof DateParseError) {
          throw new HolidayServiceError(
            `日期解析錯誤: ${error.message}`,
            error.type,
            error
          );
        }
        throw error;
      }
    }
  • src/server.ts:145-147 (registration)
    Registration of the tool handler in the switch statement of CallToolRequestSchema.
    case 'check_holiday':
      return await this.handleCheckHoliday(args);

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.2/5.0
Behavior2/5

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

No annotations are provided, and the description does not disclose behavioral details such as return format, handling of invalid dates, or what constitutes a 'holiday' (e.g., official calendar). The description carries the full burden and is minimal.

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

Conciseness5/5

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

The description is a single, concise sentence in Chinese that is front-loaded and free of fluff. Every word contributes to the tool's purpose.

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?

Given there is no output schema or annotations, the description should explain what the tool returns (e.g., true/false) and any relevant context about holiday definitions. It does neither, making it incomplete for an agent to fully understand the tool's behavior.

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 covers the single parameter (date) with format constraints and description. The tool description adds no additional parameter semantics beyond the schema, so the baseline of 3 applies.

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 clearly states the tool checks if a specified date is a Taiwan holiday. It uses a specific verb ('check') and resource ('date is Taiwan holiday'), distinguishing it from sibling tools that handle ranges or statistics.

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 the alternatives (get_holidays_in_range, get_holiday_stats). The intended use case (single-date checking) is implied by the name and description but not explicitly contrasted with siblings.

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