Skip to main content
Glama
ennuiii

Azure DevOps MCP Server with PAT Authentication

by ennuiii

wit_list_work_item_comments

Fetch comments for a specific work item by ID from Azure DevOps projects. Specify project and work item details to retrieve up to a defined number of comments.

Instructions

Retrieve list of comments for a work item by ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectYesThe name or ID of the Azure DevOps project.
topNoOptional number of comments to retrieve. Defaults to all comments.
workItemIdYesThe ID of the work item to retrieve comments for.

Implementation Reference

  • The main handler function that executes the tool logic: connects to Azure DevOps, retrieves the WorkItemTrackingApi, calls getComments with project, workItemId, and top parameters, and returns the JSON-stringified comments.
    async ({ project, workItemId, top }) => { const connection = await connectionProvider(); const workItemApi = await connection.getWorkItemTrackingApi(); const comments = await workItemApi.getComments(project, workItemId, top); return { content: [{ type: "text", text: JSON.stringify(comments, null, 2) }], }; }
  • Zod schema defining the input parameters for the tool: project (string), workItemId (number), top (number, default 50).
    project: z.string().describe("The name or ID of the Azure DevOps project."), workItemId: z.number().describe("The ID of the work item to retrieve comments for."), top: z.number().default(50).describe("Optional number of comments to retrieve. Defaults to all comments."), },
  • The server.tool registration call that registers the tool with name WORKITEM_TOOLS.list_work_item_comments ("wit_list_work_item_comments"), description, schema, and handler function.
    WORKITEM_TOOLS.list_work_item_comments, "Retrieve list of comments for a work item by ID.", { project: z.string().describe("The name or ID of the Azure DevOps project."), workItemId: z.number().describe("The ID of the work item to retrieve comments for."), top: z.number().default(50).describe("Optional number of comments to retrieve. Defaults to all comments."), }, async ({ project, workItemId, top }) => { const connection = await connectionProvider(); const workItemApi = await connection.getWorkItemTrackingApi(); const comments = await workItemApi.getComments(project, workItemId, top); return { content: [{ type: "text", text: JSON.stringify(comments, null, 2) }], }; } );
  • Mapping in WORKITEM_TOOLS constant that associates the internal key 'list_work_item_comments' with the tool name 'wit_list_work_item_comments'.
    list_work_item_comments: "wit_list_work_item_comments",

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