Skip to main content
Glama

listTimezones

Filter and retrieve all IANA timezones by region or globally. Simplify timezone selection for applications and configurations.

Instructions

List all available IANA timezones

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
regionNoFilter timezones by region (e.g., America, Europe)

Implementation Reference

  • Handler function for the listTimezones tool. Fetches IANA timezones using Intl.supportedValuesOf('timeZone'), filters by optional region, but currently serializes all zones (note: potential bug, uses 'zones' instead of 'filteredZones').
    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'}`); } } }
  • Input schema for listTimezones tool, defining an optional 'region' parameter for filtering timezones.
    inputSchema: { type: 'object', properties: { region: { type: 'string', description: 'Filter timezones by region (e.g., America, Europe)', optional: true } } },
  • Definition and local registration of the listTimezones tool within the dateTimeTools export object.
    listTimezones: { name: 'listTimezones', description: 'List all available IANA timezones', inputSchema: { type: 'object', properties: { region: { type: 'string', description: 'Filter timezones by region (e.g., America, Europe)', optional: true } } }, 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/index.ts:27-33 (registration)
    Global registration of listTimezones by spreading dateTimeTools into the allTools object, which is used by MCP server for tool discovery (list) and execution (call).
    const allTools: ToolKit = { ...encodingTools, ...geoTools, ...generatorTools, ...dateTimeTools, ...securityTools };

Other Tools

Related 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/MissionSquad/mcp-helper-tools'

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