Skip to content

Commit 88537df

Browse files
authored
Merge pull request #1249 from modelcontextprotocol/ashwin/github
Update github CreatePullRequestReview schema to allow line or position
2 parents 4ae560a + 188a569 commit 88537df

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

github/operations/pulls.ts

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,20 @@ export const CreatePullRequestReviewSchema = z.object({
112112
commit_id: z.string().optional().describe("The SHA of the commit that needs a review"),
113113
body: z.string().describe("The body text of the review"),
114114
event: z.enum(['APPROVE', 'REQUEST_CHANGES', 'COMMENT']).describe("The review action to perform"),
115-
comments: z.array(z.object({
116-
path: z.string().describe("The relative path to the file being commented on"),
117-
position: z.number().describe("The position in the diff where you want to add a review comment"),
118-
body: z.string().describe("Text of the review comment")
119-
})).optional().describe("Comments to post as part of the review")
115+
comments: z.array(
116+
z.union([
117+
z.object({
118+
path: z.string().describe("The relative path to the file being commented on"),
119+
position: z.number().describe("The position in the diff where you want to add a review comment"),
120+
body: z.string().describe("Text of the review comment")
121+
}),
122+
z.object({
123+
path: z.string().describe("The relative path to the file being commented on"),
124+
line: z.number().describe("The line number in the file where you want to add a review comment"),
125+
body: z.string().describe("Text of the review comment")
126+
})
127+
])
128+
).optional().describe("Comments to post as part of the review (specify either position or line, not both)")
120129
});
121130

122131
export const MergePullRequestSchema = z.object({

0 commit comments

Comments
 (0)