@ldraney/github-mcp 0.1.0 → 0.2.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/dist/index.js +8 -2
  2. package/dist/prompts/activity-summary.d.ts +10 -0
  3. package/dist/prompts/activity-summary.js +154 -0
  4. package/dist/prompts/code-review.d.ts +9 -0
  5. package/dist/prompts/code-review.js +145 -0
  6. package/dist/prompts/issue-triage.d.ts +9 -0
  7. package/dist/prompts/issue-triage.js +202 -0
  8. package/dist/prompts/release-notes.d.ts +9 -0
  9. package/dist/prompts/release-notes.js +236 -0
  10. package/dist/server.d.ts +8 -1
  11. package/dist/server.js +36 -210
  12. package/dist/tools/categories/actions.d.ts +2 -5
  13. package/dist/tools/categories/actions.js +640 -369
  14. package/dist/tools/categories/activity.d.ts +2 -0
  15. package/dist/tools/categories/activity.js +534 -0
  16. package/dist/tools/categories/apps.d.ts +2 -0
  17. package/dist/tools/categories/apps.js +224 -0
  18. package/dist/tools/categories/billing.d.ts +2 -0
  19. package/dist/tools/categories/billing.js +145 -0
  20. package/dist/tools/categories/checks.d.ts +2 -0
  21. package/dist/tools/categories/checks.js +554 -0
  22. package/dist/tools/categories/codeScanning.d.ts +2 -0
  23. package/dist/tools/categories/codeScanning.js +375 -0
  24. package/dist/tools/categories/codeSecurity.d.ts +2 -0
  25. package/dist/tools/categories/codeSecurity.js +463 -0
  26. package/dist/tools/categories/codesOfConduct.d.ts +2 -0
  27. package/dist/tools/categories/codesOfConduct.js +45 -0
  28. package/dist/tools/categories/codespaces.d.ts +2 -0
  29. package/dist/tools/categories/codespaces.js +259 -0
  30. package/dist/tools/categories/copilot.d.ts +2 -0
  31. package/dist/tools/categories/copilot.js +187 -0
  32. package/dist/tools/categories/dependabot.d.ts +2 -0
  33. package/dist/tools/categories/dependabot.js +454 -0
  34. package/dist/tools/categories/emojis.d.ts +2 -0
  35. package/dist/tools/categories/emojis.js +22 -0
  36. package/dist/tools/categories/gists.d.ts +2 -5
  37. package/dist/tools/categories/gists.js +474 -285
  38. package/dist/tools/categories/git.d.ts +2 -0
  39. package/dist/tools/categories/git.js +520 -0
  40. package/dist/tools/categories/gitignore.d.ts +2 -0
  41. package/dist/tools/categories/gitignore.js +45 -0
  42. package/dist/tools/categories/index.d.ts +33 -0
  43. package/dist/tools/categories/index.js +33 -0
  44. package/dist/tools/categories/interactions.d.ts +2 -0
  45. package/dist/tools/categories/interactions.js +184 -0
  46. package/dist/tools/categories/issues.d.ts +2 -5
  47. package/dist/tools/categories/issues.js +692 -390
  48. package/dist/tools/categories/licenses.d.ts +2 -0
  49. package/dist/tools/categories/licenses.js +95 -0
  50. package/dist/tools/categories/markdown.d.ts +2 -0
  51. package/dist/tools/categories/markdown.js +64 -0
  52. package/dist/tools/categories/meta.d.ts +2 -0
  53. package/dist/tools/categories/meta.js +74 -0
  54. package/dist/tools/categories/migrations.d.ts +2 -0
  55. package/dist/tools/categories/migrations.js +290 -0
  56. package/dist/tools/categories/orgs.d.ts +2 -5
  57. package/dist/tools/categories/orgs.js +585 -417
  58. package/dist/tools/categories/packages.d.ts +2 -0
  59. package/dist/tools/categories/packages.js +918 -0
  60. package/dist/tools/categories/projects.d.ts +2 -0
  61. package/dist/tools/categories/projects.js +692 -0
  62. package/dist/tools/categories/pulls.d.ts +2 -5
  63. package/dist/tools/categories/pulls.js +715 -332
  64. package/dist/tools/categories/rateLimit.d.ts +2 -0
  65. package/dist/tools/categories/rateLimit.js +22 -0
  66. package/dist/tools/categories/reactions.d.ts +2 -0
  67. package/dist/tools/categories/reactions.js +385 -0
  68. package/dist/tools/categories/repos.d.ts +2 -5
  69. package/dist/tools/categories/repos.js +844 -366
  70. package/dist/tools/categories/search.d.ts +2 -5
  71. package/dist/tools/categories/search.js +294 -196
  72. package/dist/tools/categories/secretScanning.d.ts +2 -0
  73. package/dist/tools/categories/secretScanning.js +324 -0
  74. package/dist/tools/categories/securityAdvisories.d.ts +2 -0
  75. package/dist/tools/categories/securityAdvisories.js +407 -0
  76. package/dist/tools/categories/teams.d.ts +2 -0
  77. package/dist/tools/categories/teams.js +614 -0
  78. package/dist/tools/categories/users.d.ts +2 -5
  79. package/dist/tools/categories/users.js +474 -247
  80. package/dist/tools/generator.d.ts +35 -15
  81. package/dist/tools/generator.js +113 -57
  82. package/dist/tools/types.d.ts +63 -0
  83. package/dist/tools/types.js +17 -0
  84. package/package.json +1 -1
