Skip to main content
Glama
ennuiii

Azure DevOps MCP Server with PAT Authentication

by ennuiii

repo_reply_to_comment

Respond to pull request comments in Azure DevOps repositories by specifying repository, PR, thread IDs, and content. Simplify collaboration with direct replies using PAT authentication.

Instructions

Replies to a specific comment on a pull request.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYesThe content of the comment to be added.
fullResponseNoReturn full comment JSON response instead of a simple confirmation message.
projectNoProject ID or project name (optional)
pullRequestIdYesThe ID of the pull request where the comment thread exists.
repositoryIdYesThe ID of the repository where the pull request is located.
threadIdYesThe ID of the thread to which the comment will be added.

Implementation Reference

  • The handler function that implements the core logic of the 'repo_reply_to_comment' tool by calling gitApi.createComment to reply to a comment in a pull request thread.
      async ({ repositoryId, pullRequestId, threadId, content, project, fullResponse }) => {
        const connection = await connectionProvider();
        const gitApi = await connection.getGitApi();
        const comment = await gitApi.createComment({ content }, repositoryId, pullRequestId, threadId, project);
    
        // Check if the comment was successfully created
        if (!comment) {
          return {
            content: [{ type: "text", text: `Error: Failed to add comment to thread ${threadId}. The comment was not created successfully.` }],
            isError: true,
          };
        }
    
        if (fullResponse) {
          return {
            content: [{ type: "text", text: JSON.stringify(comment, null, 2) }],
          };
        }
    
        return {
          content: [{ type: "text", text: `Comment successfully added to thread ${threadId}.` }],
        };
      }
    );
  • Zod input schema defining the parameters for the 'repo_reply_to_comment' tool.
      repositoryId: z.string().describe("The ID of the repository where the pull request is located."),
      pullRequestId: z.number().describe("The ID of the pull request where the comment thread exists."),
      threadId: z.number().describe("The ID of the thread to which the comment will be added."),
      content: z.string().describe("The content of the comment to be added."),
      project: z.string().optional().describe("Project ID or project name (optional)"),
      fullResponse: z.boolean().optional().default(false).describe("Return full comment JSON response instead of a simple confirmation message."),
    },
  • The server.tool registration call that registers the 'repo_reply_to_comment' tool with the MCP server, including schema and handler.
    server.tool(
      REPO_TOOLS.reply_to_comment,
      "Replies to a specific comment on a pull request.",
      {
        repositoryId: z.string().describe("The ID of the repository where the pull request is located."),
        pullRequestId: z.number().describe("The ID of the pull request where the comment thread exists."),
        threadId: z.number().describe("The ID of the thread to which the comment will be added."),
        content: z.string().describe("The content of the comment to be added."),
        project: z.string().optional().describe("Project ID or project name (optional)"),
        fullResponse: z.boolean().optional().default(false).describe("Return full comment JSON response instead of a simple confirmation message."),
      },
      async ({ repositoryId, pullRequestId, threadId, content, project, fullResponse }) => {
        const connection = await connectionProvider();
        const gitApi = await connection.getGitApi();
        const comment = await gitApi.createComment({ content }, repositoryId, pullRequestId, threadId, project);
    
        // Check if the comment was successfully created
        if (!comment) {
          return {
            content: [{ type: "text", text: `Error: Failed to add comment to thread ${threadId}. The comment was not created successfully.` }],
            isError: true,
          };
        }
    
        if (fullResponse) {
          return {
            content: [{ type: "text", text: JSON.stringify(comment, null, 2) }],
          };
        }
    
        return {
          content: [{ type: "text", text: `Comment successfully added to thread ${threadId}.` }],
        };
      }
    );
  • REPO_TOOLS constant that defines the mapping from internal name 'reply_to_comment' to the MCP tool name 'repo_reply_to_comment'.
    const REPO_TOOLS = {
      list_repos_by_project: "repo_list_repos_by_project",
      list_pull_requests_by_repo: "repo_list_pull_requests_by_repo",
      list_pull_requests_by_project: "repo_list_pull_requests_by_project",
      list_branches_by_repo: "repo_list_branches_by_repo",
      list_my_branches_by_repo: "repo_list_my_branches_by_repo",
      list_pull_request_threads: "repo_list_pull_request_threads",
      list_pull_request_thread_comments: "repo_list_pull_request_thread_comments",
      get_repo_by_name_or_id: "repo_get_repo_by_name_or_id",
      get_branch_by_name: "repo_get_branch_by_name",
      get_pull_request_by_id: "repo_get_pull_request_by_id",
      create_pull_request: "repo_create_pull_request",
      update_pull_request: "repo_update_pull_request",
      update_pull_request_reviewers: "repo_update_pull_request_reviewers",
      reply_to_comment: "repo_reply_to_comment",
      create_pull_request_thread: "repo_create_pull_request_thread",
      resolve_comment: "repo_resolve_comment",
      search_commits: "repo_search_commits",
      list_pull_requests_by_commits: "repo_list_pull_requests_by_commits",
    };
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Replies to' implies a write operation, the description doesn't mention authentication requirements, permission levels needed, rate limits, whether replies are editable/deletable, or what happens on success/failure. For a mutation tool with zero annotation coverage, this is insufficient behavioral context.

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, efficient sentence with zero wasted words. It's appropriately sized for the tool's complexity and gets straight to the point without unnecessary elaboration.

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

Completeness3/5

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

For a mutation tool with no annotations and no output schema, the description is minimally adequate but has significant gaps. It states what the tool does but lacks behavioral context, usage guidance, and output information. The 100% schema coverage helps, but the description should do more given this is a write operation with multiple parameters.

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 6 parameters thoroughly. The description adds no parameter-specific information beyond what's in the schema (like explaining the relationship between repositoryId, pullRequestId, and threadId). With high schema coverage, the baseline score of 3 is appropriate.

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 ('Replies to') and target ('a specific comment on a pull request'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools like 'wit_add_work_item_comment' or 'repo_create_pull_request_thread' that also handle comments in different contexts, so it doesn't achieve full sibling differentiation.

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. There are multiple comment-related tools in the sibling list (e.g., 'wit_add_work_item_comment', 'repo_create_pull_request_thread'), but the description doesn't indicate this is specifically for replying to existing pull request comment threads versus creating new threads or commenting on work items.

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