Skip to main content
Glama
nulab

Backlog MCP Server

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),
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the basic action. It doesn't disclose whether this is a mutation (likely yes, but not confirmed), what permissions are required, whether notifications are sent, what happens on failure, or what the return value looks like. For a tool that presumably creates data with user notifications, this is insufficient behavioral context.

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, efficient sentence with zero wasted words. It's appropriately sized for a simple tool and front-loads the core action. Every word earns its place in this minimal description.

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 mutation tool with 7 parameters and no annotations or output schema, the description is inadequate. It doesn't explain what happens after commenting, whether there are rate limits, what permissions are needed, or what the tool returns. The combination of no annotations, no output schema, and minimal description leaves significant gaps in understanding tool behavior.

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?

Schema description coverage is 100%, so the schema already documents all 7 parameters thoroughly. The description adds no additional parameter information beyond what's in the schema. It doesn't explain relationships between parameters (e.g., projectId vs projectKey alternatives) or provide usage examples. Baseline 3 is appropriate when schema does the heavy lifting.

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 'Adds a comment to a pull request' clearly states the action (adds) and resource (pull request comment), but it's vague about scope and doesn't differentiate from sibling tools like 'add_issue_comment' or 'update_pull_request_comment'. It doesn't specify whether this creates a new comment thread or adds to an existing one.

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?

No guidance on when to use this tool versus alternatives like 'update_pull_request_comment' or 'add_issue_comment'. The description provides no context about prerequisites, permissions needed, or typical use cases for pull request commenting versus other comment tools in the system.

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