Skip to main content
Glama

get_pull_request_comments

Retrieve and manage comments for a specific pull request in Backlog projects by specifying project, repository, and pull request details for streamlined collaboration.

Instructions

Returns list of comments for a pull request

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
countNoNumber of comments to retrieve
maxIdNoMaximum comment ID
minIdNoMinimum comment ID
numberYesPull request number
orderNoSort order
projectIdOrKeyYesProject ID or project key
repoIdOrNameYesRepository ID or name

Implementation Reference

  • The async handler that implements the core tool logic: resolves project and repository using utility functions, then invokes the Backlog API method getPullRequestComments.
    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 ); },
  • Zod input schema for the tool parameters: projectId/projectKey, repoId/repoName, pull request number, optional filters like minId, maxId, count, order.
    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')), }));
  • Registration of the getPullRequestCommentsTool within the 'git' toolset group in the allTools export.
    tools: [ getGitRepositoriesTool(backlog, helper), getGitRepositoryTool(backlog, helper), getPullRequestsTool(backlog, helper), getPullRequestsCountTool(backlog, helper), getPullRequestTool(backlog, helper), addPullRequestTool(backlog, helper), updatePullRequestTool(backlog, helper), getPullRequestCommentsTool(backlog, helper), addPullRequestCommentTool(backlog, helper), updatePullRequestCommentTool(backlog, helper), ],
  • Import of the getPullRequestCommentsTool function.
    import { getPullRequestCommentsTool } from './getPullRequestComments.js';
  • Tool schema instantiation and output schema assignment in the tool definition.
    schema: z.object(getPullRequestCommentsSchema(t)), outputSchema: PullRequestCommentSchema,

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