Skip to main content
Glama
nikydobrev

Azure DevOps Multi-Organization MCP Server

by nikydobrev

pipelines_get_build_definitions

Retrieve and filter build pipeline configurations from Azure DevOps projects to manage and analyze CI/CD workflows.

Instructions

Gets a list of build definitions (pipeline configurations) in a project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
organizationYesThe name of the Azure DevOps organization
projectYesProject ID or name to get build definitions for
repositoryIdNoRepository ID to filter build definitions
repositoryTypeNoType of repository to filter build definitions
nameNoName of the build definition to filter
pathNoPath of the build definition to filter
queryOrderNoOrder in which build definitions are returned
topNoMaximum number of build definitions to return
continuationTokenNoToken for continuing paged results
minMetricsTimeNoMinimum metrics time to filter build definitions (ISO 8601 string)
definitionIdsNoArray of build definition IDs to filter
builtAfterNoReturn definitions that have builds after this date (ISO 8601 string)
notBuiltAfterNoReturn definitions that do not have builds after this date (ISO 8601 string)
includeAllPropertiesNoWhether to include all properties in the results
includeLatestBuildsNoWhether to include the latest builds for each definition
taskIdFilterNoTask ID to filter build definitions
processTypeNoProcess type to filter build definitions
yamlFilenameNoYAML filename to filter build definitions

