Skip to main content
Glama

get_pull_requests

Retrieve pull requests from a Backlog repository with filtering options for status, assignee, issue, and creator to manage code review workflows.

Instructions

Returns list of pull requests for a repository

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
statusIdNoStatus IDs
assigneeIdNoAssignee user IDs
issueIdNoIssue IDs
createdUserIdNoCreated user IDs
offsetNoOffset for pagination
countNoNumber of pull requests to retrieve

Implementation Reference

  • The handler function for the 'get_pull_requests' tool. It resolves project and repository IDs/names, then calls backlog.getPullRequests with the parameters.
    handler: async ({ projectId, projectKey, repoId, repoName, ...params }) => { 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.getPullRequests( result.value, String(repoResult.value), params ); },
  • Input schema definition for the 'get_pull_requests' tool using Zod.
    const getPullRequestsSchema = buildToolSchema((t) => ({ projectId: z .number() .optional() .describe( t( 'TOOL_GET_PULL_REQUESTS_PROJECT_ID', 'The numeric ID of the project (e.g., 12345)' ) ), projectKey: z .string() .optional() .describe( t( 'TOOL_GET_PULL_REQUESTS_PROJECT_KEY', "The key of the project (e.g., 'PROJECT')" ) ), repoId: z .number() .optional() .describe(t('TOOL_GET_PULL_REQUESTS_REPO_ID', 'Repository ID')), repoName: z .string() .optional() .describe(t('TOOL_GET_PULL_REQUESTS_REPO_NAME', 'Repository name')), statusId: z .array(z.number()) .optional() .describe(t('TOOL_GET_PULL_REQUESTS_STATUS_ID', 'Status IDs')), assigneeId: z .array(z.number()) .optional() .describe(t('TOOL_GET_PULL_REQUESTS_ASSIGNEE_ID', 'Assignee user IDs')), issueId: z .array(z.number()) .optional() .describe(t('TOOL_GET_PULL_REQUESTS_ISSUE_ID', 'Issue IDs')), createdUserId: z .array(z.number()) .optional() .describe(t('TOOL_GET_PULL_REQUESTS_CREATED_USER_ID', 'Created user IDs')), offset: z .number() .optional() .describe(t('TOOL_GET_PULL_REQUESTS_OFFSET', 'Offset for pagination')), count: z .number() .optional() .describe( t('TOOL_GET_PULL_REQUESTS_COUNT', 'Number of pull requests to retrieve') ), }));
  • Registration of the 'get_pull_requests' tool in the 'git' toolset within the allTools function.
    getPullRequestsTool(backlog, helper),

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