Skip to main content
Glama

Backlog MCP Server

getWiki.test.ts1.74 kB
import { getWikiTool } from './getWiki.js'; import { jest, describe, it, expect } from '@jest/globals'; import type { Backlog } from 'backlog-js'; import { createTranslationHelper } from '../createTranslationHelper.js'; describe('getWikiTool', () => { const mockBacklog: Partial<Backlog> = { getWiki: jest.fn<() => Promise<any>>().mockResolvedValue({ id: 1234, projectId: 100, name: 'Sample Wiki', content: '# Sample Wiki Content\n\nThis is a sample wiki page.', tags: [ { id: 1, name: 'documentation' }, { id: 2, name: 'guide' }, ], attachments: [], sharedFiles: [], stars: [], createdUser: { id: 1, userId: 'user1', name: 'User One', }, created: '2023-01-01T00:00:00Z', updated: '2023-01-02T00:00:00Z', }), }; const mockTranslationHelper = createTranslationHelper(); const tool = getWikiTool(mockBacklog as Backlog, mockTranslationHelper); it('returns wiki information as formatted JSON text', async () => { const result = await tool.handler({ wikiId: 1234, }); if (Array.isArray(result)) { throw new Error('Unexpected array result'); } expect(result.name).toEqual('Sample Wiki'); expect(result.content).toContain('Sample Wiki Content'); }); it('calls backlog.getWiki with correct params when using number ID', async () => { await tool.handler({ wikiId: 1234, }); expect(mockBacklog.getWiki).toHaveBeenCalledWith(1234); }); it('calls backlog.getWiki with correct params when using string ID', async () => { await tool.handler({ wikiId: '1234', }); expect(mockBacklog.getWiki).toHaveBeenCalledWith(1234); }); });

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