Skip to main content
Glama

listTimezones

Retrieve all IANA timezones with optional region filtering to support global time management and scheduling applications.

Instructions

List all available IANA timezones

Input Schema

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

Implementation Reference

  • The handler function for the 'listTimezones' tool. Retrieves all IANA timezones using Intl.supportedValuesOf('timeZone'), optionally filters by region prefix, and returns them as JSON (note: currently serializes unfiltered zones).
    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 definition for the 'listTimezones' tool, specifying an optional 'region' string parameter for filtering.
    inputSchema: { type: 'object', properties: { region: { type: 'string', description: 'Filter timezones by region (e.g., America, Europe)', optional: true } } },
  • The complete tool definition object for 'listTimezones' within the dateTimeTools export, including name, description, inputSchema, and handler. This object is imported and spread into the main allTools registry in src/index.ts.
    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:28-35 (registration)
    Registration of all tools by spreading individual toolkits (including dateTimeTools containing listTimezones) into the central allTools object used by MCP request handlers for tool listing and execution.
    const allTools: ToolKit = { ...systemTools, ...networkTools, ...geoTools, ...generatorTools, ...dateTimeTools, ...securityTools };

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/cyanheads/toolkit-mcp-server'

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