Skip to main content
Glama

getTimezones

Retrieve available timezones from Teamwork to update user timezone settings and ensure accurate scheduling across projects.

Instructions

Get all timezones available in Teamwork. This is useful when you need to update a user's timezone and need to know the available options.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the getTimezones tool. It invokes the teamworkService to retrieve timezones, formats the result as JSON text content, and handles errors using createErrorResponse.
    export async function handleGetTimezones() { logger.info('Calling teamworkService.getTimezones()'); try { const result = await teamworkService.getTimezones(); logger.info('Successfully retrieved timezones'); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (error: any) { return createErrorResponse(error, 'Retrieving timezones'); } }
  • The schema/definition for the getTimezones tool, including name, description, empty input schema (no parameters), and annotations indicating it's read-only and non-destructive.
    export const getTimezonesDefinition = { name: "getTimezones", description: "Get all timezones available in Teamwork. This is useful when you need to update a user's timezone and need to know the available options.", inputSchema: { type: 'object', properties: {}, required: [] }, annotations: { title: "Get Timezones", readOnlyHint: false, destructiveHint: false, openWorldHint: false } };
  • Registration of the getTimezones tool in the central toolPairs array in src/tools/index.ts, associating its definition and handler for use in toolHandlersMap and toolDefinitions.
    { definition: getTimezones, handler: handleGetTimezones }
  • Supporting service function that performs the actual API call to retrieve timezones from Teamwork using the v1 endpoint 'timezones.json', called by the tool handler.
    export const getTimezones = async () => { try { logger.info('Fetching all timezones'); const api = getApiClientForVersion('v1'); // Note: This is a v1 API endpoint without the projects/api/v3 prefix const response = await api.get('timezones.json'); logger.info(`Successfully retrieved ${response.data.timezones?.length || 0} timezones`); return response.data; } catch (error: any) { logger.error(`Error fetching timezones: ${error.message}`); throw new Error(`Failed to fetch timezones: ${error.message}`); } };

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/Vizioz/Teamwork-MCP'

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