Skip to main content
Glama
nulab

Backlog MCP Server

update_pull_request_comment

Update an existing comment on a Backlog pull request by specifying the comment ID and new content.

Instructions

Updates a comment on 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
commentIdYesComment ID
contentYesComment content
organizationNoOptional organization name. Use list_organizations to inspect available organizations.

Implementation Reference

  • The handler function that executes the 'update_pull_request_comment' tool logic. It resolves project ID/key and repo ID/name, then calls backlog.patchPullRequestComments() to update a pull request comment.
    handler: async ({
      projectId,
      projectKey,
      repoId,
      repoName,
      number,
      commentId,
      content,
    }) => {
      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.patchPullRequestComments(
        result.value,
        String(repoResult.value),
        number,
        commentId,
        { content }
      );
    },
  • Input schema definition for update_pull_request_comment using Zod. Defines fields: projectId, projectKey, repoId, repoName, number, commentId, content.
    const updatePullRequestCommentSchema = buildToolSchema((t) => ({
      projectId: z
        .number()
        .optional()
        .describe(
          t(
            'TOOL_UPDATE_PULL_REQUEST_COMMENT_PROJECT_ID',
            'The numeric ID of the project (e.g., 12345)'
          )
        ),
      projectKey: z
        .string()
        .optional()
        .describe(
          t(
            'TOOL_UPDATE_PULL_REQUEST_COMMENT_PROJECT_KEY',
            "The key of the project (e.g., 'PROJECT')"
          )
        ),
      repoId: z
        .number()
        .optional()
        .describe(t('TOOL_UPDATE_PULL_REQUEST_COMMENT_REPO_ID', 'Repository ID')),
      repoName: z
        .string()
        .optional()
        .describe(
          t('TOOL_UPDATE_PULL_REQUEST_COMMENT_REPO_NAME', 'Repository name')
        ),
      number: z
        .number()
        .describe(
          t('TOOL_UPDATE_PULL_REQUEST_COMMENT_NUMBER', 'Pull request number')
        ),
      commentId: z
        .number()
        .describe(t('TOOL_UPDATE_PULL_REQUEST_COMMENT_COMMENT_ID', 'Comment ID')),
      content: z
        .string()
        .describe(t('TOOL_UPDATE_PULL_REQUEST_COMMENT_CONTENT', 'Comment content')),
    }));
  • PullRequestCommentSchema - the output schema used as the return type for the update_pull_request_comment tool.
    export const PullRequestCommentSchema = z.object({
      id: z.number(),
      content: z.string(),
      changeLog: z.array(PullRequestChangeLogSchema),
      createdUser: UserSchema,
      created: z.string(),
      updated: z.string(),
      stars: z.array(StarSchema),
      notifications: z.array(CommentNotificationSchema),
    });
  • Registration of updatePullRequestCommentTool in the 'git' toolset group within the tools.ts registry.
    updatePullRequestCommentTool(backlog, helper),
  • Helper utilities resolveIdOrKey and resolveIdOrName used by the handler to resolve project/repository identifiers.
    import { TranslationHelper } from '../createTranslationHelper.js';
    
    export type EntityName = 'issue' | 'project' | 'repository';
    
    type ResolveResult =
      | { ok: true; value: string | number }
      | { ok: false; error: Error };
    
    type ResolveIdOrFieldInput<F extends string> = {
      id?: number;
    } & {
      [K in F]?: string;
    };
    
    /**
     * Generic resolver for entity identification by ID or named field (e.g., key, name, slug).
     * @param entity - The entity name, e.g., "project"
     * @param fieldName - The name of the alternative to `id`, e.g., "key", "name", "slug"
     * @param values - An object with `id?: number` and `[fieldName]?: string`
     * @param t - Translator
     */
    function resolveIdOrField<E extends EntityName, F extends string>(
      entity: E,
      fieldName: F,
      values: ResolveIdOrFieldInput<F>,
      t: TranslationHelper['t']
    ): ResolveResult {
      const value = tryResolveIdOrField(fieldName, values);
      if (value === undefined) {
        return {
          ok: false,
          error: new Error(
            t(
              `${entity.toUpperCase()}_ID_OR_${fieldName.toUpperCase()}_REQUIRED`,
              `${capitalize(entity)} ID or ${fieldName} is required`
            )
          ),
        };
      }
    
      return { ok: true, value };
    }
    
    function tryResolveIdOrField<F extends string>(
      fieldName: F,
      values: ResolveIdOrFieldInput<F>
    ): string | number | undefined {
      return values.id !== undefined ? values.id : values[fieldName];
    }
    
    export const resolveIdOrKey = <E extends EntityName>(
      entity: E,
      values: { id?: number; key?: string },
      t: TranslationHelper['t']
    ): ResolveResult => resolveIdOrField(entity, 'key', values, t);
    
    export const resolveIdOrName = <E extends EntityName>(
      entity: E,
      values: { id?: number; name?: string },
      t: TranslationHelper['t']
    ): ResolveResult => resolveIdOrField(entity, 'name', values, t);
    
    function capitalize(str: string): string {
      return str.charAt(0).toUpperCase() + str.slice(1);
    }
Behavior1/5

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

With no annotations, the description should disclose behavioral traits such as mutation behavior, permissions required, or side effects. It only states 'Updates a comment', which adds no transparency beyond what the tool name implies.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is very short (one sentence), which is concise, but it is too minimal to be fully helpful. It could be longer to add necessary context without becoming verbose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 8 parameters, no output schema, and no annotations, the description is severely incomplete. It does not explain what happens when a comment is updated (e.g., overwriting vs appending), return values, or error conditions.

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 coverage is 100%, so the baseline is 3. The description does not add any meaning beyond what the parameters' names and schema descriptions already provide. No additional context for complex parameters.

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 verb 'Updates' and the resource 'comment on a pull request', making the tool's purpose straightforward. However, it does not differentiate from sibling tools like 'add_pull_request_comment', which could cause confusion.

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 is provided on when to use this tool versus alternatives like add_pull_request_comment or update_issue. There are no notes on prerequisites, context, or exclusions.

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