@@ -1,425 +1,727 @@
1
- export const issuesTools = [
2
- {
3
- name: 'github_issues_list',
4
- description: 'List issues assigned to the authenticated user',
5
- inputSchema: {
6
- type: 'object',
7
- properties: {
8
- filter: {
9
- type: 'string',
10
- enum: ['assigned', 'created', 'mentioned', 'subscribed', 'repos', 'all'],
11
- description: 'Filter by relationship to authenticated user',
1
+ import { successResult } from '../types.js';
2
+ export const issuesCategory = {
3
+ name: 'issues',
4
+ description: 'Issue management tools',
5
+ tools: [
6
+ // list - List issues for a repository
7
+ {
8
+ definition: {
9
+ name: 'github_issues_list',
10
+ description: 'List issues for a repository',
11
+ inputSchema: {
12
+ type: 'object',
13
+ properties: {
14
+ owner: {
15
+ type: 'string',
16
+ description: 'Repository owner',
17
+ },
18
+ repo: {
19
+ type: 'string',
20
+ description: 'Repository name',
21
+ },
22
+ state: {
23
+ type: 'string',
24
+ enum: ['open', 'closed', 'all'],
25
+ description: 'Issue state filter',
26
+ },
27
+ labels: {
28
+ type: 'string',
29
+ description: 'Comma-separated list of label names',
30
+ },
31
+ sort: {
32
+ type: 'string',
33
+ enum: ['created', 'updated', 'comments'],
34
+ description: 'Sort field',
35
+ },
36
+ direction: {
37
+ type: 'string',
38
+ enum: ['asc', 'desc'],
39
+ description: 'Sort direction',
40
+ },
41
+ per_page: {
42
+ type: 'number',
43
+ description: 'Results per page (max 100)',
44
+ },
45
+ page: {
46
+ type: 'number',
47
+ description: 'Page number',
48
+ },
49
+ },
50
+ required: ['owner', 'repo'],
12
51
  },
13
- state: {
14
- type: 'string',
15
- enum: ['open', 'closed', 'all'],
16
- description: 'Filter by state',
17
- },
18
- labels: {
19
- type: 'string',
20
- description: 'Comma-separated list of label names',
21
- },
22
- sort: {
23
- type: 'string',
24
- enum: ['created', 'updated', 'comments'],
25
- },
26
- direction: {
27
- type: 'string',
28
- enum: ['asc', 'desc'],
29
- },
30
- since: {
31
- type: 'string',
32
- description: 'ISO 8601 date - only issues updated after this',
33
- },
34
- per_page: { type: 'number' },
35
- page: { type: 'number' },
52
+ },
53
+ handler: async (octokit, args) => {
54
+ const { data } = await octokit.issues.listForRepo({
55
+ owner: args.owner,
56
+ repo: args.repo,
57
+ state: args.state,
58
+ labels: args.labels,
59
+ sort: args.sort,
60
+ direction: args.direction,
61
+ per_page: args.per_page,
62
+ page: args.page,
63
+ });
64
+ return successResult(data);
36
65
  },
37
66
  },
38
- },
39
- {
40
- name: 'github_issues_listForRepo',
41
- description: 'List issues for a repository',
42
- inputSchema: {
43
- type: 'object',
44
- properties: {
45
- owner: { type: 'string', description: 'Repository owner' },
46
- repo: { type: 'string', description: 'Repository name' },
47
- milestone: { type: 'string', description: 'Milestone number or "*" or "none"' },
48
- state: {
49
- type: 'string',
50
- enum: ['open', 'closed', 'all'],
67
+ // list_for_user - List issues assigned to the authenticated user
68
+ {
69
+ definition: {
70
+ name: 'github_issues_list_for_user',
71
+ description: 'List issues assigned to the authenticated user',
72
+ inputSchema: {
73
+ type: 'object',
74
+ properties: {
75
+ filter: {
76
+ type: 'string',
77
+ enum: ['assigned', 'created', 'mentioned', 'subscribed', 'repos', 'all'],
78
+ description: 'Filter type',
79
+ },
80
+ state: {
81
+ type: 'string',
82
+ enum: ['open', 'closed', 'all'],
83
+ description: 'Issue state filter',
84
+ },
85
+ labels: {
86
+ type: 'string',
87
+ description: 'Comma-separated list of label names',
88
+ },
89
+ sort: {
90
+ type: 'string',
91
+ enum: ['created', 'updated', 'comments'],
92
+ description: 'Sort field',
93
+ },
94
+ direction: {
95
+ type: 'string',
96
+ enum: ['asc', 'desc'],
97
+ description: 'Sort direction',
98
+ },
99
+ per_page: {
100
+ type: 'number',
101
+ description: 'Results per page (max 100)',
102
+ },
103
+ page: {
104
+ type: 'number',
105
+ description: 'Page number',
106
+ },
107
+ },
51
108
  },
52
- assignee: { type: 'string', description: 'Username, "*" for any, "none" for unassigned' },
53
- creator: { type: 'string', description: 'Username of issue creator' },
54
- mentioned: { type: 'string', description: 'Username mentioned in issue' },
55
- labels: { type: 'string', description: 'Comma-separated label names' },
56
- sort: {
57
- type: 'string',
58
- enum: ['created', 'updated', 'comments'],
59
- },
60
- direction: {
61
- type: 'string',
62
- enum: ['asc', 'desc'],
63
- },
64
- since: { type: 'string', description: 'ISO 8601 date' },
65
- per_page: { type: 'number' },
66
- page: { type: 'number' },
67
109
  },
68
- required: ['owner', 'repo'],
69
- },
70
- },
71
- {
72
- name: 'github_issues_get',
73
- description: 'Get a specific issue',
74
- inputSchema: {
75
- type: 'object',
76
- properties: {
77
- owner: { type: 'string', description: 'Repository owner' },
78
- repo: { type: 'string', description: 'Repository name' },
79
- issue_number: { type: 'number', description: 'Issue number' },
80
- },
81
- required: ['owner', 'repo', 'issue_number'],
110
+ handler: async (octokit, args) => {
111
+ const { data } = await octokit.issues.list({
112
+ filter: args.filter,
113
+ state: args.state,
114
+ labels: args.labels,
115
+ sort: args.sort,
116
+ direction: args.direction,
117
+ per_page: args.per_page,
118
+ page: args.page,
119
+ });
120
+ return successResult(data);
121
+ },
82
122
  },
83
- },
84
- {
85
- name: 'github_issues_create',
86
- description: 'Create an issue',
87
- inputSchema: {
88
- type: 'object',
89
- properties: {
90
- owner: { type: 'string', description: 'Repository owner' },
91
- repo: { type: 'string', description: 'Repository name' },
92
- title: { type: 'string', description: 'Issue title' },
93
- body: { type: 'string', description: 'Issue body/description' },
94
- assignees: {
95
- type: 'array',
96
- items: { type: 'string' },
97
- description: 'Usernames to assign',
98
- },
99
- milestone: { type: 'number', description: 'Milestone number' },
100
- labels: {
101
- type: 'array',
102
- items: { type: 'string' },
103
- description: 'Label names',
123
+ // get - Get an issue
124
+ {
125
+ definition: {
126
+ name: 'github_issues_get',
127
+ description: 'Get an issue by number',
128
+ inputSchema: {
129
+ type: 'object',
130
+ properties: {
131
+ owner: {
132
+ type: 'string',
133
+ description: 'Repository owner',
134
+ },
135
+ repo: {
136
+ type: 'string',
137
+ description: 'Repository name',
138
+ },
139
+ issue_number: {
140
+ type: 'number',
141
+ description: 'Issue number',
142
+ },
143
+ },
144
+ required: ['owner', 'repo', 'issue_number'],
104
145
  },
105
146
  },
106
- required: ['owner', 'repo', 'title'],
147
+ handler: async (octokit, args) => {
148
+ const { data } = await octokit.issues.get({
149
+ owner: args.owner,
150
+ repo: args.repo,
151
+ issue_number: args.issue_number,
152
+ });
153
+ return successResult(data);
154
+ },
107
155
  },
108
- },
109
- {
110
- name: 'github_issues_update',
111
- description: 'Update an issue',
112
- inputSchema: {
113
- type: 'object',
114
- properties: {
115
- owner: { type: 'string', description: 'Repository owner' },
116
- repo: { type: 'string', description: 'Repository name' },
117
- issue_number: { type: 'number', description: 'Issue number' },
118
- title: { type: 'string', description: 'Issue title' },
119
- body: { type: 'string', description: 'Issue body' },
120
- state: {
121
- type: 'string',
122
- enum: ['open', 'closed'],
123
- },
124
- state_reason: {
125
- type: 'string',
126
- enum: ['completed', 'not_planned', 'reopened'],
127
- },
128
- assignees: {
129
- type: 'array',
130
- items: { type: 'string' },
131
- },
132
- milestone: { type: 'number' },
133
- labels: {
134
- type: 'array',
135
- items: { type: 'string' },
156
+ // create - Create an issue
157
+ {
158
+ definition: {
159
+ name: 'github_issues_create',
160
+ description: 'Create a new issue',
161
+ inputSchema: {
162
+ type: 'object',
163
+ properties: {
164
+ owner: {
165
+ type: 'string',
166
+ description: 'Repository owner',
167
+ },
168
+ repo: {
169
+ type: 'string',
170
+ description: 'Repository name',
171
+ },
172
+ title: {
173
+ type: 'string',
174
+ description: 'Issue title',
175
+ },
176
+ body: {
177
+ type: 'string',
178
+ description: 'Issue body',
179
+ },
180
+ labels: {
181
+ type: 'array',
182
+ items: { type: 'string' },
183
+ description: 'Labels to add',
184
+ },
185
+ assignees: {
186
+ type: 'array',
187
+ items: { type: 'string' },
188
+ description: 'Usernames to assign',
189
+ },
190
+ milestone: {
191
+ type: 'number',
192
+ description: 'Milestone number',
193
+ },
194
+ },
195
+ required: ['owner', 'repo', 'title'],
136
196
  },
137
197
  },
138
- required: ['owner', 'repo', 'issue_number'],
139
- },
140
- },
141
- {
142
- name: 'github_issues_listComments',
143
- description: 'List comments on an issue',
144
- inputSchema: {
145
- type: 'object',
146
- properties: {
147
- owner: { type: 'string', description: 'Repository owner' },
148
- repo: { type: 'string', description: 'Repository name' },
149
- issue_number: { type: 'number', description: 'Issue number' },
150
- since: { type: 'string', description: 'ISO 8601 date' },
151
- per_page: { type: 'number' },
152
- page: { type: 'number' },
153
- },
154
- required: ['owner', 'repo', 'issue_number'],
198
+ handler: async (octokit, args) => {
199
+ const { data } = await octokit.issues.create({
200
+ owner: args.owner,
201
+ repo: args.repo,
202
+ title: args.title,
203
+ body: args.body,
204
+ labels: args.labels,
205
+ assignees: args.assignees,
206
+ milestone: args.milestone,
207
+ });
208
+ return successResult(data);
209
+ },
155
210
  },
156
- },
157
- {
158
- name: 'github_issues_createComment',
159
- description: 'Create a comment on an issue',
160
- inputSchema: {
161
- type: 'object',
162
- properties: {
163
- owner: { type: 'string', description: 'Repository owner' },
164
- repo: { type: 'string', description: 'Repository name' },
165
- issue_number: { type: 'number', description: 'Issue number' },
166
- body: { type: 'string', description: 'Comment body' },
167
- },
168
- required: ['owner', 'repo', 'issue_number', 'body'],
211
+ // update - Update an issue
212
+ {
213
+ definition: {
214
+ name: 'github_issues_update',
215
+ description: 'Update an issue',
216
+ inputSchema: {
217
+ type: 'object',
218
+ properties: {
219
+ owner: {
220
+ type: 'string',
221
+ description: 'Repository owner',
222
+ },
223
+ repo: {
224
+ type: 'string',
225
+ description: 'Repository name',
226
+ },
227
+ issue_number: {
228
+ type: 'number',
229
+ description: 'Issue number',
230
+ },
231
+ title: {
232
+ type: 'string',
233
+ description: 'Issue title',
234
+ },
235
+ body: {
236
+ type: 'string',
237
+ description: 'Issue body',
238
+ },
239
+ state: {
240
+ type: 'string',
241
+ enum: ['open', 'closed'],
242
+ description: 'Issue state',
243
+ },
244
+ labels: {
245
+ type: 'array',
246
+ items: { type: 'string' },
247
+ description: 'Labels to set',
248
+ },
249
+ assignees: {
250
+ type: 'array',
251
+ items: { type: 'string' },
252
+ description: 'Usernames to assign',
253
+ },
254
+ milestone: {
255
+ type: 'number',
256
+ description: 'Milestone number',
257
+ },
258
+ },
259
+ required: ['owner', 'repo', 'issue_number'],
260
+ },
261
+ },
262
+ handler: async (octokit, args) => {
263
+ const { data } = await octokit.issues.update({
264
+ owner: args.owner,
265
+ repo: args.repo,
266
+ issue_number: args.issue_number,
267
+ title: args.title,
268
+ body: args.body,
269
+ state: args.state,
270
+ labels: args.labels,
271
+ assignees: args.assignees,
272
+ milestone: args.milestone,
273
+ });
274
+ return successResult(data);
275
+ },
169
276
  },
170
- },
171
- {
172
- name: 'github_issues_updateComment',
173
- description: 'Update a comment on an issue',
174
- inputSchema: {
175
- type: 'object',
176
- properties: {
177
- owner: { type: 'string', description: 'Repository owner' },
178
- repo: { type: 'string', description: 'Repository name' },
179
- comment_id: { type: 'number', description: 'Comment ID' },
180
- body: { type: 'string', description: 'New comment body' },
181
- },
182
- required: ['owner', 'repo', 'comment_id', 'body'],
277
+ // lock - Lock an issue
278
+ {
279
+ definition: {
280
+ name: 'github_issues_lock',
281
+ description: 'Lock an issue',
282
+ inputSchema: {
283
+ type: 'object',
284
+ properties: {
285
+ owner: {
286
+ type: 'string',
287
+ description: 'Repository owner',
288
+ },
289
+ repo: {
290
+ type: 'string',
291
+ description: 'Repository name',
292
+ },
293
+ issue_number: {
294
+ type: 'number',
295
+ description: 'Issue number',
296
+ },
297
+ lock_reason: {
298
+ type: 'string',
299
+ enum: ['off-topic', 'too heated', 'resolved', 'spam'],
300
+ description: 'Reason for locking',
301
+ },
302
+ },
303
+ required: ['owner', 'repo', 'issue_number'],
304
+ },
305
+ },
306
+ handler: async (octokit, args) => {
307
+ await octokit.issues.lock({
308
+ owner: args.owner,
309
+ repo: args.repo,
310
+ issue_number: args.issue_number,
311
+ lock_reason: args.lock_reason,
312
+ });
313
+ return successResult({ success: true, message: 'Issue locked' });
314
+ },
183
315
  },
184
- },
185
- {
186
- name: 'github_issues_deleteComment',
187
- description: 'Delete a comment on an issue',
188
- inputSchema: {
189
- type: 'object',
190
- properties: {
191
- owner: { type: 'string', description: 'Repository owner' },
192
- repo: { type: 'string', description: 'Repository name' },
193
- comment_id: { type: 'number', description: 'Comment ID' },
194
- },
195
- required: ['owner', 'repo', 'comment_id'],
316
+ // unlock - Unlock an issue
317
+ {
318
+ definition: {
319
+ name: 'github_issues_unlock',
320
+ description: 'Unlock an issue',
321
+ inputSchema: {
322
+ type: 'object',
323
+ properties: {
324
+ owner: {
325
+ type: 'string',
326
+ description: 'Repository owner',
327
+ },
328
+ repo: {
329
+ type: 'string',
330
+ description: 'Repository name',
331
+ },
332
+ issue_number: {
333
+ type: 'number',
334
+ description: 'Issue number',
335
+ },
336
+ },
337
+ required: ['owner', 'repo', 'issue_number'],
338
+ },
339
+ },
340
+ handler: async (octokit, args) => {
341
+ await octokit.issues.unlock({
342
+ owner: args.owner,
343
+ repo: args.repo,
344
+ issue_number: args.issue_number,
345
+ });
346
+ return successResult({ success: true, message: 'Issue unlocked' });
347
+ },
196
348
  },
197
- },
198
- {
199
- name: 'github_issues_listLabels',
200
- description: 'List labels for a repository',
201
- inputSchema: {
202
- type: 'object',
203
- properties: {
204
- owner: { type: 'string', description: 'Repository owner' },
205
- repo: { type: 'string', description: 'Repository name' },
206
- per_page: { type: 'number' },
207
- page: { type: 'number' },
208
- },
209
- required: ['owner', 'repo'],
349
+ // list_comments - List comments on an issue
350
+ {
351
+ definition: {
352
+ name: 'github_issues_list_comments',
353
+ description: 'List comments on an issue',
354
+ inputSchema: {
355
+ type: 'object',
356
+ properties: {
357
+ owner: {
358
+ type: 'string',
359
+ description: 'Repository owner',
360
+ },
361
+ repo: {
362
+ type: 'string',
363
+ description: 'Repository name',
364
+ },
365
+ issue_number: {
366
+ type: 'number',
367
+ description: 'Issue number',
368
+ },
369
+ per_page: {
370
+ type: 'number',
371
+ description: 'Results per page (max 100)',
372
+ },
373
+ page: {
374
+ type: 'number',
375
+ description: 'Page number',
376
+ },
377
+ },
378
+ required: ['owner', 'repo', 'issue_number'],
379
+ },
380
+ },
381
+ handler: async (octokit, args) => {
382
+ const { data } = await octokit.issues.listComments({
383
+ owner: args.owner,
384
+ repo: args.repo,
385
+ issue_number: args.issue_number,
386
+ per_page: args.per_page,
387
+ page: args.page,
388
+ });
389
+ return successResult(data);
390
+ },
210
391
  },
211
- },
212
- {
213
- name: 'github_issues_createLabel',
214
- description: 'Create a label',
215
- inputSchema: {
216
- type: 'object',
217
- properties: {
218
- owner: { type: 'string', description: 'Repository owner' },
219
- repo: { type: 'string', description: 'Repository name' },
220
- name: { type: 'string', description: 'Label name' },
221
- color: { type: 'string', description: 'Hex color code (without #)' },
222
- description: { type: 'string', description: 'Label description' },
223
- },
224
- required: ['owner', 'repo', 'name', 'color'],
392
+ // get_comment - Get a comment
393
+ {
394
+ definition: {
395
+ name: 'github_issues_get_comment',
396
+ description: 'Get a comment by ID',
397
+ inputSchema: {
398
+ type: 'object',
399
+ properties: {
400
+ owner: {
401
+ type: 'string',
402
+ description: 'Repository owner',
403
+ },
404
+ repo: {
405
+ type: 'string',
406
+ description: 'Repository name',
407
+ },
408
+ comment_id: {
409
+ type: 'number',
410
+ description: 'Comment ID',
411
+ },
412
+ },
413
+ required: ['owner', 'repo', 'comment_id'],
414
+ },
415
+ },
416
+ handler: async (octokit, args) => {
417
+ const { data } = await octokit.issues.getComment({
418
+ owner: args.owner,
419
+ repo: args.repo,
420
+ comment_id: args.comment_id,
421
+ });
422
+ return successResult(data);
423
+ },
225
424
  },
226
- },
227
- {
228
- name: 'github_issues_addLabels',
229
- description: 'Add labels to an issue',
230
- inputSchema: {
231
- type: 'object',
232
- properties: {
233
- owner: { type: 'string', description: 'Repository owner' },
234
- repo: { type: 'string', description: 'Repository name' },
235
- issue_number: { type: 'number', description: 'Issue number' },
236
- labels: {
237
- type: 'array',
238
- items: { type: 'string' },
239
- description: 'Label names to add',
425
+ // create_comment - Create a comment
426
+ {
427
+ definition: {
428
+ name: 'github_issues_create_comment',
429
+ description: 'Create a comment on an issue',
430
+ inputSchema: {
431
+ type: 'object',
432
+ properties: {
433
+ owner: {
434
+ type: 'string',
435
+ description: 'Repository owner',
436
+ },
437
+ repo: {
438
+ type: 'string',
439
+ description: 'Repository name',
440
+ },
441
+ issue_number: {
442
+ type: 'number',
443
+ description: 'Issue number',
444
+ },
445
+ body: {
446
+ type: 'string',
447
+ description: 'Comment body',
448
+ },
449
+ },
450
+ required: ['owner', 'repo', 'issue_number', 'body'],
240
451
  },
241
452
  },
242
- required: ['owner', 'repo', 'issue_number', 'labels'],
453
+ handler: async (octokit, args) => {
454
+ const { data } = await octokit.issues.createComment({
455
+ owner: args.owner,
456
+ repo: args.repo,
457
+ issue_number: args.issue_number,
458
+ body: args.body,
459
+ });
460
+ return successResult(data);
461
+ },
243
462
  },
244
- },
245
- {
246
- name: 'github_issues_removeLabel',
247
- description: 'Remove a label from an issue',
248
- inputSchema: {
249
- type: 'object',
250
- properties: {
251
- owner: { type: 'string', description: 'Repository owner' },
252
- repo: { type: 'string', description: 'Repository name' },
253
- issue_number: { type: 'number', description: 'Issue number' },
254
- name: { type: 'string', description: 'Label name to remove' },
255
- },
256
- required: ['owner', 'repo', 'issue_number', 'name'],
463
+ // update_comment - Update a comment
464
+ {
465
+ definition: {
466
+ name: 'github_issues_update_comment',
467
+ description: 'Update a comment',
468
+ inputSchema: {
469
+ type: 'object',
470
+ properties: {
471
+ owner: {
472
+ type: 'string',
473
+ description: 'Repository owner',
474
+ },
475
+ repo: {
476
+ type: 'string',
477
+ description: 'Repository name',
478
+ },
479
+ comment_id: {
480
+ type: 'number',
481
+ description: 'Comment ID',
482
+ },
483
+ body: {
484
+ type: 'string',
485
+ description: 'Comment body',
486
+ },
487
+ },
488
+ required: ['owner', 'repo', 'comment_id', 'body'],
489
+ },
490
+ },
491
+ handler: async (octokit, args) => {
492
+ const { data } = await octokit.issues.updateComment({
493
+ owner: args.owner,
494
+ repo: args.repo,
495
+ comment_id: args.comment_id,
496
+ body: args.body,
497
+ });
498
+ return successResult(data);
499
+ },
257
500
  },
258
- },
259
- {
260
- name: 'github_issues_listMilestones',
261
- description: 'List milestones for a repository',
262
- inputSchema: {
263
- type: 'object',
264
- properties: {
265
- owner: { type: 'string', description: 'Repository owner' },
266
- repo: { type: 'string', description: 'Repository name' },
267
- state: {
268
- type: 'string',
269
- enum: ['open', 'closed', 'all'],
501
+ // delete_comment - Delete a comment
502
+ {
503
+ definition: {
504
+ name: 'github_issues_delete_comment',
505
+ description: 'Delete a comment',
506
+ inputSchema: {
507
+ type: 'object',
508
+ properties: {
509
+ owner: {
510
+ type: 'string',
511
+ description: 'Repository owner',
512
+ },
513
+ repo: {
514
+ type: 'string',
515
+ description: 'Repository name',
516
+ },
517
+ comment_id: {
518
+ type: 'number',
519
+ description: 'Comment ID',
520
+ },
521
+ },
522
+ required: ['owner', 'repo', 'comment_id'],
270
523
  },
271
- sort: {
272
- type: 'string',
273
- enum: ['due_on', 'completeness'],
524
+ },
525
+ handler: async (octokit, args) => {
526
+ await octokit.issues.deleteComment({
527
+ owner: args.owner,
528
+ repo: args.repo,
529
+ comment_id: args.comment_id,
530
+ });
531
+ return successResult({ success: true, message: 'Comment deleted' });
532
+ },
533
+ },
534
+ // list_labels - List labels for a repository
535
+ {
536
+ definition: {
537
+ name: 'github_issues_list_labels',
538
+ description: 'List labels for a repository',
539
+ inputSchema: {
540
+ type: 'object',
541
+ properties: {
542
+ owner: {
543
+ type: 'string',
544
+ description: 'Repository owner',
545
+ },
546
+ repo: {
547
+ type: 'string',
548
+ description: 'Repository name',
549
+ },
550
+ per_page: {
551
+ type: 'number',
552
+ description: 'Results per page (max 100)',
553
+ },
554
+ page: {
555
+ type: 'number',
556
+ description: 'Page number',
557
+ },
558
+ },
559
+ required: ['owner', 'repo'],
274
560
  },
275
- direction: {
276
- type: 'string',
277
- enum: ['asc', 'desc'],
561
+ },
562
+ handler: async (octokit, args) => {
563
+ const { data } = await octokit.issues.listLabelsForRepo({
564
+ owner: args.owner,
565
+ repo: args.repo,
566
+ per_page: args.per_page,
567
+ page: args.page,
568
+ });
569
+ return successResult(data);
570
+ },
571
+ },
572
+ // add_labels - Add labels to an issue
573
+ {
574
+ definition: {
575
+ name: 'github_issues_add_labels',
576
+ description: 'Add labels to an issue',
577
+ inputSchema: {
578
+ type: 'object',
579
+ properties: {
580
+ owner: {
581
+ type: 'string',
582
+ description: 'Repository owner',
583
+ },
584
+ repo: {
585
+ type: 'string',
586
+ description: 'Repository name',
587
+ },
588
+ issue_number: {
589
+ type: 'number',
590
+ description: 'Issue number',
591
+ },
592
+ labels: {
593
+ type: 'array',
594
+ items: { type: 'string' },
595
+ description: 'Labels to add',
596
+ },
597
+ },
598
+ required: ['owner', 'repo', 'issue_number', 'labels'],
278
599
  },
279
- per_page: { type: 'number' },
280
- page: { type: 'number' },
281
600
  },
282
- required: ['owner', 'repo'],
601
+ handler: async (octokit, args) => {
602
+ const { data } = await octokit.issues.addLabels({
603
+ owner: args.owner,
604
+ repo: args.repo,
605
+ issue_number: args.issue_number,
606
+ labels: args.labels,
607
+ });
608
+ return successResult(data);
609
+ },
283
610
  },
284
- },
285
- {
286
- name: 'github_issues_createMilestone',
287
- description: 'Create a milestone',
288
- inputSchema: {
289
- type: 'object',
290
- properties: {
291
- owner: { type: 'string', description: 'Repository owner' },
292
- repo: { type: 'string', description: 'Repository name' },
293
- title: { type: 'string', description: 'Milestone title' },
294
- state: {
295
- type: 'string',
296
- enum: ['open', 'closed'],
611
+ // set_labels - Set labels for an issue (replaces all)
612
+ {
613
+ definition: {
614
+ name: 'github_issues_set_labels',
615
+ description: 'Set labels for an issue (replaces all existing labels)',
616
+ inputSchema: {
617
+ type: 'object',
618
+ properties: {
619
+ owner: {
620
+ type: 'string',
621
+ description: 'Repository owner',
622
+ },
623
+ repo: {
624
+ type: 'string',
625
+ description: 'Repository name',
626
+ },
627
+ issue_number: {
628
+ type: 'number',
629
+ description: 'Issue number',
630
+ },
631
+ labels: {
632
+ type: 'array',
633
+ items: { type: 'string' },
634
+ description: 'Labels to set',
635
+ },
636
+ },
637
+ required: ['owner', 'repo', 'issue_number', 'labels'],
297
638
  },
298
- description: { type: 'string', description: 'Milestone description' },
299
- due_on: { type: 'string', description: 'ISO 8601 due date' },
300
639
  },
301
- required: ['owner', 'repo', 'title'],
640
+ handler: async (octokit, args) => {
641
+ const { data } = await octokit.issues.setLabels({
642
+ owner: args.owner,
643
+ repo: args.repo,
644
+ issue_number: args.issue_number,
645
+ labels: args.labels,
646
+ });
647
+ return successResult(data);
648
+ },
302
649
  },
303
- },
304
- {
305
- name: 'github_issues_addAssignees',
306
- description: 'Add assignees to an issue',
307
- inputSchema: {
308
- type: 'object',
309
- properties: {
310
- owner: { type: 'string', description: 'Repository owner' },
311
- repo: { type: 'string', description: 'Repository name' },
312
- issue_number: { type: 'number', description: 'Issue number' },
313
- assignees: {
314
- type: 'array',
315
- items: { type: 'string' },
316
- description: 'Usernames to assign',
650
+ // remove_label - Remove a label from an issue
651
+ {
652
+ definition: {
653
+ name: 'github_issues_remove_label',
654
+ description: 'Remove a label from an issue',
655
+ inputSchema: {
656
+ type: 'object',
657
+ properties: {
658
+ owner: {
659
+ type: 'string',
660
+ description: 'Repository owner',
661
+ },
662
+ repo: {
663
+ type: 'string',
664
+ description: 'Repository name',
665
+ },
666
+ issue_number: {
667
+ type: 'number',
668
+ description: 'Issue number',
669
+ },
670
+ name: {
671
+ type: 'string',
672
+ description: 'Label name to remove',
673
+ },
674
+ },
675
+ required: ['owner', 'repo', 'issue_number', 'name'],
317
676
  },
318
677
  },
319
- required: ['owner', 'repo', 'issue_number', 'assignees'],
678
+ handler: async (octokit, args) => {
679
+ const { data } = await octokit.issues.removeLabel({
680
+ owner: args.owner,
681
+ repo: args.repo,
682
+ issue_number: args.issue_number,
683
+ name: args.name,
684
+ });
685
+ return successResult(data);
686
+ },
320
687
  },
321
- },
322
- {
323
- name: 'github_issues_removeAssignees',
324
- description: 'Remove assignees from an issue',
325
- inputSchema: {
326
- type: 'object',
327
- properties: {
328
- owner: { type: 'string', description: 'Repository owner' },
329
- repo: { type: 'string', description: 'Repository name' },
330
- issue_number: { type: 'number', description: 'Issue number' },
331
- assignees: {
332
- type: 'array',
333
- items: { type: 'string' },
334
- description: 'Usernames to remove',
688
+ // list_assignees - List available assignees
689
+ {
690
+ definition: {
691
+ name: 'github_issues_list_assignees',
692
+ description: 'List users who can be assigned to issues',
693
+ inputSchema: {
694
+ type: 'object',
695
+ properties: {
696
+ owner: {
697
+ type: 'string',
698
+ description: 'Repository owner',
699
+ },
700
+ repo: {
701
+ type: 'string',
702
+ description: 'Repository name',
703
+ },
704
+ per_page: {
705
+ type: 'number',
706
+ description: 'Results per page (max 100)',
707
+ },
708
+ page: {
709
+ type: 'number',
710
+ description: 'Page number',
711
+ },
712
+ },
713
+ required: ['owner', 'repo'],
335
714
  },
336
715
  },
337
- required: ['owner', 'repo', 'issue_number', 'assignees'],
716
+ handler: async (octokit, args) => {
717
+ const { data } = await octokit.issues.listAssignees({
718
+ owner: args.owner,
719
+ repo: args.repo,
720
+ per_page: args.per_page,
721
+ page: args.page,
722
+ });
723
+ return successResult(data);
724
+ },
338
725
  },
339
- },
340
- ];
341
- export async function handleIssuesTool(octokit, args) {
342
- const owner = args.owner;
343
- const repo = args.repo;
344
- const issueNumber = args.issue_number;
345
- // List issues for authenticated user
346
- if (!owner && !repo) {
347
- const { data } = await octokit.issues.list(args);
348
- return data;
349
- }
350
- // List issues for repo
351
- if (owner && repo && !issueNumber && !('comment_id' in args) && !('labels' in args && Array.isArray(args.labels))) {
352
- if (!('title' in args) && !('state' in args && ('body' in args || 'assignees' in args))) {
353
- const { data } = await octokit.issues.listForRepo(args);
354
- return data;
355
- }
356
- }
357
- // Get specific issue
358
- if (owner && repo && issueNumber && !('body' in args) && !('title' in args) && !('labels' in args) && !('assignees' in args)) {
359
- // Could be get, listComments
360
- if ('since' in args || 'per_page' in args || 'page' in args) {
361
- const { data } = await octokit.issues.listComments(args);
362
- return data;
363
- }
364
- const { data } = await octokit.issues.get(args);
365
- return data;
366
- }
367
- // Create issue
368
- if (owner && repo && 'title' in args && !issueNumber) {
369
- const { data } = await octokit.issues.create(args);
370
- return data;
371
- }
372
- // Update issue
373
- if (owner && repo && issueNumber && ('title' in args || 'body' in args || 'state' in args)) {
374
- const { data } = await octokit.issues.update(args);
375
- return data;
376
- }
377
- // Create comment
378
- if (owner && repo && issueNumber && 'body' in args && !('comment_id' in args)) {
379
- const { data } = await octokit.issues.createComment(args);
380
- return data;
381
- }
382
- // Update comment
383
- if (owner && repo && 'comment_id' in args && 'body' in args) {
384
- const { data } = await octokit.issues.updateComment(args);
385
- return data;
386
- }
387
- // Delete comment
388
- if (owner && repo && 'comment_id' in args && !('body' in args)) {
389
- await octokit.issues.deleteComment(args);
390
- return { success: true, message: 'Comment deleted' };
391
- }
392
- // Labels operations
393
- if (owner && repo && 'name' in args && 'color' in args) {
394
- const { data } = await octokit.issues.createLabel(args);
395
- return data;
396
- }
397
- if (owner && repo && issueNumber && 'labels' in args && Array.isArray(args.labels)) {
398
- const { data } = await octokit.issues.addLabels(args);
399
- return data;
400
- }
401
- if (owner && repo && issueNumber && 'name' in args && !('color' in args)) {
402
- await octokit.issues.removeLabel(args);
403
- return { success: true, message: 'Label removed' };
404
- }
405
- // List labels
406
- if (owner && repo && !issueNumber && !('title' in args) && !('name' in args)) {
407
- const { data } = await octokit.issues.listLabelsForRepo(args);
408
- return data;
409
- }
410
- // Milestones
411
- if (owner && repo && 'title' in args && !issueNumber && !('color' in args)) {
412
- const { data } = await octokit.issues.createMilestone(args);
413
- return data;
414
- }
415
- // Assignees
416
- if (owner && repo && issueNumber && 'assignees' in args) {
417
- // Check if we're adding or removing based on context
418
- const { data } = await octokit.issues.addAssignees(args);
419
- return data;
420
- }
421
- // Default: list for authenticated user
422
- const { data } = await octokit.issues.list();
423
- return data;
424
- }
425
- //# sourceMappingURL=issues.js.map
726
+ ],
727
+ };