Skip to main content
Glama
nulab

Backlog MCP Server

get_document

Retrieve document details from Backlog projects using its unique ID to access information and content.

Instructions

Gets information about a document.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
documentIdYesDocument ID

Implementation Reference

  • The handler function that implements the core logic of the 'get_document' tool by retrieving the document using the Backlog client's getDocument method.
    handler: async ({ documentId }) => {
      return backlog.getDocument(documentId);
    },
  • The Zod input schema definition for the 'get_document' tool, specifying the required 'documentId' string parameter.
    const getDocumentSchema = buildToolSchema((t) => ({
      documentId: z
        .string()
        .describe(t('TOOL_GET_DOCUMENT_DOCUMENT_ID', 'Document ID')),
    }));
  • Registration of the 'get_document' tool within the 'document' toolset group by calling its factory function getDocumentTool and adding it to the tools array.
    tools: [
      getDocumentsTool(backlog, helper),
      getDocumentTreeTool(backlog, helper),
      getDocumentTool(backlog, helper),
    ],
  • The factory function that creates and defines the ToolDefinition object for 'get_document', including name, description, schema, and handler.
    export const getDocumentTool = (
      backlog: Backlog,
      { t }: TranslationHelper
    ): ToolDefinition<
      ReturnType<typeof getDocumentSchema>,
      (typeof DocumentItemSchema)['shape']
    > => {
      return {
        name: 'get_document',
        description: t(
          'TOOL_GET_DOCUMENT_DESCRIPTION',
          'Gets information about a document.'
        ),
        schema: z.object(getDocumentSchema(t)),
        outputSchema: DocumentItemSchema,
        importantFields: ['id', 'title', 'createdUser'],
        handler: async ({ documentId }) => {
          return backlog.getDocument(documentId);
        },
      };
    };

Latest Blog Posts

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