Skip to main content
Glama
tld-info.test.ts2.02 kB
/** * Unit Tests for TLD Info Tool. */ import { executeTldInfo } from '../../src/tools/tld_info'; describe('executeTldInfo', () => { it('should return info for common TLDs', async () => { const result = await executeTldInfo({ tld: 'com', detailed: false }); expect(result.tld).toBe('com'); expect(result.description).toContain('Commercial'); expect(result.popularity).toBe('high'); expect(result.category).toBe('generic'); expect(result.price_range).toBeDefined(); expect(result.insights).toBeInstanceOf(Array); expect(result.recommendation).toBeDefined(); }); it('should return info for tech TLDs', async () => { const result = await executeTldInfo({ tld: 'io', detailed: false }); expect(result.tld).toBe('io'); expect(result.description).toContain('tech'); expect(result.popularity).toBe('high'); }); it('should return info for dev TLD with restrictions', async () => { const result = await executeTldInfo({ tld: 'dev', detailed: false }); expect(result.tld).toBe('dev'); expect(result.restrictions).toContain('Requires HTTPS (HSTS preloaded)'); }); it('should normalize TLD input', async () => { const result = await executeTldInfo({ tld: '.COM', detailed: false }); expect(result.tld).toBe('com'); }); it('should return generic info for unknown TLDs', async () => { const result = await executeTldInfo({ tld: 'xyz', detailed: false }); expect(result.tld).toBe('xyz'); expect(result.insights).toBeInstanceOf(Array); }); it('should include price insights for cheap TLDs', async () => { const result = await executeTldInfo({ tld: 'xyz', detailed: false }); const hasPriceInsight = result.insights.some((i) => i.includes('Budget') || i.includes('$'), ); expect(hasPriceInsight).toBe(true); }); it('should include recommendations', async () => { const result = await executeTldInfo({ tld: 'ai', detailed: false }); expect(result.recommendation).toContain('AI'); }); });

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/dorukardahan/domain-search-mcp'

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