ado_query_area
Query user stories and work items from specific areas in Azure DevOps to track project progress and manage development tasks.
Instructions
Consulta User Stories de un área específica en Azure DevOps
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| areaPath | Yes | Ruta del área (ej: 'Proyecto\Equipo') | |
| workItemType | No | Tipo de Work Item (User Story, Bug, Task, etc.) |
Implementation Reference
- src/index.ts:319-354 (handler)The handler implementation for the `ado_query_area` tool, which queries Azure DevOps Work Items based on the provided area path and work item type.
async ({ areaPath, workItemType }) => { const api = await getWitApi(); const type = workItemType || "User Story"; const wiql: witInterfaces.Wiql = { query: `SELECT [System.Id], [System.Title], [System.State], [System.Tags] FROM WorkItems WHERE [System.WorkItemType] = '${type}' AND [System.AreaPath] UNDER '${areaPath}' ORDER BY [System.Id] DESC`, }; const teamContext = { project: currentProject }; const queryResult = await api.queryByWiql(wiql, teamContext); const workItemRefs = queryResult.workItems || []; if (workItemRefs.length === 0) { return { content: [ { type: "text", text: "No se encontraron Work Items en esta área" }, ], }; } const ids = workItemRefs.map((wi) => wi.id!).filter((id): id is number => id !== undefined); const workItems = await api.getWorkItems( ids, ["System.Id", "System.Title", "System.State", "System.Tags"] ); const result = workItems .map((wi) => { const fields = wi.fields || {}; return `ID: ${wi.id} | ${fields["System.Title"]} | Estado: ${fields["System.State"]} | Tags: ${fields["System.Tags"] || "N/A"}`; }) .join("\n"); return { content: [{ type: "text", text: result || "Sin resultados" }], }; } - src/index.ts:309-318 (registration)Registration of the `ado_query_area` tool, including its description and input schema using zod.
server.tool( "ado_query_area", "Consulta User Stories de un área específica en Azure DevOps", { areaPath: z.string().describe("Ruta del área (ej: 'Proyecto\\Equipo')"), workItemType: z .string() .optional() .describe("Tipo de Work Item (User Story, Bug, Task, etc.)"), },