Skip to main content
Glama
Azure DevOps MCP Server

Azure DevOps MCP Server

add_pull_request_comment

Add comments to Azure DevOps pull requests, including file/line-specific threads or replies, for code review and PR discussion.

Instructions

Add a comment to a pull request (repositoryId optional; derived from pullRequestId when omitted)

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "pullRequestId": "<pullRequestId>",
      "content": "<content>"
    },
    "name": "add_pull_request_comment"
  }
}

Input Schema

NameRequiredDescriptionDefault
statusNoThe status to set for a new thread
contentYesThe content of the comment in markdown
filePathNoThe path of the file to comment on (for new thread on file)
threadIdNoThe ID of the thread to add the comment to
projectIdNoThe ID or name of the project (defaults to AZURE_DEVOPS_DEFAULT_PROJECT)
lineNumberNoThe line number to comment on (for new thread on file)
repositoryIdNoThe ID or name of the repository (optional; derived from pullRequestId when omitted)
endLineNumberNoThe last line of the commented range (default: lineNumber; requires filePath and lineNumber). The thread covers the lines in full, so a suggestion replaces exactly these lines
pullRequestIdYesThe ID of the pull request
organizationIdNoThe ID or name of the organization (defaults to configured organization)
parentCommentIdNoID of the parent comment when replying to an existing comment

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv1.0.13
    • removedInput schema / additionalProperties
      Removed value: -false
    • changedInput schema / properties / organizationId / description
      Previous value: -"The ID or name of the organization (Default: mycompany)"New value: +"The ID or name of the organization (defaults to configured organization)"
    • changedInput schema / properties / projectId / description
      Previous value: -"The ID or name of the project (Default: MyProject)"New value: +"The ID or name of the project (defaults to AZURE_DEVOPS_DEFAULT_PROJECT)"
  2. Changed4 schema fields changedv1.0.11
    • addedInput schema / properties / endLineNumber
      Added value: +{
      +  "description": "The last line of the commented range (default: lineNumber; requires filePath and lineNumber). The thread covers the lines in full, so a suggestion replaces exactly these lines",
      +  "exclusiveMinimum": 0,
      +  "maximum": 9007199254740991,
      +  "type": "integer"
      +}
    • addedInput schema / properties / lineNumber / exclusiveMinimum
      Added value: +0
    • addedInput schema / properties / lineNumber / maximum
      Added value: +9007199254740991
    • changedInput schema / properties / lineNumber / type
      Previous value: -"number"New value: +"integer"
  3. Changed2 schema fields changedv0.1.10
    • changedInput schema / properties / repositoryId / description
      Previous value: -"The ID or name of the repository"New value: +"The ID or name of the repository (optional; derived from pullRequestId when omitted)"
    • changedInput schema / required
      Previous value: -[
      -  "repositoryId",
      -  "pullRequestId",
      -  "content"
      -]New value: +[
      +  "pullRequestId",
      +  "content"
      +]
  4. Addedv1.0.0

TDQS

B3.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, idempotentHint=false, openWorldHint=true and destructiveHint=false, so the safety profile is covered. The description adds one useful behavioral fact, that repositoryId is derived from pullRequestId, but says nothing about thread creation semantics, whether a new thread is created by default, or what happens when threadId is supplied.

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

Conciseness4/5

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

A single front-loaded sentence with no filler. It is tight, though it is arguably too terse for a tool with three operating modes.

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?

The 100% schema coverage carries most of the weight, and no output schema is needed. However, for an 11-parameter mutation tool with mutually exclusive modes, the description leaves an agent to infer the new-thread vs. reply distinction entirely from parameter names.

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?

Schema coverage is 100%, so the baseline is 3. The repositoryId derivation note in the description largely repeats the schema's own text, and the description says nothing about the threadId/filePath/lineNumber interactions that determine the tool's actual mode.

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?

States a specific verb and resource: "Add a comment to a pull request". It is clearly distinguishable from the review/merge/update siblings, though it does not call out how it differs from add_work_item_comment or get_pull_request_comments.

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?

No when-to-use or when-not-to-use guidance. Given 11 parameters spanning three distinct modes (new thread, reply to thread, file/line comment), the description gives no indication of which scenario applies or that get_pull_request_comments is the read counterpart.

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