Skip to main content
Glama

get-pipeline-status

Check Azure DevOps pipeline or build status using build ID or definition ID, with optional timeline details for monitoring deployment progress.

Instructions

Get status of a specific build or pipeline

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
buildIdNoSpecific build ID to check status
definitionIdNoGet latest builds for this definition ID
includeTimelineNoInclude detailed timeline information

Implementation Reference

  • Main handler function implementing the get-pipeline-status tool. Fetches build details by buildId (with optional timeline) or recent builds by definitionId using Azure DevOps REST API.
    private async getPipelineStatus(args: any): Promise<any> {
      try {
        if (args.buildId) {
          // Get specific build details
          const build = await this.makeApiRequest(`/build/builds/${args.buildId}?api-version=7.1`);
          
          let timeline = null;
          if (args.includeTimeline) {
            try {
              timeline = await this.makeApiRequest(`/build/builds/${args.buildId}/timeline?api-version=7.1`);
            } catch (timelineError) {
              // Sanitize error message to prevent log injection
              const sanitizedError = timelineError instanceof Error ? timelineError.message.replace(/[\r\n\t]/g, '_') : 'Unknown timeline error';
              console.error('Failed to get timeline:', sanitizedError);
              // Continue without timeline if it fails
            }
          }
    
          const buildInfo = {
            id: build.id,
            buildNumber: build.buildNumber,
            status: build.status,
            result: build.result,
            definition: {
              id: build.definition.id,
              name: build.definition.name
            },
            sourceBranch: build.sourceBranch,
            sourceVersion: build.sourceVersion,
            queueTime: build.queueTime,
            startTime: build.startTime,
            finishTime: build.finishTime,
            url: build._links?.web?.href,
            requestedBy: {
              displayName: build.requestedBy?.displayName,
              uniqueName: build.requestedBy?.uniqueName
            },
            ...(timeline && { 
              timeline: timeline.records?.map((record: any) => ({
                name: record.name,
                type: record.type,
                state: record.state,
                result: record.result,
                startTime: record.startTime,
                finishTime: record.finishTime,
                percentComplete: record.percentComplete
              }))
            })
          };
    
          return {
            content: [{
              type: 'text',
              text: JSON.stringify(buildInfo, null, 2),
            }],
          };
        } else if (args.definitionId) {
          // Get latest builds for a specific definition
          const builds = await this.makeApiRequest(
            `/build/builds?definitions=${args.definitionId}&$top=5&api-version=7.1`
          );
    
          const buildsInfo = builds.value.map((build: any) => ({
            id: build.id,
            buildNumber: build.buildNumber,
            status: build.status,
            result: build.result,
            sourceBranch: build.sourceBranch,
            queueTime: build.queueTime,
            startTime: build.startTime,
            finishTime: build.finishTime,
            url: build._links?.web?.href
          }));
    
          return {
            content: [{
              type: 'text',
              text: JSON.stringify({
                definitionId: args.definitionId,
                recentBuilds: buildsInfo
              }, null, 2),
            }],
          };
        } else {
          throw new Error('Either buildId or definitionId must be provided');
        }
      } catch (error) {
        throw new Error(`Failed to get pipeline status: ${error instanceof Error ? error.message : 'Unknown error'}`);
      }
    }
  • src/index.ts:311-331 (registration)
    Tool registration in MCP server, defining name, description, and input schema for get-pipeline-status.
    {
      name: 'get-pipeline-status',
      description: 'Get status of a specific build or pipeline',
      inputSchema: {
        type: 'object',
        properties: {
          buildId: {
            type: 'number',
            description: 'Specific build ID to check status',
          },
          definitionId: {
            type: 'number',
            description: 'Get latest builds for this definition ID',
          },
          includeTimeline: {
            type: 'boolean',
            description: 'Include detailed timeline information',
          },
        },
      },
    },
  • Switch case dispatcher that routes 'get-pipeline-status' tool calls to the getPipelineStatus handler method.
    case 'get-pipeline-status':
      return await this.getPipelineStatus(args || {});
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure but only states the basic action. It doesn't cover whether this is a read-only operation, what permissions are needed, how errors are handled, rate limits, or the format of the returned status. This leaves significant gaps for a tool that likely interacts with a CI/CD system.

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, clear sentence with zero wasted words, making it easy to parse and front-loaded with the core purpose. It efficiently communicates the essential function without unnecessary elaboration.

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 pipeline/status tools, no annotations, and no output schema, the description is insufficient. It lacks details on what the status includes (e.g., success/failure, stages), how to interpret results, or error conditions. This makes it incomplete for effective agent use in a real-world CI/CD context.

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 description coverage is 100%, so the input schema fully documents the three parameters (buildId, definitionId, includeTimeline). The description adds no additional parameter semantics beyond what's in the schema, such as explaining relationships between parameters or usage examples, which aligns with the baseline score for high schema coverage.

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 tool's purpose with a specific verb ('Get') and resource ('status of a specific build or pipeline'), making it immediately understandable. However, it doesn't differentiate from sibling tools like 'get-builds' or 'trigger-pipeline' regarding when to use each, which prevents a perfect score.

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-builds' (which might list multiple builds) or 'trigger-pipeline' (which initiates builds). There's no mention of prerequisites, context, or exclusions, leaving the agent to infer usage from the tool name alone.

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