Skip to main content
Glama

add_pull_request_comment

Adds a comment to a pull request in Backlog, specifying project, repository, pull request number, and content. Notifies specified users to streamline collaboration and feedback.

Instructions

Adds a comment to a pull request

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYesComment content
notifiedUserIdNoUser IDs to notify
numberYesPull request number
projectIdOrKeyYesProject ID or project key
repoIdOrNameYesRepository ID or name

Implementation Reference

  • Handler function that destructures input parameters, resolves project ID or key and repository ID or name using utility functions, and calls the Backlog API's postPullRequestComments method to add the comment.
    importantFields: ['id', 'content', 'createdUser'], handler: async ({ projectId, projectKey, repoId, repoName, number, ...params }) => { const result = resolveIdOrKey( 'project', { id: projectId, key: projectKey }, t ); if (!result.ok) { throw result.error; } const repoRes = resolveIdOrName( 'repository', { id: repoId, name: repoName }, t ); if (!repoRes.ok) { throw repoRes.error; } return backlog.postPullRequestComments( result.value, String(repoRes.value), number, params ); },
  • Zod schema defining the input parameters for the tool, including optional project ID/key, repo ID/name, required PR number and content, and optional notified user IDs.
    const addPullRequestCommentSchema = buildToolSchema((t) => ({ projectId: z .number() .optional() .describe( t( 'TOOL_ADD_PULL_REQUEST_COMMENT_PROJECT_ID', 'The numeric ID of the project (e.g., 12345)' ) ), projectKey: z .string() .optional() .describe( t( 'TOOL_ADD_PULL_REQUEST_COMMENT_PROJECT_KEY', "The key of the project (e.g., 'PROJECT')" ) ), repoId: z .number() .optional() .describe(t('TOOL_ADD_PULL_REQUEST_REPO_ID', 'Repository ID')), repoName: z .string() .optional() .describe(t('TOOL_ADD_PULL_REQUEST_REPO_NAME', 'Repository name')), number: z .number() .describe(t('TOOL_ADD_PULL_REQUEST_COMMENT_NUMBER', 'Pull request number')), content: z .string() .describe(t('TOOL_ADD_PULL_REQUEST_COMMENT_CONTENT', 'Comment content')), notifiedUserId: z .array(z.number()) .optional() .describe( t('TOOL_ADD_PULL_REQUEST_COMMENT_NOTIFIED_USER_ID', 'User IDs to notify') ), }));
  • The addPullRequestCommentTool is instantiated with backlog and translation helper, and registered within the 'git' toolset group in the allTools export.
    { name: 'git', description: 'Tools for managing Git repositories and pull requests.', enabled: false, 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), ], },

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