wit_my_work_items
Retrieve and manage work items assigned to or created by the authenticated user in Azure DevOps projects, with options to filter by type, limit results, and exclude completed items.
Instructions
Retrieve a list of work items relevent to the authenticated user.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| includeCompleted | No | Whether to include completed work items. Defaults to false. | |
| project | Yes | The name or ID of the Azure DevOps project. | |
| top | No | The maximum number of work items to return. Defaults to 50. | |
| type | No | The type of work items to retrieve. Defaults to 'assignedtome'. | assignedtome |
Implementation Reference
- src/tools/workitems.ts:115-124 (handler)The handler function that executes the tool logic: retrieves work items relevant to the authenticated user (assigned to me or my activity) using the Azure DevOps WorkItemTracking API's getPredefinedQueryResults method.async ({ project, type, top, includeCompleted }) => { const connection = await connectionProvider(); const workApi = await connection.getWorkApi(); const workItems = await workApi.getPredefinedQueryResults(project, type, top, includeCompleted); return { content: [{ type: "text", text: JSON.stringify(workItems, null, 2) }], }; }
- src/tools/workitems.ts:109-114 (schema)Zod schema defining the input parameters for the tool: project, type (assignedtome/myactivity), top (max items), includeCompleted.{ project: z.string().describe("The name or ID of the Azure DevOps project."), type: z.enum(["assignedtome", "myactivity"]).default("assignedtome").describe("The type of work items to retrieve. Defaults to 'assignedtome'."), top: z.number().default(50).describe("The maximum number of work items to return. Defaults to 50."), includeCompleted: z.boolean().default(false).describe("Whether to include completed work items. Defaults to false."), },
- src/tools/workitems.ts:13-13 (registration)Mapping of internal key 'my_work_items' to the tool name 'wit_my_work_items' in the WORKITEM_TOOLS constant, used in server.tool registration.my_work_items: "wit_my_work_items",
- src/tools/workitems.ts:106-126 (registration)The server.tool call that registers the 'wit_my_work_items' tool within the configureWorkItemTools function.server.tool( WORKITEM_TOOLS.my_work_items, "Retrieve a list of work items relevent to the authenticated user.", { project: z.string().describe("The name or ID of the Azure DevOps project."), type: z.enum(["assignedtome", "myactivity"]).default("assignedtome").describe("The type of work items to retrieve. Defaults to 'assignedtome'."), top: z.number().default(50).describe("The maximum number of work items to return. Defaults to 50."), includeCompleted: z.boolean().default(false).describe("Whether to include completed work items. Defaults to false."), }, async ({ project, type, top, includeCompleted }) => { const connection = await connectionProvider(); const workApi = await connection.getWorkApi(); const workItems = await workApi.getPredefinedQueryResults(project, type, top, includeCompleted); return { content: [{ type: "text", text: JSON.stringify(workItems, null, 2) }], }; } );