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);
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states what the tool does but doesn't describe how it behaves: it doesn't mention data sources, accuracy, update frequency, error handling, or response format. For a tool with no annotations, this leaves significant gaps in understanding its operational characteristics.

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, clear sentence that directly states the tool's purpose without any unnecessary words. It's appropriately sized and front-loaded, with every word earning its place. No structural issues or verbosity detract from its clarity.

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

Completeness3/5

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

Given the tool's low complexity (1 parameter, no nested objects) and high schema coverage, the description is minimally adequate. However, with no output schema and no annotations, it doesn't explain what the return value looks like (e.g., boolean, holiday name, or error messages). For a simple lookup tool, this is acceptable but leaves room for improvement.

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% description coverage, with the 'date' parameter fully documented in the schema itself (format, pattern). The description adds no additional parameter semantics beyond what's already in the schema. According to the rules, when schema_description_coverage is high (>80%), the baseline is 3 even with no param info in the description.

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

Purpose4/5

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

The description clearly states the tool's purpose: '檢查指定日期是否為台灣假期' (Check if a specified date is a Taiwan holiday). It uses a specific verb ('檢查' - check) and resource ('台灣假期' - Taiwan holidays). However, it doesn't explicitly distinguish itself from sibling tools like 'get_holidays_in_range' or 'get_holiday_stats', which reduces it from a perfect score.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools or suggest scenarios where this single-date check would be preferred over range-based queries or statistical tools. The agent must infer usage from the tool name and description 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/lis186/taiwan-holiday-mcp'

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