Skip to main content
Glama
nikydobrev

Azure DevOps Multi-Organization MCP Server

by nikydobrev

pipelines_run_pipeline

Trigger Azure DevOps pipeline runs with custom parameters, variables, and resource configurations to automate build and deployment workflows.

Instructions

Triggers a new pipeline run with optional parameters and variables

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
organizationYesThe name of the Azure DevOps organization
projectYesProject ID or name to run the build in
pipelineIdYesID of the pipeline to run
pipelineVersionNoVersion of the pipeline to run. If not provided, the latest version will be used.
previewRunNoIf true, returns the final YAML document after parsing templates without creating a new run.
resourcesNoA dictionary of resources to pass to the pipeline.
stagesToSkipNoA list of stages to skip.
templateParametersNoCustom build parameters as key-value pairs
variablesNoA dictionary of variables to pass to the pipeline.
yamlOverrideNoYAML override for the pipeline run.

Implementation Reference

  • The handler function that executes the tool: validates yamlOverride with previewRun, constructs the runRequest, calls pipelinesApi.runPipeline, and returns the pipeline run as JSON text.
    async ({ organization, project, pipelineId, pipelineVersion, previewRun, resources, stagesToSkip, templateParameters, variables, yamlOverride }) => { if (!previewRun && yamlOverride) { throw new Error("Parameter 'yamlOverride' can only be specified together with parameter 'previewRun'."); } const connection = await connectionManager.getConnection(organization); const pipelinesApi = await connection.getPipelinesApi(); const runRequest = { previewRun: previewRun, resources: { ...resources, }, stagesToSkip: stagesToSkip, templateParameters: templateParameters, variables: variables, yamlOverride: yamlOverride, }; const pipelineRun = await pipelinesApi.runPipeline(runRequest as any, project, pipelineId, pipelineVersion); return { content: [{ type: "text", text: JSON.stringify(pipelineRun, null, 2) }], }; }
  • Zod schema defining the input parameters for the pipelines_run_pipeline tool, including organization, project, pipelineId, and optional parameters like variables, resources, etc.
    { organization: z.string().describe("The name of the Azure DevOps organization"), project: z.string().describe("Project ID or name to run the build in"), pipelineId: z.number().describe("ID of the pipeline to run"), pipelineVersion: z.number().optional().describe("Version of the pipeline to run. If not provided, the latest version will be used."), previewRun: z.boolean().optional().describe("If true, returns the final YAML document after parsing templates without creating a new run."), resources: resourcesSchema.optional().describe("A dictionary of resources to pass to the pipeline."), stagesToSkip: z.array(z.string()).optional().describe("A list of stages to skip."), templateParameters: z.record(z.string(), z.string()).optional().describe("Custom build parameters as key-value pairs"), variables: z.record(z.string(), variableSchema).optional().describe("A dictionary of variables to pass to the pipeline."), yamlOverride: z.string().optional().describe("YAML override for the pipeline run."), },
  • The server.tool call that registers the pipelines_run_pipeline tool with its schema and handler function.
    server.tool( "pipelines_run_pipeline", "Triggers a new pipeline run with optional parameters and variables", { organization: z.string().describe("The name of the Azure DevOps organization"), project: z.string().describe("Project ID or name to run the build in"), pipelineId: z.number().describe("ID of the pipeline to run"), pipelineVersion: z.number().optional().describe("Version of the pipeline to run. If not provided, the latest version will be used."), previewRun: z.boolean().optional().describe("If true, returns the final YAML document after parsing templates without creating a new run."), resources: resourcesSchema.optional().describe("A dictionary of resources to pass to the pipeline."), stagesToSkip: z.array(z.string()).optional().describe("A list of stages to skip."), templateParameters: z.record(z.string(), z.string()).optional().describe("Custom build parameters as key-value pairs"), variables: z.record(z.string(), variableSchema).optional().describe("A dictionary of variables to pass to the pipeline."), yamlOverride: z.string().optional().describe("YAML override for the pipeline run."), }, async ({ organization, project, pipelineId, pipelineVersion, previewRun, resources, stagesToSkip, templateParameters, variables, yamlOverride }) => { if (!previewRun && yamlOverride) { throw new Error("Parameter 'yamlOverride' can only be specified together with parameter 'previewRun'."); } const connection = await connectionManager.getConnection(organization); const pipelinesApi = await connection.getPipelinesApi(); const runRequest = { previewRun: previewRun, resources: { ...resources, }, stagesToSkip: stagesToSkip, templateParameters: templateParameters, variables: variables, yamlOverride: yamlOverride, }; const pipelineRun = await pipelinesApi.runPipeline(runRequest as any, project, pipelineId, pipelineVersion); return { content: [{ type: "text", text: JSON.stringify(pipelineRun, null, 2) }], }; } );

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

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