Skip to main content
Glama

Backlog MCP Server

getWikisCount.test.ts1.49 kB
import { getWikisCountTool } from './getWikisCount.js'; import { jest, describe, it, expect } from '@jest/globals'; import type { Backlog } from 'backlog-js'; import { createTranslationHelper } from '../createTranslationHelper.js'; describe('getWikisCountTool', () => { const mockBacklog: Partial<Backlog> = { getWikisCount: jest.fn<() => Promise<any>>().mockResolvedValue({ count: 42, }), }; const mockTranslationHelper = createTranslationHelper(); const tool = getWikisCountTool(mockBacklog as Backlog, mockTranslationHelper); it('returns wiki count as formatted JSON text', async () => { const result = await tool.handler({ projectKey: 'TEST', }); if (Array.isArray(result)) { throw new Error('Unexpected array result'); } expect(result.count).toEqual(42); }); it('calls backlog.getWikisCount with correct params when using project key', async () => { await tool.handler({ projectKey: 'TEST', }); expect(mockBacklog.getWikisCount).toHaveBeenCalledWith('TEST'); }); it('calls backlog.getWikisCount with correct params when using project ID', async () => { await tool.handler({ projectId: 100, }); expect(mockBacklog.getWikisCount).toHaveBeenCalledWith(100); }); it('throws an error if neither projectId nor projectKey is provided', async () => { const params = {}; // No identifier provided await expect(tool.handler(params as any)).rejects.toThrow(Error); }); });

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/nulab/backlog-mcp-server'

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