Skip to main content
Glama
Tiberriver256

Azure DevOps MCP Server

get_pipeline

Retrieve details of a specific Azure DevOps pipeline by providing its ID, including project context and optional version specification.

Instructions

Get details of a specific pipeline

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdNoThe ID or name of the project (Default: MyProject)
pipelineIdYesThe numeric ID of the pipeline to retrieve
pipelineVersionNoThe version of the pipeline to retrieve (latest if not specified)

Implementation Reference

  • The main handler function 'getPipeline' that executes the tool logic, fetching pipeline details from Azure DevOps API.
    export async function getPipeline(
      connection: WebApi,
      options: GetPipelineOptions,
    ): Promise<Pipeline> {
      try {
        const pipelinesApi = await connection.getPipelinesApi();
        const { projectId, pipelineId, pipelineVersion } = options;
    
        // Call the pipelines API to get the pipeline
        const pipeline = await pipelinesApi.getPipeline(
          projectId,
          pipelineId,
          pipelineVersion,
        );
    
        // If pipeline not found, API returns null instead of throwing error
        if (pipeline === null) {
          throw new AzureDevOpsResourceNotFoundError(
            `Pipeline not found with ID: ${pipelineId}`,
          );
        }
    
        return pipeline;
      } catch (error) {
        // Handle specific error types
        if (error instanceof AzureDevOpsError) {
          throw error;
        }
    
        // Check for specific error types and convert to appropriate Azure DevOps errors
        if (error instanceof Error) {
          if (
            error.message.includes('Authentication') ||
            error.message.includes('Unauthorized') ||
            error.message.includes('401')
          ) {
            throw new AzureDevOpsAuthenticationError(
              `Failed to authenticate: ${error.message}`,
            );
          }
    
          if (
            error.message.includes('not found') ||
            error.message.includes('does not exist') ||
            error.message.includes('404')
          ) {
            throw new AzureDevOpsResourceNotFoundError(
              `Pipeline or project not found: ${error.message}`,
            );
          }
        }
    
        // Otherwise, wrap it in a generic error
        throw new AzureDevOpsError(
          `Failed to get pipeline: ${error instanceof Error ? error.message : String(error)}`,
        );
      }
    }
  • Zod schema defining the input parameters for the 'get_pipeline' tool: projectId, pipelineId, pipelineVersion.
    export const GetPipelineSchema = z.object({
      // The project containing the pipeline
      projectId: z
        .string()
        .optional()
        .describe(`The ID or name of the project (Default: ${defaultProject})`),
      // The ID of the pipeline to retrieve
      pipelineId: z
        .number()
        .int()
        .positive()
        .describe('The numeric ID of the pipeline to retrieve'),
      // The version of the pipeline to retrieve
      pipelineVersion: z
        .number()
        .int()
        .positive()
        .optional()
        .describe(
          'The version of the pipeline to retrieve (latest if not specified)',
        ),
    });
  • Registration of the 'get_pipeline' tool in the pipelinesTools array, including name, description, and input schema.
    {
      name: 'get_pipeline',
      description: 'Get details of a specific pipeline',
      inputSchema: zodToJsonSchema(GetPipelineSchema),
      mcp_enabled: true,
    },

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

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