Implementation Reference

  • The main handler logic that connects to Azure DevOps, calls getDefinitions API with filtered parameters, simplifies the build definitions list, and returns formatted JSON response.
    async ({ organization, project, repositoryId, repositoryType, name, path, queryOrder, top, continuationToken, minMetricsTime, definitionIds, builtAfter, notBuiltAfter, includeAllProperties, includeLatestBuilds, taskIdFilter, processType, yamlFilename }) => {
        const connection = await connectionManager.getConnection(organization);
        const buildApi = await connection.getBuildApi();
        
        // Default top to 50 to prevent massive responses
        const limit = top || 50;
    
        const buildDefinitions = await buildApi.getDefinitions(
            project, 
            name, 
            repositoryId, 
            repositoryType, 
            safeEnumConvert(DefinitionQueryOrder, queryOrder), 
            limit, 
            continuationToken, 
            minMetricsTime ? new Date(minMetricsTime) : undefined, 
            definitionIds, 
            path, 
            builtAfter ? new Date(builtAfter) : undefined, 
            notBuiltAfter ? new Date(notBuiltAfter) : undefined, 
            includeAllProperties, 
            includeLatestBuilds, 
            taskIdFilter, 
            processType, 
            yamlFilename
        );
    
        // Simplify the output
        const simplifiedDefinitions = buildDefinitions.map(d => ({
            id: d.id,
            name: d.name,
            path: d.path,
            type: d.type,
            queueStatus: d.queueStatus,
            revision: d.revision,
            url: d.url
        }));
    
        return {
            content: [{ type: "text", text: JSON.stringify(simplifiedDefinitions, null, 2) }],
        };
    }
  • Zod schema for tool input parameters, including all filters and pagination options for querying build definitions.
    {
        organization: z.string().describe("The name of the Azure DevOps organization"),
        project: z.string().describe("Project ID or name to get build definitions for"),
        repositoryId: z.string().optional().describe("Repository ID to filter build definitions"),
        repositoryType: z.enum(["TfsGit", "GitHub", "BitbucketCloud"]).optional().describe("Type of repository to filter build definitions"),
        name: z.string().optional().describe("Name of the build definition to filter"),
        path: z.string().optional().describe("Path of the build definition to filter"),
        queryOrder: z
            .enum(getEnumKeys(DefinitionQueryOrder))
            .optional()
            .describe("Order in which build definitions are returned"),
        top: z.number().optional().describe("Maximum number of build definitions to return"),
        continuationToken: z.string().optional().describe("Token for continuing paged results"),
        minMetricsTime: z.string().optional().describe("Minimum metrics time to filter build definitions (ISO 8601 string)"),
        definitionIds: z.array(z.number()).optional().describe("Array of build definition IDs to filter"),
        builtAfter: z.string().optional().describe("Return definitions that have builds after this date (ISO 8601 string)"),
        notBuiltAfter: z.string().optional().describe("Return definitions that do not have builds after this date (ISO 8601 string)"),
        includeAllProperties: z.boolean().optional().describe("Whether to include all properties in the results"),
        includeLatestBuilds: z.boolean().optional().describe("Whether to include the latest builds for each definition"),
        taskIdFilter: z.string().optional().describe("Task ID to filter build definitions"),
        processType: z.number().optional().describe("Process type to filter build definitions"),
        yamlFilename: z.string().optional().describe("YAML filename to filter build definitions"),
    },
  • MCP server tool registration call that associates the name, description, input schema, and handler function.
    server.tool(
      "pipelines_get_build_definitions",
      "Gets a list of build definitions (pipeline configurations) in a project",
      {
          organization: z.string().describe("The name of the Azure DevOps organization"),
          project: z.string().describe("Project ID or name to get build definitions for"),
          repositoryId: z.string().optional().describe("Repository ID to filter build definitions"),
          repositoryType: z.enum(["TfsGit", "GitHub", "BitbucketCloud"]).optional().describe("Type of repository to filter build definitions"),
          name: z.string().optional().describe("Name of the build definition to filter"),
          path: z.string().optional().describe("Path of the build definition to filter"),
          queryOrder: z
              .enum(getEnumKeys(DefinitionQueryOrder))
              .optional()
              .describe("Order in which build definitions are returned"),
          top: z.number().optional().describe("Maximum number of build definitions to return"),
          continuationToken: z.string().optional().describe("Token for continuing paged results"),
          minMetricsTime: z.string().optional().describe("Minimum metrics time to filter build definitions (ISO 8601 string)"),
          definitionIds: z.array(z.number()).optional().describe("Array of build definition IDs to filter"),
          builtAfter: z.string().optional().describe("Return definitions that have builds after this date (ISO 8601 string)"),
          notBuiltAfter: z.string().optional().describe("Return definitions that do not have builds after this date (ISO 8601 string)"),
          includeAllProperties: z.boolean().optional().describe("Whether to include all properties in the results"),
          includeLatestBuilds: z.boolean().optional().describe("Whether to include the latest builds for each definition"),
          taskIdFilter: z.string().optional().describe("Task ID to filter build definitions"),
          processType: z.number().optional().describe("Process type to filter build definitions"),
          yamlFilename: z.string().optional().describe("YAML filename to filter build definitions"),
      },
      async ({ organization, project, repositoryId, repositoryType, name, path, queryOrder, top, continuationToken, minMetricsTime, definitionIds, builtAfter, notBuiltAfter, includeAllProperties, includeLatestBuilds, taskIdFilter, processType, yamlFilename }) => {
          const connection = await connectionManager.getConnection(organization);
          const buildApi = await connection.getBuildApi();
          
          // Default top to 50 to prevent massive responses
          const limit = top || 50;
    
          const buildDefinitions = await buildApi.getDefinitions(
              project, 
              name, 
              repositoryId, 
              repositoryType, 
              safeEnumConvert(DefinitionQueryOrder, queryOrder), 
              limit, 
              continuationToken, 
              minMetricsTime ? new Date(minMetricsTime) : undefined, 
              definitionIds, 
              path, 
              builtAfter ? new Date(builtAfter) : undefined, 
              notBuiltAfter ? new Date(notBuiltAfter) : undefined, 
              includeAllProperties, 
              includeLatestBuilds, 
              taskIdFilter, 
              processType, 
              yamlFilename
          );
    
          // Simplify the output
          const simplifiedDefinitions = buildDefinitions.map(d => ({
              id: d.id,
              name: d.name,
              path: d.path,
              type: d.type,
              queueStatus: d.queueStatus,
              revision: d.revision,
              url: d.url
          }));
    
          return {
              content: [{ type: "text", text: JSON.stringify(simplifiedDefinitions, null, 2) }],
          };
      }
    );
  • Helper utility to extract string enum keys, used in the schema for queryOrder parameter.
    export function getEnumKeys(enumObject: any): [string, ...string[]] {
        const keys = Object.keys(enumObject).filter((key) => isNaN(Number(key)));
        if (keys.length === 0) {
            return ["Values"]; 
        }
        return [keys[0], ...keys.slice(1)];
    }
  • Helper utility for safe enum value lookup, used in the handler for queryOrder conversion.
    export function safeEnumConvert<T>(enumObject: any, key?: string): T | undefined {
        if (!key) return undefined;
        return enumObject[key];
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states it 'Gets a list' but lacks critical details: whether it's paginated (implied by 'continuationToken' in schema but not described), rate limits, authentication requirements, error handling, or output format. For a tool with 18 parameters and no annotations, this is a significant gap in transparency.

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, efficient sentence with zero waste. It's front-loaded with the core purpose ('Gets a list of build definitions') and includes essential context ('pipeline configurations', 'in a project'). No extraneous details or redundancy.

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 (18 parameters, no annotations, no output schema), the description is inadequate. It doesn't cover behavioral aspects (pagination, errors), output format, or usage context. For a list/query tool with many filtering options, more guidance is needed to help an agent use it effectively.

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?

Schema description coverage is 100%, so the schema fully documents all 18 parameters. The description adds no parameter-specific information beyond the generic 'in a project' context. It doesn't explain how parameters interact (e.g., filtering logic) or provide examples. Baseline 3 is appropriate as the schema does the heavy lifting, but the description adds minimal value.

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 action ('Gets a list') and resource ('build definitions/pipeline configurations') with context ('in a project'). It distinguishes from siblings like 'pipelines_get_build_definition_revisions' (specific revisions) and 'pipelines_get_builds' (actual builds vs definitions), though not explicitly named. However, it doesn't fully differentiate from all siblings (e.g., 'pipelines_list_runs' is similar but for runs).

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. It doesn't mention prerequisites (e.g., authentication), compare to sibling tools like 'pipelines_get_builds' (for builds) or 'pipelines_get_build_definition_revisions' (for revisions), or specify scenarios (e.g., filtering vs listing all). Usage is implied by the name but not explicitly stated.

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

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