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", };

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