list_work_items
Retrieve work items from Azure DevOps boards using WIQL queries to filter and organize tasks, bugs, and features for project tracking.
Instructions
List work items from a board
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | WIQL query to filter work items |
Implementation Reference
- src/tools/work-item/list.ts:6-28 (handler)The core handler function that executes a WIQL query against the Azure DevOps Work Item Tracking API and formats the result as MCP content.export async function listWorkItems(args: Wiql, config: AzureDevOpsConfig) { if (!args.query) { throw new McpError(ErrorCode.InvalidParams, 'Invalid WIQL query'); } AzureDevOpsConnection.initialize(config); const connection = AzureDevOpsConnection.getInstance(); const workItemTrackingApi = await connection.getWorkItemTrackingApi(); const queryResult = await workItemTrackingApi.queryByWiql( args, { project: config.project } ); return { content: [ { type: 'text', text: JSON.stringify(queryResult, null, 2), }, ], }; }
- src/tools/work-item/index.ts:52-61 (schema)Input schema for the list_work_items tool, requiring a 'query' string parameter for the WIQL query.inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'WIQL query to filter work items', }, }, required: ['query'], },
- src/tools/work-item/index.ts:49-62 (registration)Registration of the list_work_items tool in the definitions array, including name, description, and schema.{ name: 'list_work_items', description: 'List work items from a board', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'WIQL query to filter work items', }, }, required: ['query'], }, },
- src/index.ts:129-131 (registration)Main server dispatch case that calls the listWorkItems tool handler upon invocation.case 'list_work_items': result = await tools.workItem.listWorkItems(request.params.arguments); break;
- src/tools/work-item/index.ts:140-140 (registration)Wrapper registration that binds the listWorkItems handler to the tool instance with config.listWorkItems: (args: Wiql) => listWorkItems(args, config),