Skip to main content
Glama

Backlog MCP Server

getDocumentTree.ts1.14 kB
import { Backlog } from 'backlog-js'; import { z } from 'zod'; import { TranslationHelper } from '../createTranslationHelper.js'; import { DocumentTreeFullSchema, DocumentTreeFullSchemaZ, } from '../types/zod/backlogOutputDefinition.js'; import { buildToolSchema, ToolDefinition } from '../types/tool.js'; const getDocumentTreeSchema = buildToolSchema((t) => ({ projectIdOrKey: z .union([z.string(), z.number()]) .describe( t('TOOL_GET_DOCUMENT_TREE_PROJECT_ID_OR_KEY', 'Project ID or Key') ), })); export const getDocumentTreeTool = ( backlog: Backlog, { t }: TranslationHelper ): ToolDefinition< ReturnType<typeof getDocumentTreeSchema>, typeof DocumentTreeFullSchema > => { return { name: 'get_document_tree', description: t( 'TOOL_GET_DOCUMENT_TREE_DESCRIPTION', 'Gets the document tree of a project.' ), schema: z.object(getDocumentTreeSchema(t)), outputSchema: DocumentTreeFullSchemaZ, importantFields: ['projectId', 'activeTree', 'trashTree'], handler: async ({ projectIdOrKey }) => { return backlog.getDocumentTree(projectIdOrKey); }, }; };

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