Skip to main content
Glama

getTimezones

Retrieve a list of available timezones from the Teamwork MCP server to accurately update or manage user timezone settings.

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 handler function that executes the getTimezones tool logic. It calls the teamworkService.getTimezones(), formats the result as JSON text, and handles errors.
    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) { logger.error(`Error in getTimezones handler: ${error.message}`); return { content: [{ type: "text", text: `Error retrieving timezones: ${error.message}` }] }; } }
  • The schema/definition for the getTimezones tool, including name, description, input schema (empty), and annotations.
    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 } };
  • Import of the getTimezones tool definition and handler in the central tools index for registration.
    import { getTimezonesDefinition as getTimezones, handleGetTimezones } from './core/getTimezones.js';
  • Pairing of definition and handler for getTimezones in the toolPairs array used for tool registration and handler mapping.
    { definition: getTimezones, handler: handleGetTimezones }
  • Helper service function that performs the actual API call to retrieve timezones from Teamwork using v1 endpoint.
    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