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",
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states 'Retrieve list' which implies a read-only operation, but it doesn't mention authentication requirements, rate limits, pagination behavior (despite the 'top' parameter), error handling, or what the return format looks like. This leaves significant gaps for a tool that fetches data.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, direct sentence with zero wasted words. It front-loads the core purpose ('Retrieve list of comments') efficiently, making it easy to parse and understand at a glance.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (3 parameters, no output schema, and no annotations), the description is insufficient. It doesn't explain the return values, pagination behavior (implied by 'top'), or how comments are structured, leaving the agent with incomplete context for proper invocation and result interpretation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds no additional meaning beyond implying that 'workItemId' is used to identify the target, which is redundant with the schema. This meets the baseline for high schema coverage without extra value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Retrieve list') and resource ('comments for a work item by ID'), making the purpose immediately understandable. However, it doesn't differentiate this tool from sibling tools like 'wit_add_work_item_comment' or 'repo_list_pull_request_thread_comments', which also handle comments in different contexts, so it doesn't achieve full sibling distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'wit_get_work_item' (which might include comments) or 'repo_list_pull_request_thread_comments' (for code-related comments), nor does it specify prerequisites or exclusions, leaving usage context ambiguous.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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