Skip to main content
Glama

Timezone MCP Server

by sam-artuso
get-timezone-info.tool.tsβ€’1.11 kB
import { Injectable } from '@nestjs/common' import { Tool } from '@rekog/mcp-nest' import { z } from 'zod' import { TimezoneService } from '../../timezone/timezone.service' @Injectable() export class GetTimezoneInfoTool { constructor(private readonly timezoneService: TimezoneService) {} @Tool({ name: 'get_timezone_info', description: 'Get the current date and time in a specific timezone with ISO 8601 formatted timestamps', parameters: z.object({ region: z.string().describe('Timezone region (e.g., America, Europe, Asia)'), city: z.string().describe('City or location name (e.g., New_York, London, Tokyo)'), }), }) async execute(params: { region: string; city: string }) { const { region, city } = params if (!region || !city) { throw new Error('Region and city parameters are required') } const timezone = `${region}/${city}` const timeInfo = this.timezoneService.getTimeInTimezone(timezone) return { content: [ { type: 'text', text: JSON.stringify(timeInfo), }, ], } } }

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/sam-artuso/demo-mcp'

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