work_list_team_iterations
Retrieve current iterations for a specific team within a project in Azure DevOps. Input project and team details to track iteration progress and planning. Integrates with PAT-authenticated MCP server for secure access.
Instructions
Retrieve a list of iterations for a specific team in a project.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project | Yes | The name or ID of the Azure DevOps project. | |
| team | Yes | The name or ID of the Azure DevOps team. | |
| timeframe | No | The timeframe for which to retrieve iterations. Currently, only 'current' is supported. |
Implementation Reference
- src/tools/work.ts:25-47 (handler)The async handler function that executes the core tool logic: connects to Azure DevOps, retrieves team iterations using WorkApi.getTeamIterations, and returns formatted JSON response or error.async ({ project, team, timeframe }) => { try { const connection = await connectionProvider(); const workApi = await connection.getWorkApi(); const iterations = await workApi.getTeamIterations({ project, team }, timeframe); if (!iterations) { return { content: [{ type: "text", text: "No iterations found" }], isError: true }; } return { content: [{ type: "text", text: JSON.stringify(iterations, null, 2) }], }; } catch (error) { const errorMessage = error instanceof Error ? error.message : "Unknown error occurred"; return { content: [{ type: "text", text: `Error fetching team iterations: ${errorMessage}` }], isError: true, }; } } );
- src/tools/work.ts:20-24 (schema)Zod input schema defining required 'project' and 'team' strings, and optional 'timeframe' enum.{ project: z.string().describe("The name or ID of the Azure DevOps project."), team: z.string().describe("The name or ID of the Azure DevOps team."), timeframe: z.enum(["current"]).optional().describe("The timeframe for which to retrieve iterations. Currently, only 'current' is supported."), },
- src/tools/work.ts:17-47 (registration)Direct registration of the MCP tool on the server using server.tool(), including name, description, schema, and handler reference.server.tool( WORK_TOOLS.list_team_iterations, "Retrieve a list of iterations for a specific team in a project.", { project: z.string().describe("The name or ID of the Azure DevOps project."), team: z.string().describe("The name or ID of the Azure DevOps team."), timeframe: z.enum(["current"]).optional().describe("The timeframe for which to retrieve iterations. Currently, only 'current' is supported."), }, async ({ project, team, timeframe }) => { try { const connection = await connectionProvider(); const workApi = await connection.getWorkApi(); const iterations = await workApi.getTeamIterations({ project, team }, timeframe); if (!iterations) { return { content: [{ type: "text", text: "No iterations found" }], isError: true }; } return { content: [{ type: "text", text: JSON.stringify(iterations, null, 2) }], }; } catch (error) { const errorMessage = error instanceof Error ? error.message : "Unknown error occurred"; return { content: [{ type: "text", text: `Error fetching team iterations: ${errorMessage}` }], isError: true, }; } } );
- src/tools/work.ts:10-14 (helper)Constant mapping internal function names to tool names, used in registration.const WORK_TOOLS = { list_team_iterations: "work_list_team_iterations", create_iterations: "work_create_iterations", assign_iterations: "work_assign_iterations", };
- src/tools.ts:16-21 (registration)Higher-level registration: imports and calls configureWorkTools to register all work-related tools including 'work_list_team_iterations'.import { configureWorkTools } from "./tools/work.js"; import { configureWorkItemTools } from "./tools/workitems.js"; function configureAllTools(server: McpServer, tokenProvider: () => Promise<AccessToken>, connectionProvider: () => Promise<WebApi>, userAgentProvider: () => string) { configureCoreTools(server, tokenProvider, connectionProvider, userAgentProvider); configureWorkTools(server, tokenProvider, connectionProvider);