Skip to main content
Glama

get-builds

Retrieve Azure DevOps build definitions and recent builds to monitor pipeline status and track deployment progress across multiple organizations.

Instructions

Get build definitions and recent builds

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
definitionIdsNoSpecific build definition IDs
topNoNumber of builds to return

Implementation Reference

  • Main handler function for 'get-builds' tool. Queries Azure DevOps /build/builds API endpoint with optional definitionIds and top parameters, formats the response with relevant build details.
    private async getBuilds(args: any): Promise<any> {
      try {
        let endpoint = '/build/builds?api-version=7.1';
        
        const params = [];
        if (args.definitionIds && args.definitionIds.length > 0) {
          params.push(`definitions=${args.definitionIds.join(',')}`);
        }
        if (args.top) {
          params.push(`$top=${args.top}`);
        } else {
          params.push('$top=10'); // Default to 10 builds
        }
        
        if (params.length > 0) {
          endpoint += '&' + params.join('&');
        }
    
        const result = await this.makeApiRequest(endpoint);
    
        const builds = result.value.map((build: any) => ({
          id: build.id,
          buildNumber: build.buildNumber,
          status: build.status,
          result: build.result,
          definition: {
            id: build.definition.id,
            name: build.definition.name
          },
          startTime: build.startTime,
          finishTime: build.finishTime,
          url: build._links.web.href
        }));
    
        return {
          content: [{
            type: 'text',
            text: JSON.stringify({
              count: builds.length,
              builds
            }, null, 2),
          }],
        };
      } catch (error) {
        throw new Error(`Failed to get builds: ${error instanceof Error ? error.message : 'Unknown error'}`);
      }
    }
  • src/index.ts:242-259 (registration)
    Registers the 'get-builds' tool with the MCP server in the listTools handler, including input schema for parameters definitionIds and top.
    {
      name: 'get-builds',
      description: 'Get build definitions and recent builds',
      inputSchema: {
        type: 'object',
        properties: {
          definitionIds: {
            type: 'array',
            items: { type: 'number' },
            description: 'Specific build definition IDs',
          },
          top: {
            type: 'number',
            description: 'Number of builds to return',
          },
        },
      },
    },
  • Dispatch case in handleToolCall method that routes 'get-builds' tool calls to the getBuilds implementation.
    case 'get-builds':
      return await this.getBuilds(args || {});
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 what the tool does but doesn't cover key traits like whether it's read-only, requires authentication, has rate limits, returns paginated results, or what 'recent builds' means in terms of time range or sorting. This leaves significant gaps for an agent to understand operational behavior.

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, front-loading the core purpose. It's appropriately sized for a simple retrieval tool, making it easy to parse quickly.

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 lack of annotations and output schema, the description is incomplete for a tool with 2 parameters and no behavioral context. It doesn't explain return values, error handling, or prerequisites, leaving the agent with insufficient information to use the tool effectively in complex scenarios.

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 both parameters ('definitionIds' and 'top'). The description adds no additional meaning beyond the schema, such as explaining default behaviors or interactions between parameters. Since the schema does the heavy lifting, the baseline score of 3 is appropriate, but the description doesn't enhance parameter understanding.

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 ('Get') and resources ('build definitions and recent builds'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'get-pipeline-status' or 'get-work-items', which also retrieve information but for different resources, so it lacks explicit sibling distinction.

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 siblings like 'get-pipeline-status' or 'get-work-items' that might overlap in context (e.g., CI/CD workflows), there's no indication of when this tool is preferred or what scenarios it's designed for, leaving usage ambiguous.

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/wangkanai/devops-enhanced-mcp'

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