Skip to main content
Glama

Backlog MCP Server

addWiki.test.ts2.04 kB
import { addWikiTool } from './addWiki.js'; import { jest, describe, it, expect } from '@jest/globals'; import type { Backlog } from 'backlog-js'; import { createTranslationHelper } from '../createTranslationHelper.js'; describe('addWikiTool', () => { const mockBacklog: Partial<Backlog> = { postWiki: jest.fn<() => Promise<any>>().mockResolvedValue({ id: 1, projectId: 100, name: 'Getting Started', content: '# Welcome to the project\n\nThis is a wiki page.', createdUser: { id: 1, userId: 'admin', name: 'Admin User', roleType: 1, lang: 'en', mailAddress: 'admin@example.com', }, created: '2023-01-01T00:00:00Z', updatedUser: { id: 1, userId: 'admin', name: 'Admin User', roleType: 1, lang: 'en', mailAddress: 'admin@example.com', }, updated: '2023-01-01T00:00:00Z', }), }; const mockTranslationHelper = createTranslationHelper(); const tool = addWikiTool(mockBacklog as Backlog, mockTranslationHelper); it('returns created wiki as formatted JSON text', async () => { const result = await tool.handler({ projectId: 100, name: 'Getting Started', content: '# Welcome to the project\n\nThis is a wiki page.', mailNotify: false, }); if (Array.isArray(result)) { throw new Error('Unexpected array result'); } expect(result.name).toEqual('Getting Started'); expect(result.content).toContain('Welcome to the project'); }); it('calls backlog.postWiki with correct params', async () => { const params = { projectId: 100, name: 'Getting Started', content: '# Welcome to the project\n\nThis is a wiki page.', mailNotify: false, }; await tool.handler(params); expect(mockBacklog.postWiki).toHaveBeenCalledWith({ projectId: 100, name: 'Getting Started', content: '# Welcome to the project\n\nThis is a wiki page.', mailNotify: 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/nulab/backlog-mcp-server'

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