Skip to main content
Glama
stefanskiasan

Azure DevOps MCP Server for Cline

list_pipelines

Retrieve all Azure DevOps pipelines in a project. Filter results by folder path or pipeline name to find specific CI/CD workflows.

Instructions

List all pipelines in the project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
folderNoFilter pipelines by folder path (optional)
nameNoFilter pipelines by name (optional)

Implementation Reference

  • The handler function that fetches and returns the list of pipelines from Azure DevOps using the Build API.
    export async function getPipelines(args: GetPipelinesArgs, config: AzureDevOpsConfig) {
      AzureDevOpsConnection.initialize(config);
      const connection = AzureDevOpsConnection.getInstance();
      const pipelineApi = await connection.getBuildApi();
    
      try {
        const pipelines = await pipelineApi.getDefinitions(
          config.project,
          args.name,
          args.folder
        );
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(pipelines, 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 pipelines: ${errorMessage}`
        );
      }
    }
  • Tool definition including name, description, and input schema for 'list_pipelines'.
    {
      name: 'list_pipelines',
      description: 'List all pipelines in the project',
      inputSchema: {
        type: 'object',
        properties: {
          folder: {
            type: 'string',
            description: 'Filter pipelines by folder path (optional)',
          },
          name: {
            type: 'string',
            description: 'Filter pipelines by name (optional)',
          },
        },
      },
    },
  • src/index.ts:158-162 (registration)
    Dispatches the 'list_pipelines' tool call to the appropriate handler function.
    case 'list_pipelines':
      result = await tools.pipeline.getPipelines(
        validateArgs(request.params.arguments, 'Pipeline arguments required')
      );
      break;
  • Registers the tool definitions and initializes the handler functions for pipeline tools.
    export const pipelineTools = {
      initialize: (config: AzureDevOpsConfig) => ({
        getPipelines: (args: any) => getPipelines(args, config),
        triggerPipeline: (args: any) => triggerPipeline(args, config),
        definitions,
      }),
      definitions,
  • Type definition for the input arguments of the getPipelines handler.
    interface GetPipelinesArgs {
      folder?: string;
      name?: string;
    }

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