Skip to main content
Glama

add_pull_request_comment

Add comments to pull requests in Backlog projects to provide feedback, ask questions, or share updates with team members.

Instructions

Adds a comment to 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 name
numberYesPull request number
contentYesComment content
notifiedUserIdNoUser IDs to notify

Implementation Reference

  • The main handler function for the 'add_pull_request_comment' tool. It resolves project ID or key, repository ID or name, and then calls the Backlog API's postPullRequestComments method to add the comment.
    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 ); },
  • Input schema definition using Zod for the 'add_pull_request_comment' tool parameters, including project, repo, PR number, content, and optional notified users.
    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') ), }));
  • Registration of the addPullRequestCommentTool in the 'git' toolset group within the allTools function.
    addPullRequestCommentTool(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