Skip to main content
Glama
toolName.test.ts1.09 kB
import { describe, it } from 'vitest'; import { isToolGroupName, isToolName, ToolGroupName, toolGroupNames, toolGroups, ToolName, toolNames, } from './toolName.js'; describe('toolName', () => { it('should validate each tool belongs to a group', () => { const toolNamesToGroups = Object.entries(toolGroups).reduce( (acc, [group, tools]) => { for (const tool of tools) { if (isToolName(tool) && isToolGroupName(group)) { if (acc[tool]) { acc[tool].add(group); } else { acc[tool] = new Set([group]); } } } return acc; }, {} as Record<ToolName, Set<ToolGroupName>>, ); for (const toolName of toolNames) { expect(toolNamesToGroups[toolName], `Tool ${toolName} is not in a group`).toBeDefined(); } }); it('should not allow a tool group to have the same name as a tool', () => { for (const group of toolGroupNames) { expect(isToolName(group), `Group ${group} is the same as a tool name`).toBe(false); } }); });

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/datalabs89/tableau-mcp'

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