Skip to main content
Glama
nulab

Backlog MCP Server

get_pull_request

Retrieve detailed information about a specific pull request in Backlog projects to review changes, status, and contributors.

Instructions

Returns information about a specific 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

Implementation Reference

  • The main handler function for the 'get_pull_request' tool. It resolves the project ID or key and repository ID or name using helper functions, then calls the Backlog client's getPullRequest method.
    handler: async ({ projectId, projectKey, repoId, repoName, number }) => {
      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.getPullRequest(
        result.value,
        String(repoRes.value),
        number
      );
    },
  • Zod schema definition for the input parameters of the 'get_pull_request' tool, including optional projectId/projectKey, repoId/repoName, and required number.
    const getPullRequestSchema = buildToolSchema((t) => ({
      projectId: z
        .number()
        .optional()
        .describe(
          t(
            'TOOL_GET_PULL_REQUEST_PROJECT_ID',
            'The numeric ID of the project (e.g., 12345)'
          )
        ),
      projectKey: z
        .string()
        .optional()
        .describe(
          t(
            'TOOL_GET_PULL_REQUEST_PROJECT_KEY',
            "The key of the project (e.g., 'PROJECT')"
          )
        ),
      repoId: z
        .number()
        .optional()
        .describe(t('TOOL_GET_PULL_REQUEST_REPO_ID', 'Repository ID')),
      repoName: z
        .string()
        .optional()
        .describe(t('TOOL_GET_PULL_REQUEST_REPO_NAME', 'Repository name')),
      number: z
        .number()
        .describe(t('TOOL_GET_PULL_REQUEST_NUMBER', 'Pull request number')),
    }));
  • Registration of the getPullRequestTool within the 'git' toolset group in the allTools function.
    getPullRequestTool(backlog, helper),
  • Output schema reference for the tool response, using PullRequestSchema imported from backlog output definitions.
    outputSchema: PullRequestSchema,
  • Import of the getPullRequestTool function.
    import { getPullRequestTool } from './getPullRequest.js';
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. While 'Returns information' implies a read-only operation, it doesn't specify what information is returned, whether authentication is required, if there are rate limits, or how errors are handled. For a tool with 5 parameters and no annotation coverage, 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 perfectly concise - a single sentence that directly states the tool's purpose with zero wasted words. It's front-loaded with the essential information and doesn't contain any unnecessary elaboration or repetition.

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 tool with 5 parameters, no annotations, and no output schema, the description is inadequate. It doesn't explain what information is returned, how to identify a pull request (beyond the schema's 'number' parameter), or provide any context about the data format. The description should do more to compensate for the lack of structured metadata.

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?

The description adds no parameter information beyond what's already in the schema (which has 100% coverage). It doesn't explain parameter relationships (like projectId vs projectKey alternatives) or provide usage examples. With complete schema documentation, the baseline score of 3 is appropriate since the schema does the heavy lifting.

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 tool's purpose with a specific verb ('Returns') and resource ('information about a specific pull request'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from sibling tools like 'get_pull_requests' (plural) which likely returns multiple pull requests, leaving some ambiguity about when to use each.

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. With sibling tools like 'get_pull_requests' (for multiple PRs) and 'get_pull_request_comments' (for PR comments), there's no indication of when this specific single-PR retrieval tool is preferred over those other options.

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