@@ -100,6 +100,51 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
100
100
description : "Create a new pull request in a GitHub repository" ,
101
101
inputSchema : zodToJsonSchema ( pulls . CreatePullRequestSchema ) ,
102
102
} ,
103
+ {
104
+ name : "get_pull_request" ,
105
+ description : "Get details of a specific pull request" ,
106
+ inputSchema : zodToJsonSchema ( pulls . GetPullRequestSchema ) ,
107
+ } ,
108
+ {
109
+ name : "list_pull_requests" ,
110
+ description : "List and filter repository pull requests" ,
111
+ inputSchema : zodToJsonSchema ( pulls . ListPullRequestsSchema ) ,
112
+ } ,
113
+ {
114
+ name : "create_pull_request_review" ,
115
+ description : "Create a review on a pull request" ,
116
+ inputSchema : zodToJsonSchema ( pulls . CreatePullRequestReviewSchema ) ,
117
+ } ,
118
+ {
119
+ name : "merge_pull_request" ,
120
+ description : "Merge a pull request" ,
121
+ inputSchema : zodToJsonSchema ( pulls . MergePullRequestSchema ) ,
122
+ } ,
123
+ {
124
+ name : "get_pull_request_files" ,
125
+ description : "Get the list of files changed in a pull request" ,
126
+ inputSchema : zodToJsonSchema ( pulls . GetPullRequestFilesSchema ) ,
127
+ } ,
128
+ {
129
+ name : "get_pull_request_status" ,
130
+ description : "Get the combined status of all status checks for a pull request" ,
131
+ inputSchema : zodToJsonSchema ( pulls . GetPullRequestStatusSchema ) ,
132
+ } ,
133
+ {
134
+ name : "update_pull_request_branch" ,
135
+ description : "Update a pull request branch with the latest changes from the base branch" ,
136
+ inputSchema : zodToJsonSchema ( pulls . UpdatePullRequestBranchSchema ) ,
137
+ } ,
138
+ {
139
+ name : "get_pull_request_comments" ,
140
+ description : "Get the review comments on a pull request" ,
141
+ inputSchema : zodToJsonSchema ( pulls . GetPullRequestCommentsSchema ) ,
142
+ } ,
143
+ {
144
+ name : "get_pull_request_reviews" ,
145
+ description : "Get the reviews on a pull request" ,
146
+ inputSchema : zodToJsonSchema ( pulls . GetPullRequestReviewsSchema ) ,
147
+ } ,
103
148
{
104
149
name : "fork_repository" ,
105
150
description : "Fork a GitHub repository to your account or specified organization" ,
@@ -149,51 +194,6 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
149
194
name : "get_issue" ,
150
195
description : "Get details of a specific issue in a GitHub repository." ,
151
196
inputSchema : zodToJsonSchema ( issues . GetIssueSchema )
152
- } ,
153
- {
154
- name : "get_pull_request" ,
155
- description : "Get details of a specific pull request" ,
156
- inputSchema : zodToJsonSchema ( pulls . GetPullRequestSchema ) ,
157
- } ,
158
- {
159
- name : "list_pull_requests" ,
160
- description : "List and filter repository pull requests" ,
161
- inputSchema : zodToJsonSchema ( pulls . ListPullRequestsSchema ) ,
162
- } ,
163
- {
164
- name : "create_pull_request_review" ,
165
- description : "Create a review on a pull request" ,
166
- inputSchema : zodToJsonSchema ( pulls . CreatePullRequestReviewSchema ) ,
167
- } ,
168
- {
169
- name : "merge_pull_request" ,
170
- description : "Merge a pull request" ,
171
- inputSchema : zodToJsonSchema ( pulls . MergePullRequestSchema ) ,
172
- } ,
173
- {
174
- name : "get_pull_request_files" ,
175
- description : "Get the list of files changed in a pull request" ,
176
- inputSchema : zodToJsonSchema ( pulls . GetPullRequestFilesSchema ) ,
177
- } ,
178
- {
179
- name : "get_pull_request_status" ,
180
- description : "Get the combined status of all status checks for a pull request" ,
181
- inputSchema : zodToJsonSchema ( pulls . GetPullRequestStatusSchema ) ,
182
- } ,
183
- {
184
- name : "update_pull_request_branch" ,
185
- description : "Update a pull request branch with the latest changes from the base branch" ,
186
- inputSchema : zodToJsonSchema ( pulls . UpdatePullRequestBranchSchema ) ,
187
- } ,
188
- {
189
- name : "get_pull_request_comments" ,
190
- description : "Get the review comments on a pull request" ,
191
- inputSchema : zodToJsonSchema ( pulls . GetPullRequestCommentsSchema ) ,
192
- } ,
193
- {
194
- name : "get_pull_request_reviews" ,
195
- description : "Get the reviews on a pull request" ,
196
- inputSchema : zodToJsonSchema ( pulls . GetPullRequestReviewsSchema ) ,
197
197
}
198
198
] ,
199
199
} ;
@@ -307,79 +307,6 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
307
307
} ;
308
308
}
309
309
310
- case "search_code" : {
311
- const args = search . SearchCodeSchema . parse ( request . params . arguments ) ;
312
- const results = await search . searchCode ( args ) ;
313
- return {
314
- content : [ { type : "text" , text : JSON . stringify ( results , null , 2 ) } ] ,
315
- } ;
316
- }
317
-
318
- case "search_issues" : {
319
- const args = search . SearchIssuesSchema . parse ( request . params . arguments ) ;
320
- const results = await search . searchIssues ( args ) ;
321
- return {
322
- content : [ { type : "text" , text : JSON . stringify ( results , null , 2 ) } ] ,
323
- } ;
324
- }
325
-
326
- case "search_users" : {
327
- const args = search . SearchUsersSchema . parse ( request . params . arguments ) ;
328
- const results = await search . searchUsers ( args ) ;
329
- return {
330
- content : [ { type : "text" , text : JSON . stringify ( results , null , 2 ) } ] ,
331
- } ;
332
- }
333
-
334
- case "list_issues" : {
335
- const args = issues . ListIssuesOptionsSchema . parse ( request . params . arguments ) ;
336
- const { owner, repo, ...options } = args ;
337
- const result = await issues . listIssues ( owner , repo , options ) ;
338
- return {
339
- content : [ { type : "text" , text : JSON . stringify ( result , null , 2 ) } ] ,
340
- } ;
341
- }
342
-
343
- case "update_issue" : {
344
- const args = issues . UpdateIssueOptionsSchema . parse ( request . params . arguments ) ;
345
- const { owner, repo, issue_number, ...options } = args ;
346
- const result = await issues . updateIssue ( owner , repo , issue_number , options ) ;
347
- return {
348
- content : [ { type : "text" , text : JSON . stringify ( result , null , 2 ) } ] ,
349
- } ;
350
- }
351
-
352
- case "add_issue_comment" : {
353
- const args = issues . IssueCommentSchema . parse ( request . params . arguments ) ;
354
- const { owner, repo, issue_number, body } = args ;
355
- const result = await issues . addIssueComment ( owner , repo , issue_number , body ) ;
356
- return {
357
- content : [ { type : "text" , text : JSON . stringify ( result , null , 2 ) } ] ,
358
- } ;
359
- }
360
-
361
- case "list_commits" : {
362
- const args = commits . ListCommitsSchema . parse ( request . params . arguments ) ;
363
- const results = await commits . listCommits (
364
- args . owner ,
365
- args . repo ,
366
- args . page ,
367
- args . perPage ,
368
- args . sha
369
- ) ;
370
- return {
371
- content : [ { type : "text" , text : JSON . stringify ( results , null , 2 ) } ] ,
372
- } ;
373
- }
374
-
375
- case "get_issue" : {
376
- const args = issues . GetIssueSchema . parse ( request . params . arguments ) ;
377
- const issue = await issues . getIssue ( args . owner , args . repo , args . issue_number ) ;
378
- return {
379
- content : [ { type : "text" , text : JSON . stringify ( issue , null , 2 ) } ] ,
380
- } ;
381
- }
382
-
383
310
case "get_pull_request" : {
384
311
const args = pulls . GetPullRequestSchema . parse ( request . params . arguments ) ;
385
312
const pullRequest = await pulls . getPullRequest ( args . owner , args . repo , args . pull_number ) ;
@@ -460,6 +387,79 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
460
387
} ;
461
388
}
462
389
390
+ case "search_code" : {
391
+ const args = search . SearchCodeSchema . parse ( request . params . arguments ) ;
392
+ const results = await search . searchCode ( args ) ;
393
+ return {
394
+ content : [ { type : "text" , text : JSON . stringify ( results , null , 2 ) } ] ,
395
+ } ;
396
+ }
397
+
398
+ case "search_issues" : {
399
+ const args = search . SearchIssuesSchema . parse ( request . params . arguments ) ;
400
+ const results = await search . searchIssues ( args ) ;
401
+ return {
402
+ content : [ { type : "text" , text : JSON . stringify ( results , null , 2 ) } ] ,
403
+ } ;
404
+ }
405
+
406
+ case "search_users" : {
407
+ const args = search . SearchUsersSchema . parse ( request . params . arguments ) ;
408
+ const results = await search . searchUsers ( args ) ;
409
+ return {
410
+ content : [ { type : "text" , text : JSON . stringify ( results , null , 2 ) } ] ,
411
+ } ;
412
+ }
413
+
414
+ case "list_issues" : {
415
+ const args = issues . ListIssuesOptionsSchema . parse ( request . params . arguments ) ;
416
+ const { owner, repo, ...options } = args ;
417
+ const result = await issues . listIssues ( owner , repo , options ) ;
418
+ return {
419
+ content : [ { type : "text" , text : JSON . stringify ( result , null , 2 ) } ] ,
420
+ } ;
421
+ }
422
+
423
+ case "update_issue" : {
424
+ const args = issues . UpdateIssueOptionsSchema . parse ( request . params . arguments ) ;
425
+ const { owner, repo, issue_number, ...options } = args ;
426
+ const result = await issues . updateIssue ( owner , repo , issue_number , options ) ;
427
+ return {
428
+ content : [ { type : "text" , text : JSON . stringify ( result , null , 2 ) } ] ,
429
+ } ;
430
+ }
431
+
432
+ case "add_issue_comment" : {
433
+ const args = issues . IssueCommentSchema . parse ( request . params . arguments ) ;
434
+ const { owner, repo, issue_number, body } = args ;
435
+ const result = await issues . addIssueComment ( owner , repo , issue_number , body ) ;
436
+ return {
437
+ content : [ { type : "text" , text : JSON . stringify ( result , null , 2 ) } ] ,
438
+ } ;
439
+ }
440
+
441
+ case "list_commits" : {
442
+ const args = commits . ListCommitsSchema . parse ( request . params . arguments ) ;
443
+ const results = await commits . listCommits (
444
+ args . owner ,
445
+ args . repo ,
446
+ args . page ,
447
+ args . perPage ,
448
+ args . sha
449
+ ) ;
450
+ return {
451
+ content : [ { type : "text" , text : JSON . stringify ( results , null , 2 ) } ] ,
452
+ } ;
453
+ }
454
+
455
+ case "get_issue" : {
456
+ const args = issues . GetIssueSchema . parse ( request . params . arguments ) ;
457
+ const issue = await issues . getIssue ( args . owner , args . repo , args . issue_number ) ;
458
+ return {
459
+ content : [ { type : "text" , text : JSON . stringify ( issue , null , 2 ) } ] ,
460
+ } ;
461
+ }
462
+
463
463
default :
464
464
throw new Error ( `Unknown tool: ${ request . params . name } ` ) ;
465
465
}
0 commit comments