You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add line parameter support to create_pull_request_review tool (#118)
* Add line parameter support to create_pull_request_review tool
- Updated schema to make path and body the only required fields
- Added line parameter as alternative to position for inline comments
- Updated handler to accept either position or line based on GitHub API spec
- Added new test case that verifies line parameter works properly
- Updated error messages for better validation
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* Expand PR review API with multi-line comment support
- Added new parameters: line, side, start_line, start_side
- Added proper validation for multi-line comment parameters
- Improved validation logic to handle parameter combinations
- Added test cases for regular and multi-line comments
- Updated schema documentation for better tool discoverability
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* gofmt
---------
Co-authored-by: Claude <[email protected]>
Co-authored-by: Javier Uruen Val <[email protected]>
Copy file name to clipboardExpand all lines: pkg/github/pullrequests.go
+56-15
Original file line number
Diff line number
Diff line change
@@ -593,15 +593,31 @@ func createPullRequestReview(client *github.Client, t translations.TranslationHe
593
593
map[string]interface{}{
594
594
"type": "object",
595
595
"additionalProperties": false,
596
-
"required": []string{"path", "position", "body"},
596
+
"required": []string{"path", "body"},
597
597
"properties": map[string]interface{}{
598
598
"path": map[string]interface{}{
599
599
"type": "string",
600
600
"description": "path to the file",
601
601
},
602
602
"position": map[string]interface{}{
603
603
"type": "number",
604
-
"description": "line number in the file",
604
+
"description": "position of the comment in the diff",
605
+
},
606
+
"line": map[string]interface{}{
607
+
"type": "number",
608
+
"description": "line number in the file to comment on. For multi-line comments, the end of the line range",
609
+
},
610
+
"side": map[string]interface{}{
611
+
"type": "string",
612
+
"description": "The side of the diff on which the line resides. For multi-line comments, this is the side for the end of the line range. (LEFT or RIGHT)",
613
+
},
614
+
"start_line": map[string]interface{}{
615
+
"type": "number",
616
+
"description": "The first line of the range to which the comment refers. Required for multi-line comments.",
617
+
},
618
+
"start_side": map[string]interface{}{
619
+
"type": "string",
620
+
"description": "The side of the diff on which the start line resides for multi-line comments. (LEFT or RIGHT)",
605
621
},
606
622
"body": map[string]interface{}{
607
623
"type": "string",
@@ -610,7 +626,7 @@ func createPullRequestReview(client *github.Client, t translations.TranslationHe
610
626
},
611
627
},
612
628
),
613
-
mcp.Description("Line-specific comments array of objects, each object with path (string), position (number), and body (string)"),
629
+
mcp.Description("Line-specific comments array of objects to place comments on pull request changes. Requires path and body. For line comments use line or position. For multi-line comments use start_line and line with optional side parameters."),
0 commit comments