Skip to main content
Glama
stefanskiasan

Azure DevOps MCP Server for Cline

list_pull_requests

Retrieve and filter pull requests in Azure DevOps projects by status, creator, or repository to monitor code review progress.

Instructions

List all pull requests in the project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
statusNoFilter by PR status (active, completed, abandoned)
creatorIdNoFilter by creator ID (optional)
repositoryIdNoFilter by repository ID (optional)

Implementation Reference

  • The core handler function that executes the list_pull_requests tool by querying the Azure DevOps Git API with optional status, creatorId, and repositoryId filters.
    export async function getPullRequests(args: GetPullRequestsArgs, config: AzureDevOpsConfig) {
      AzureDevOpsConnection.initialize(config);
      const connection = AzureDevOpsConnection.getInstance();
      const gitApi = await connection.getGitApi();
    
      try {
        let statusFilter: PullRequestStatus | undefined;
        if (args.status) {
          switch (args.status) {
            case 'active':
              statusFilter = 1; // PullRequestStatus.Active
              break;
            case 'completed':
              statusFilter = 3; // PullRequestStatus.Completed
              break;
            case 'abandoned':
              statusFilter = 2; // PullRequestStatus.Abandoned
              break;
          }
        }
    
        const searchCriteria = {
          status: statusFilter,
          creatorId: args.creatorId,
          repositoryId: args.repositoryId,
        };
    
        const pullRequests = await gitApi.getPullRequests(
          args.repositoryId || config.project,
          searchCriteria
        );
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(pullRequests, null, 2),
            },
          ],
        };
      } catch (error: unknown) {
        if (error instanceof McpError) throw error;
        const errorMessage = error instanceof Error ? error.message : 'Unknown error';
        throw new McpError(
          ErrorCode.InternalError,
          `Failed to get pull requests: ${errorMessage}`
        );
      }
    }
  • The input schema and metadata definition for the list_pull_requests tool.
    {
      name: 'list_pull_requests',
      description: 'List all pull requests in the project',
      inputSchema: {
        type: 'object',
        properties: {
          status: {
            type: 'string',
            description: 'Filter by PR status (active, completed, abandoned)',
            enum: ['active', 'completed', 'abandoned'],
          },
          creatorId: {
            type: 'string',
            description: 'Filter by creator ID (optional)',
          },
          repositoryId: {
            type: 'string',
            description: 'Filter by repository ID (optional)',
          },
        },
      },
    },
  • src/index.ts:170-173 (registration)
    Registration in the main MCP server switch statement that handles calls to list_pull_requests by invoking the getPullRequests handler.
    case 'list_pull_requests':
      result = await tools.pullRequest.getPullRequests(
        validateArgs(request.params.arguments, 'Pull request list arguments required')
      );
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. It states the tool lists pull requests but doesn't describe key behaviors such as pagination, rate limits, authentication requirements, or what 'list' entails (e.g., format, sorting, or default limits). The description is minimal and lacks essential operational details for a tool with potential complexity.

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 extremely concise with a single sentence: 'List all pull requests in the project'. It is front-loaded and wastes no words, making it easy to parse. Every part of the sentence contributes directly to the tool's purpose, earning its place without redundancy or fluff.

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 of listing pull requests (which often involves pagination, filtering, and authentication), no annotations, and no output schema, the description is incomplete. It lacks details on behavioral traits, return values, and operational constraints. The schema covers parameters well, but the overall context for effective tool use is insufficient, especially for a tool that likely interacts with a version control system.

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 input schema has 100% description coverage, clearly documenting all three parameters (status, creatorId, repositoryId) with enums and optionality. The description adds no parameter semantics beyond what the schema provides, as it doesn't mention any parameters. With high schema coverage, the baseline score of 3 is appropriate, as the schema adequately handles parameter documentation.

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 states the tool's purpose as 'List all pull requests in the project', which is clear but vague. It specifies the verb ('List') and resource ('pull requests'), but lacks specificity about scope or differentiation from sibling tools like list_projects or list_work_items. It doesn't clarify what 'all' entails (e.g., across repositories or within a specific context).

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. It doesn't mention prerequisites (e.g., needing a project context), exclusions, or comparisons to sibling tools like list_work_items (which might overlap in functionality). Usage is implied by the name and description alone, with no explicit context or alternatives provided.

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/stefanskiasan/azure-devops-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server