Skip to main content
Glama
nulab

Backlog MCP Server

get_pull_request_comments

Retrieve and manage comments for a specific pull request in Backlog projects to track feedback and discussions.

Instructions

Returns list of comments for a pull request

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdNoThe numeric ID of the project (e.g., 12345)
projectKeyNoThe key of the project (e.g., 'PROJECT')
repoIdNoRepository ID
repoNameNoRepository ID
numberYesPull request number
minIdNoMinimum comment ID
maxIdNoMaximum comment ID
countNoNumber of comments to retrieve
orderNoSort order

Implementation Reference

  • The async handler function that resolves project and repository identifiers using utility functions and calls the Backlog client's getPullRequestComments method to retrieve the comments.
    handler: async ({
      projectId,
      projectKey,
      repoId,
      repoName,
      number,
      ...params
    }) => {
      const result = resolveIdOrKey(
        'project',
        { id: projectId, key: projectKey },
        t
      );
      if (!result.ok) {
        throw result.error;
      }
      const repoResult = resolveIdOrName(
        'repository',
        { id: repoId, name: repoName },
        t
      );
      if (!repoResult.ok) {
        throw repoResult.error;
      }
      return backlog.getPullRequestComments(
        result.value,
        String(repoResult.value),
        number,
        params
      );
    },
  • Input schema definition using Zod for parameters like project ID/key, repo ID/name, pull request number, and optional filters for comments.
    const getPullRequestCommentsSchema = buildToolSchema((t) => ({
      projectId: z
        .number()
        .optional()
        .describe(
          t(
            'TOOL_GET_PROJECT_PROJECT_ID',
            'The numeric ID of the project (e.g., 12345)'
          )
        ),
      projectKey: z
        .string()
        .optional()
        .describe(
          t(
            'TOOL_GET_PROJECT_PROJECT_KEY',
            "The key of the project (e.g., 'PROJECT')"
          )
        ),
      repoId: z
        .number()
        .optional()
        .describe(
          t('TOOL_GET_PULL_REQUEST_COMMENTS_REPO_ID_OR_NAME', 'Repository ID')
        ),
      repoName: z
        .string()
        .optional()
        .describe(
          t('TOOL_GET_PULL_REQUEST_COMMENTS_REPO_ID_OR_NAME', 'Repository name')
        ),
      number: z
        .number()
        .describe(
          t('TOOL_GET_PULL_REQUEST_COMMENTS_NUMBER', 'Pull request number')
        ),
      minId: z
        .number()
        .optional()
        .describe(t('TOOL_GET_PULL_REQUEST_COMMENTS_MIN_ID', 'Minimum comment ID')),
      maxId: z
        .number()
        .optional()
        .describe(t('TOOL_GET_PULL_REQUEST_COMMENTS_MAX_ID', 'Maximum comment ID')),
      count: z
        .number()
        .optional()
        .describe(
          t(
            'TOOL_GET_PULL_REQUEST_COMMENTS_COUNT',
            'Number of comments to retrieve'
          )
        ),
      order: z
        .enum(['asc', 'desc'])
        .optional()
        .describe(t('TOOL_GET_PULL_REQUEST_COMMENTS_ORDER', 'Sort order')),
    }));
  • The tool is instantiated and registered in the 'git' toolset group within the allTools function.
    getPullRequestCommentsTool(backlog, helper),
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure but offers minimal information. It doesn't mention whether this is a read-only operation, what authentication might be required, rate limits, pagination behavior, or what happens when parameters like 'minId' or 'maxId' are used. The description only states what the tool does at the most basic level.

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 extremely concise at just 7 words, with zero wasted language. It gets straight to the point without any unnecessary elaboration, making it easy to parse and understand at a glance. The single sentence structure is optimal for such a straightforward tool purpose.

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?

For a tool with 9 parameters, no annotations, and no output schema, the description is insufficiently complete. It doesn't explain the return format, how comments are structured, whether the tool supports pagination, or how the various filtering parameters interact. The agent would need to guess about important behavioral aspects despite the comprehensive parameter schema.

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 description adds no parameter information beyond what's already in the schema (which has 100% coverage). While the schema thoroughly documents all 9 parameters, the description doesn't provide any additional context about parameter relationships, usage patterns, or examples that would help an agent understand how to effectively use the filtering parameters like 'minId', 'maxId', and 'count'.

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

Purpose4/5

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

The description clearly states the tool's purpose with a specific verb ('Returns') and resource ('list of comments for a pull request'), making it immediately understandable. However, it doesn't differentiate from sibling tools like 'get_issue_comments' or 'get_pull_request', which could cause confusion about when to use this specific tool versus alternatives.

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. With many sibling tools available (like 'get_issue_comments', 'get_pull_request', and 'get_pull_requests'), there's no indication of when this specific comment-retrieval tool is appropriate versus other comment or pull request-related tools.

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