Skip to main content
Glama
ennuiii

Azure DevOps MCP Server with PAT Authentication

by ennuiii

work_create_iterations

Generate iterations in Azure DevOps projects by defining names, start dates, and finish dates. Integrates with PAT authentication for streamlined project planning.

Instructions

Create new iterations in a specified Azure DevOps project.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
iterationsYesAn array of iterations to create. Each iteration must have a name and can optionally have start and finish dates in ISO format.
projectYesThe name or ID of the Azure DevOps project.

Implementation Reference

  • The asynchronous handler function that implements the logic for creating new iterations in an Azure DevOps project using the WorkItemTrackingApi. It processes an array of iterations, creates each one with optional start and finish dates, collects results, and returns them as JSON or an error message.
    async ({ project, iterations }) => {
      try {
        const connection = await connectionProvider();
        const workItemTrackingApi = await connection.getWorkItemTrackingApi();
        const results = [];
    
        for (const { iterationName, startDate, finishDate } of iterations) {
          // Step 1: Create the iteration
          const iteration = await workItemTrackingApi.createOrUpdateClassificationNode(
            {
              name: iterationName,
              attributes: {
                startDate: startDate ? new Date(startDate) : undefined,
                finishDate: finishDate ? new Date(finishDate) : undefined,
              },
            },
            project,
            TreeStructureGroup.Iterations
          );
    
          if (iteration) {
            results.push(iteration);
          }
        }
    
        if (results.length === 0) {
          return { content: [{ type: "text", text: "No iterations were created" }], isError: true };
        }
    
        return {
          content: [{ type: "text", text: JSON.stringify(results, null, 2) }],
        };
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : "Unknown error occurred";
    
        return {
          content: [{ type: "text", text: `Error creating iterations: ${errorMessage}` }],
          isError: true,
        };
      }
    }
  • Zod input schema defining the parameters for the tool: 'project' (string) and 'iterations' (array of objects with 'iterationName' (required string) and optional 'startDate'/'finishDate' (ISO strings)).
    {
      project: z.string().describe("The name or ID of the Azure DevOps project."),
      iterations: z
        .array(
          z.object({
            iterationName: z.string().describe("The name of the iteration to create."),
            startDate: z.string().optional().describe("The start date of the iteration in ISO format (e.g., '2023-01-01T00:00:00Z'). Optional."),
            finishDate: z.string().optional().describe("The finish date of the iteration in ISO format (e.g., '2023-01-31T23:59:59Z'). Optional."),
          })
        )
        .describe("An array of iterations to create. Each iteration must have a name and can optionally have start and finish dates in ISO format."),
    },
  • Registration of the MCP tool 'work_create_iterations' via server.tool(), specifying the tool name (from WORK_TOOLS), description, input schema, and handler function.
    server.tool(
      WORK_TOOLS.create_iterations,
      "Create new iterations in a specified Azure DevOps project.",
      {
        project: z.string().describe("The name or ID of the Azure DevOps project."),
        iterations: z
          .array(
            z.object({
              iterationName: z.string().describe("The name of the iteration to create."),
              startDate: z.string().optional().describe("The start date of the iteration in ISO format (e.g., '2023-01-01T00:00:00Z'). Optional."),
              finishDate: z.string().optional().describe("The finish date of the iteration in ISO format (e.g., '2023-01-31T23:59:59Z'). Optional."),
            })
          )
          .describe("An array of iterations to create. Each iteration must have a name and can optionally have start and finish dates in ISO format."),
      },
      async ({ project, iterations }) => {
        try {
          const connection = await connectionProvider();
          const workItemTrackingApi = await connection.getWorkItemTrackingApi();
          const results = [];
    
          for (const { iterationName, startDate, finishDate } of iterations) {
            // Step 1: Create the iteration
            const iteration = await workItemTrackingApi.createOrUpdateClassificationNode(
              {
                name: iterationName,
                attributes: {
                  startDate: startDate ? new Date(startDate) : undefined,
                  finishDate: finishDate ? new Date(finishDate) : undefined,
                },
              },
              project,
              TreeStructureGroup.Iterations
            );
    
            if (iteration) {
              results.push(iteration);
            }
          }
    
          if (results.length === 0) {
            return { content: [{ type: "text", text: "No iterations were created" }], isError: true };
          }
    
          return {
            content: [{ type: "text", text: JSON.stringify(results, null, 2) }],
          };
        } catch (error) {
          const errorMessage = error instanceof Error ? error.message : "Unknown error occurred";
    
          return {
            content: [{ type: "text", text: `Error creating iterations: ${errorMessage}` }],
            isError: true,
          };
        }
      }
    );
  • Constant object WORK_TOOLS that maps internal handler names (e.g., 'create_iterations') to the full MCP tool names (e.g., 'work_create_iterations'), used in tool registrations.
    const WORK_TOOLS = {
      list_team_iterations: "work_list_team_iterations",
      create_iterations: "work_create_iterations",
      assign_iterations: "work_assign_iterations",
    };
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. While 'Create' implies a write operation, it doesn't specify required permissions, whether iterations can be modified or deleted after creation, rate limits, or what happens on success/failure. This is inadequate for a mutation tool with zero annotation coverage.

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 that gets straight to the point with zero wasted words. It's appropriately sized and front-loaded with the core functionality.

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?

For a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what happens after creation (e.g., returns iteration IDs), error conditions, or how this tool fits into the broader Azure DevOps work management context alongside sibling tools.

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?

The schema description coverage is 100%, so the schema already fully documents both parameters. The description doesn't add any additional meaning beyond what's in the schema (e.g., it doesn't explain what 'iterations' represent in Azure DevOps context or provide examples). Baseline 3 is appropriate when the schema does all the work.

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 ('Create new iterations') and the resource ('in a specified Azure DevOps project'), making the purpose immediately understandable. However, it doesn't differentiate this tool from its sibling 'work_assign_iterations' or 'work_list_team_iterations', which prevents a perfect score.

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. There's no mention of prerequisites, when not to use it, or how it relates to sibling tools like 'work_assign_iterations' or 'work_list_team_iterations'.

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

Related 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/ennuiii/DevOpsMcpPAT'

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