Skip to main content
Glama

get_pull_request

Retrieve detailed information for a specific pull request in a Backlog project using project ID, repository ID, and pull request number. Integrates with Backlog MCP Server for efficient project management.

Instructions

Returns information about a specific pull request

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
numberYesPull request number
projectIdOrKeyYesProject ID or project key
repoIdOrNameYesRepository ID or name

Implementation Reference

  • The core handler function that executes the tool logic: resolves project and repository identifiers, then calls the Backlog API to retrieve the specific pull request.
    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 ); },
  • Input schema definition for the get_pull_request tool using Zod and buildToolSchema, supporting project ID/key and repo ID/name.
    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's tools array in the allTools function, which provides all tool definitions.
    tools: [ getGitRepositoriesTool(backlog, helper), getGitRepositoryTool(backlog, helper), getPullRequestsTool(backlog, helper), getPullRequestsCountTool(backlog, helper), getPullRequestTool(backlog, helper), addPullRequestTool(backlog, helper), updatePullRequestTool(backlog, helper), getPullRequestCommentsTool(backlog, helper), addPullRequestCommentTool(backlog, helper), updatePullRequestCommentTool(backlog, helper), ],
  • Import of the getPullRequestTool from its implementation file.
    import { getPullRequestTool } from './getPullRequest.js';
  • Output schema reference for the tool response validation using PullRequestSchema.
    outputSchema: PullRequestSchema,

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