Skip to main content
Glama

Timezone MCP Server

by sam-artuso
get-regions.tool.spec.tsβ€’1.69 kB
import { describe, it, expect, beforeEach, vi } from 'vitest' import { GetRegionsTool } from './get-regions.tool' import { TimezoneService } from '../../timezone/timezone.service' describe('GetRegionsTool', () => { let tool: GetRegionsTool let timezoneService: TimezoneService beforeEach(() => { timezoneService = new TimezoneService() tool = new GetRegionsTool(timezoneService) }) describe('execute', () => { it('should return all timezone regions', async () => { const result = await tool.execute() expect(result).toHaveProperty('content') expect(result.content).toBeInstanceOf(Array) expect(result.content).toHaveLength(1) expect(result.content[0]).toHaveProperty('type', 'text') expect(result.content[0]).toHaveProperty('text') }) it('should return valid JSON string with regions and count', async () => { const result = await tool.execute() const data = JSON.parse(result.content[0].text) expect(data).toHaveProperty('regions') expect(data).toHaveProperty('count') expect(data.regions).toBeInstanceOf(Array) expect(data.count).toBe(data.regions.length) }) it('should include standard timezone regions', async () => { const result = await tool.execute() const data = JSON.parse(result.content[0].text) expect(data.regions).toContain('America') expect(data.regions).toContain('Europe') expect(data.regions).toContain('Asia') }) it('should call timezoneService.getRegions', async () => { const spy = vi.spyOn(timezoneService, 'getRegions') await tool.execute() expect(spy).toHaveBeenCalledOnce() }) }) })

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