Skip to main content
Glama
nulab

Backlog MCP Server

get_document_tree

Retrieve the hierarchical structure of documents in a Backlog project to organize and navigate wiki pages and project files.

Instructions

Gets the document tree of a project.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdOrKeyYesProject ID or Key

Implementation Reference

  • Factory function defining the 'get_document_tree' tool, including its handler that fetches the document tree via the Backlog API.
    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);
        },
      };
    };
  • Input schema definition for the tool's parameters using Zod.
    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')
        ),
    }));
  • Output schema definition (Zod) for the document tree response.
    export const DocumentTreeFullSchema: z.ZodRawShape = {
      projectId: z.number(),
      activeTree: ActiveTrashTreeSchema.optional(),
      trashTree: ActiveTrashTreeSchema.optional(),
    };
    
    export const DocumentTreeFullSchemaZ = z.object(DocumentTreeFullSchema);
  • Registration of the get_document_tree tool within the 'document' toolset group in the allTools function.
    tools: [
      getDocumentsTool(backlog, helper),
      getDocumentTreeTool(backlog, helper),
      getDocumentTool(backlog, helper),
    ],
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states 'Gets' implying a read-only operation, but doesn't clarify aspects like authentication needs, rate limits, error conditions, or what the output looks like (e.g., tree structure format). For a tool with no annotations, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, straightforward sentence with no wasted words. It's front-loaded with the core purpose, making it easy to parse quickly. This is an example of efficient communication.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description is incomplete for a tool that likely returns complex hierarchical data. It doesn't explain the return format, error handling, or behavioral nuances. For a 'get' operation with potential complexity, more context is needed to fully understand how to use it effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the parameter 'projectIdOrKey' documented as 'Project ID or Key'. The description doesn't add any meaning beyond this, such as examples or constraints. With high schema coverage, the baseline score of 3 is appropriate, as the schema already provides adequate parameter information.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Gets the document tree of a project' clearly states the action (gets) and resource (document tree of a project), but it's somewhat vague about what a 'document tree' entails. It doesn't distinguish itself from sibling tools like get_document or get_documents, which might retrieve individual documents or lists rather than hierarchical structures.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like get_document or get_documents, nor does it specify prerequisites or contexts for usage. The agent must infer usage from the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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