Skip to main content
Glama
nulab

Backlog MCP Server

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),
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure but only states what the tool returns. It doesn't mention pagination behavior (though parameters suggest it), authentication requirements, rate limits, error conditions, or what happens with missing parameters. For a 10-parameter tool with no annotations, this is insufficient.

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 no wasted words. It's appropriately sized for a list operation and front-loads the core functionality immediately.

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 10-parameter tool with no annotations and no output schema, the description is inadequate. It doesn't explain the return format, pagination behavior, error handling, or how multiple filtering parameters interact. The agent would struggle to use this tool effectively without trial and error.

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 schema has 100% description coverage, so parameters are well-documented in the schema itself. The description adds no additional parameter information beyond implying filtering capabilities through the phrase 'for a repository'. This meets the baseline expectation when schema coverage is complete.

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 action ('Returns list') and resource ('pull requests for a repository'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'get_pull_request' (singular) or 'get_pull_requests_count', which could cause confusion about when to use each specific tool.

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 like 'get_pull_request' (singular) or 'get_pull_requests_count'. There's no mention of prerequisites, filtering capabilities, or typical use cases, leaving the agent with minimal contextual direction.

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