Skip to main content
Glama
nulab

Backlog MCP Server

update_pull_request

Modify an existing pull request in Backlog by updating its summary, description, assignee, status, or linked issue to reflect changes and progress.

Instructions

Updates an existing 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
summaryNoSummary of the pull request
descriptionNoUpdates an existing pull request
issueIdNoIssue ID to link
assigneeIdNoUser ID of the assignee
notifiedUserIdNoUser IDs to notify
statusIdNoStatus ID

Implementation Reference

  • The core handler implementation for the 'update_pull_request' tool. It sets the tool name, description, input/output schemas, and the async handler that resolves project and repository identifiers and invokes the Backlog API to patch the pull request.
    export const updatePullRequestTool = (
      backlog: Backlog,
      { t }: TranslationHelper
    ): ToolDefinition<
      ReturnType<typeof updatePullRequestSchema>,
      (typeof PullRequestSchema)['shape']
    > => {
      return {
        name: 'update_pull_request',
        description: t(
          'TOOL_UPDATE_PULL_REQUEST_DESCRIPTION',
          'Updates an existing pull request'
        ),
        schema: z.object(updatePullRequestSchema(t)),
        outputSchema: PullRequestSchema,
        handler: async ({
          projectId,
          projectKey,
          repoId,
          repoName,
          number,
          ...params
        }) => {
          const result = resolveIdOrKey(
            'project',
            { id: projectId, key: projectKey },
            t
          );
          if (!result.ok) {
            throw result.error;
          }
          const resultRepo = resolveIdOrKey(
            'repository',
            { id: repoId, key: repoName },
            t
          );
          if (!resultRepo.ok) {
            throw resultRepo.error;
          }
          return backlog.patchPullRequest(
            result.value,
            String(resultRepo.value),
            number,
            params
          );
        },
      };
    };
  • Input schema for the update_pull_request tool, defining optional project/repo IDs/keys, required PR number, and optional fields like summary, description, issue link, assignee, notified users, and status.
    const updatePullRequestSchema = buildToolSchema((t) => ({
      projectId: z
        .number()
        .optional()
        .describe(
          t(
            'TOOL_UPDATE_PULL_REQUEST_PROJECT_ID',
            'The numeric ID of the project (e.g., 12345)'
          )
        ),
      projectKey: z
        .string()
        .optional()
        .describe(
          t(
            'TOOL_UPDATE_PULL_REQUEST_PROJECT_KEY',
            "The key of the project (e.g., 'PROJECT')"
          )
        ),
      repoId: z
        .number()
        .optional()
        .describe(t('TOOL_UPDATE_PULL_REQUEST_REPO_ID', 'Repository ID')),
      repoName: z
        .string()
        .optional()
        .describe(t('TOOL_UPDATE_PULL_REQUEST_REPO_NAME', 'Repository name')),
      number: z
        .number()
        .describe(t('TOOL_UPDATE_PULL_REQUEST_NUMBER', 'Pull request number')),
      summary: z
        .string()
        .optional()
        .describe(
          t('TOOL_UPDATE_PULL_REQUEST_SUMMARY', 'Summary of the pull request')
        ),
      description: z
        .string()
        .optional()
        .describe(
          t(
            'TOOL_UPDATE_PULL_REQUEST_DESCRIPTION',
            'Description of the pull request'
          )
        ),
      issueId: z
        .number()
        .optional()
        .describe(t('TOOL_UPDATE_PULL_REQUEST_ISSUE_ID', 'Issue ID to link')),
      assigneeId: z
        .number()
        .optional()
        .describe(
          t('TOOL_UPDATE_PULL_REQUEST_ASSIGNEE_ID', 'User ID of the assignee')
        ),
      notifiedUserId: z
        .array(z.number())
        .optional()
        .describe(
          t('TOOL_UPDATE_PULL_REQUEST_NOTIFIED_USER_ID', 'User IDs to notify')
        ),
      statusId: z
        .number()
        .optional()
        .describe(t('TOOL_UPDATE_PULL_REQUEST_STATUS_ID', 'Status ID')),
    }));
  • Registration of the updatePullRequestTool within the 'git' toolset group in the allTools export.
    updatePullRequestTool(backlog, helper),
  • Import of the updatePullRequestTool for registration.
    import { updatePullRequestTool } from './updatePullRequest.js';
  • Usage of the resolveIdOrKey helper to resolve project and repository IDs or keys before calling the API.
          const result = resolveIdOrKey(
            'project',
            { id: projectId, key: projectKey },
            t
          );
          if (!result.ok) {
            throw result.error;
          }
          const resultRepo = resolveIdOrKey(
            'repository',
            { id: repoId, key: repoName },
            t
          );
          if (!resultRepo.ok) {
            throw resultRepo.error;
          }
          return backlog.patchPullRequest(
            result.value,
            String(resultRepo.value),
            number,
            params
          );
        },
      };
    };
Behavior1/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. 'Updates an existing pull request' implies a mutation operation but reveals nothing about permissions required, whether changes are reversible, side effects (e.g., notifications sent), rate limits, error conditions, or response format. This is a significant gap for a mutation tool with 11 parameters and no output schema.

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 basic statement of purpose, though the brevity contributes to its inadequacy in other dimensions. Every word earns its place by conveying the core action, even if minimally.

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?

Given the tool's complexity (11 parameters, mutation operation, no annotations, no output schema), the description is severely incomplete. It doesn't explain what the tool returns, error handling, required permissions, or relationships to sibling tools. For a mutation tool with significant parameter complexity, this minimal description fails to provide adequate context for safe and effective use.

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%, with all 11 parameters documented in the input schema (e.g., 'projectId', 'summary', 'statusId'). The description adds no parameter-specific information beyond what's already in the schema. According to scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Updates an existing pull request' is a tautology that merely restates the tool name 'update_pull_request'. It specifies the verb 'updates' and resource 'pull request' but provides no additional detail about what aspects can be updated or the scope of the operation. While it distinguishes from sibling tools like 'add_pull_request' by indicating modification rather than creation, it lacks specificity about the update capabilities.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an existing pull request), differentiate from similar tools like 'update_issue' or 'update_pull_request_comment', or specify contexts where this tool is appropriate. The agent must infer usage from the name alone, which is insufficient for informed tool selection.

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