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
| Name | Required | Description | Default |
|---|---|---|---|
| status | No | The status to set for a new thread | |
| content | Yes | The content of the comment in markdown | |
| filePath | No | The path of the file to comment on (for new thread on file) | |
| threadId | No | The ID of the thread to add the comment to | |
| projectId | No | The ID or name of the project (defaults to AZURE_DEVOPS_DEFAULT_PROJECT) | |
| lineNumber | No | The line number to comment on (for new thread on file) | |
| repositoryId | No | The ID or name of the repository (optional; derived from pullRequestId when omitted) | |
| endLineNumber | No | 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 | |
| pullRequestId | Yes | The ID of the pull request | |
| organizationId | No | The ID or name of the organization (defaults to configured organization) | |
| parentCommentId | No | ID of the parent comment when replying to an existing comment |