listTimezones
Display all IANA timezones or filter by region to manage timezone data for efficient scheduling, coordination, and system configuration.
Instructions
List all available IANA timezones
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| region | No | Filter timezones by region (e.g., America, Europe) |
Implementation Reference
- src/tools/datetime.ts:112-132 (handler)The handler function that lists available IANA timezones using Intl.supportedValuesOf('timeZone'), filters by optional region, and returns as JSON.handler: async ({ region }: { region?: string }) => { try { // Get list of unique timezone names from Luxon const zones = Array.from(new Set( Intl.supportedValuesOf('timeZone') )); const filteredZones = region ? zones.filter((zone: string) => zone.startsWith(region)) : zones; return { content: [{ type: 'text', text: JSON.stringify(zones, null, 2) }] }; } catch (error) { throw new Error(`Failed to list timezones: ${error instanceof Error ? error.message : 'Unknown error'}`); } }
- src/tools/datetime.ts:102-111 (schema)Input schema for the listTimezones tool, allowing an optional 'region' string to filter timezones.inputSchema: { type: 'object', properties: { region: { type: 'string', description: 'Filter timezones by region (e.g., America, Europe)', optional: true } } },
- src/index.ts:28-35 (registration)Registration of all tools including dateTimeTools (containing listTimezones) into the allTools object used by MCP server for handling listTools and callTool requests.const allTools: ToolKit = { ...systemTools, ...networkTools, ...geoTools, ...generatorTools, ...dateTimeTools, ...securityTools };
- src/index.ts:9-9 (registration)Import of dateTimeTools module containing the listTimezones tool.import { dateTimeTools } from './tools/datetime.js';