Skip to main content
Glama

Backlog MCP Server

getDocument.test.ts2.7 kB
import { getDocumentTool } from './getDocument.js'; import { jest, describe, it, expect } from '@jest/globals'; import type { Backlog } from 'backlog-js'; import { createTranslationHelper } from '../createTranslationHelper.js'; describe('getDocumentTool', () => { const mockBacklog: Partial<Backlog> = { getDocument: jest.fn<() => Promise<any>>().mockResolvedValue({ id: '019347fc760c7b0abff04b44628c94d7', projectId: 1, title: 'Test Document', plain: 'This is a test document.', json: '{}', statusId: 1, emoji: null, attachments: [ { id: 22067, name: 'test.png', size: 8718, createdUser: { id: 3, userId: 'woody', name: 'woody', roleType: 2, lang: 'ja', mailAddress: 'woody@nulab.com', nulabAccount: { nulabId: 'aaa', name: 'woody', uniqueId: 'woody', iconUrl: 'https://photo', }, keyword: 'woody', lastLoginTime: '2025-05-22T23:04:03Z', }, created: '2025-05-29T02:19:54Z', }, ], tags: [ { id: 1, name: 'Backlog', }, ], createdUser: { id: 2, userId: 'woody', name: 'woody', roleType: 1, lang: 'en', mailAddress: 'woody@nulab.com', nulabAccount: null, keyword: 'Woody', lastLoginTime: '2025-05-28T22:24:36Z', }, created: '2024-12-06T01:08:56Z', updatedUser: { id: 2, userId: 'woody', name: 'woody', roleType: 1, lang: 'en', mailAddress: 'woody@nulab.com', nulabAccount: null, keyword: 'Woody', lastLoginTime: '2025-05-28T22:24:36Z', }, updated: '2025-04-28T01:47:02Z', }), }; const mockTranslationHelper = createTranslationHelper(); const tool = getDocumentTool(mockBacklog as Backlog, mockTranslationHelper); it('returns document as formatted JSON text', async () => { const result = await tool.handler({ documentId: '019347fc760c7b0abff04b44628c94d7', }); if (Array.isArray(result)) { throw new Error('Unexpected array result'); } expect(result.title).toContain('Test Document'); expect(result.plain).toContain('This is a test document.'); }); it('calls backlog.getDocument with correct params', async () => { await tool.handler({ documentId: '019347fc760c7b0abff04b44628c94d7' }); expect(mockBacklog.getDocument).toHaveBeenCalledWith( '019347fc760c7b0abff04b44628c94d7' ); }); });

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