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
| Name | Required | Description | Default |
|---|---|---|---|
| folder | No | Filter pipelines by folder path (optional) | |
| name | No | Filter pipelines by name (optional) |
Implementation Reference
- src/tools/pipeline/get.ts:10-38 (handler)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}` ); } }
- src/tools/pipeline/index.ts:6-22 (schema)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;
- src/tools/pipeline/index.ts:50-56 (registration)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,
- src/tools/pipeline/get.ts:5-8 (schema)Type definition for the input arguments of the getPipelines handler.interface GetPipelinesArgs { folder?: string; name?: string; }