Skip to main content
Glama
nulab

Backlog MCP Server

add_pull_request

Create a new pull request in Backlog by specifying summary, description, base branch, and merge branch to propose code changes for review.

Instructions

Creates a new 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
summaryYesSummary of the pull request
descriptionYesCreates a new pull request
baseYesBase branch name
branchYesBranch name to merge
issueIdNoIssue ID to link
assigneeIdNoUser ID of the assignee
notifiedUserIdNoUser IDs to notify

Implementation Reference

  • The handler function that executes the tool logic: resolves project and repository using helpers, then calls backlog.postPullRequest to create the pull request.
    handler: async ({ projectId, projectKey, repoId, repoName, ...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.postPullRequest(
        result.value,
        String(repoRes.value),
        params
      );
    },
  • Input schema definition for the add_pull_request tool using Zod and buildToolSchema with translation helpers.
    const addPullRequestSchema = buildToolSchema((t) => ({
      projectId: z
        .number()
        .optional()
        .describe(
          t(
            'TOOL_ADD_PULL_REQUEST_PROJECT_ID',
            'The numeric ID of the project (e.g., 12345)'
          )
        ),
      projectKey: z
        .string()
        .optional()
        .describe(
          t(
            'TOOL_ADD_PULL_REQUEST_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')),
      summary: z
        .string()
        .describe(
          t('TOOL_ADD_PULL_REQUEST_SUMMARY', 'Summary of the pull request')
        ),
      description: z
        .string()
        .describe(
          t('TOOL_ADD_PULL_REQUEST_DESCRIPTION', 'Description of the pull request')
        ),
      base: z
        .string()
        .describe(t('TOOL_ADD_PULL_REQUEST_BASE', 'Base branch name')),
      branch: z
        .string()
        .describe(t('TOOL_ADD_PULL_REQUEST_BRANCH', 'Branch name to merge')),
      issueId: z
        .number()
        .optional()
        .describe(t('TOOL_ADD_PULL_REQUEST_ISSUE_ID', 'Issue ID to link')),
      assigneeId: z
        .number()
        .optional()
        .describe(
          t('TOOL_ADD_PULL_REQUEST_ASSIGNEE_ID', 'User ID of the assignee')
        ),
      notifiedUserId: z
        .array(z.number())
        .optional()
        .describe(
          t('TOOL_ADD_PULL_REQUEST_NOTIFIED_USER_ID', 'User IDs to notify')
        ),
    }));
  • The addPullRequestTool is instantiated and registered in the 'git' toolset group within the allTools function.
    addPullRequestTool(backlog, helper),
  • src/tools/tools.ts:7-7 (registration)
    Import of the addPullRequestTool for registration.
    import { addPullRequestTool } from './addPullRequest.js';
  • The tool's input schema (z.object(addPullRequestSchema(t))) and output schema (PullRequestSchema) as part of the ToolDefinition.
    schema: z.object(addPullRequestSchema(t)),
    outputSchema: PullRequestSchema,
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Creates a new pull request' implies a write operation, but it doesn't disclose permissions required, side effects (e.g., notifications sent), rate limits, or what happens on success/failure. This is a significant gap for a mutation tool with zero annotation coverage.

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 waste. It's appropriately sized and front-loaded, clearly stating the core action without unnecessary elaboration.

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 complexity (11 parameters, 4 required) and lack of annotations or output schema, the description is incomplete. It doesn't explain return values, error conditions, or behavioral nuances needed for effective use. For a creation tool with many parameters, this minimal description leaves critical gaps.

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 schema (e.g., 'projectId', 'summary', 'base'). The description adds no parameter-specific information beyond what the schema provides, so it meets the baseline of 3 where the 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 'Creates a new pull request' states the verb ('creates') and resource ('pull request'), which is clear but minimal. It distinguishes from siblings like 'add_issue' or 'add_project' by specifying the resource type, but lacks specificity about scope or context beyond the basic action.

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. For example, it doesn't mention prerequisites (e.g., needing a repository or project), or how it differs from sibling tools like 'update_pull_request' or 'add_pull_request_comment'. The description offers no context for usage decisions.

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