adoptai-mcp 1.0.0

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 (174) hide show
  1. package/README.md +70 -0
  2. package/bin/adoptai-mcp.js +2 -0
  3. package/dist/apps/canva.js +1 -0
  4. package/dist/apps/figma.js +1 -0
  5. package/dist/apps/github.js +2 -0
  6. package/dist/apps/notion.js +1 -0
  7. package/dist/apps/registry.js +20 -0
  8. package/dist/apps/salesforce.js +1 -0
  9. package/dist/cli/add.js +532 -0
  10. package/dist/cli/index.js +39 -0
  11. package/dist/cli/list.js +19 -0
  12. package/dist/cli/remove.js +37 -0
  13. package/dist/cli/serve.js +27 -0
  14. package/dist/cli/status.js +24 -0
  15. package/dist/config/clients.js +118 -0
  16. package/dist/config/credentials.js +34 -0
  17. package/dist/core/auth-manager.js +237 -0
  18. package/dist/core/config-writer.js +161 -0
  19. package/dist/core/doctor.js +199 -0
  20. package/dist/core/package.json +3 -0
  21. package/dist/core/server-base.js +81 -0
  22. package/dist/integrations/canva/.env +3 -0
  23. package/dist/integrations/canva/auth.js +287 -0
  24. package/dist/integrations/canva/env.js +9 -0
  25. package/dist/integrations/canva/index.js +12 -0
  26. package/dist/integrations/canva/package.json +31 -0
  27. package/dist/integrations/canva/publish-to-adoptai.js +365 -0
  28. package/dist/integrations/canva/setup.js +90 -0
  29. package/dist/integrations/canva/tools.js +1315 -0
  30. package/dist/integrations/canva/tools.original.js +1315 -0
  31. package/dist/integrations/figma/auth.js +48 -0
  32. package/dist/integrations/figma/index.js +11 -0
  33. package/dist/integrations/figma/package.json +27 -0
  34. package/dist/integrations/figma/publish-to-adoptai.js +384 -0
  35. package/dist/integrations/figma/setup.js +90 -0
  36. package/dist/integrations/figma/tools.js +1137 -0
  37. package/dist/integrations/github/auth.js +53 -0
  38. package/dist/integrations/github/index.js +11 -0
  39. package/dist/integrations/github/package.json +28 -0
  40. package/dist/integrations/github/publish-to-adoptai.js +240 -0
  41. package/dist/integrations/github/setup.js +103 -0
  42. package/dist/integrations/github/tools.js +78 -0
  43. package/dist/integrations/github-actions/auth.js +53 -0
  44. package/dist/integrations/github-actions/index.js +11 -0
  45. package/dist/integrations/github-actions/package.json +27 -0
  46. package/dist/integrations/github-actions/setup.js +103 -0
  47. package/dist/integrations/github-actions/tools.js +5642 -0
  48. package/dist/integrations/github-activity/auth.js +53 -0
  49. package/dist/integrations/github-activity/index.js +11 -0
  50. package/dist/integrations/github-activity/package.json +27 -0
  51. package/dist/integrations/github-activity/setup.js +103 -0
  52. package/dist/integrations/github-activity/tools.js +925 -0
  53. package/dist/integrations/github-apps/auth.js +53 -0
  54. package/dist/integrations/github-apps/index.js +11 -0
  55. package/dist/integrations/github-apps/package.json +27 -0
  56. package/dist/integrations/github-apps/setup.js +103 -0
  57. package/dist/integrations/github-apps/tools.js +791 -0
  58. package/dist/integrations/github-billing/auth.js +53 -0
  59. package/dist/integrations/github-billing/index.js +11 -0
  60. package/dist/integrations/github-billing/package.json +27 -0
  61. package/dist/integrations/github-billing/setup.js +103 -0
  62. package/dist/integrations/github-billing/tools.js +438 -0
  63. package/dist/integrations/github-checks/auth.js +53 -0
  64. package/dist/integrations/github-checks/index.js +11 -0
  65. package/dist/integrations/github-checks/package.json +27 -0
  66. package/dist/integrations/github-checks/setup.js +103 -0
  67. package/dist/integrations/github-checks/tools.js +607 -0
  68. package/dist/integrations/github-code-scanning/auth.js +53 -0
  69. package/dist/integrations/github-code-scanning/index.js +11 -0
  70. package/dist/integrations/github-code-scanning/package.json +27 -0
  71. package/dist/integrations/github-code-scanning/setup.js +103 -0
  72. package/dist/integrations/github-code-scanning/tools.js +987 -0
  73. package/dist/integrations/github-dependabot/auth.js +53 -0
  74. package/dist/integrations/github-dependabot/index.js +11 -0
  75. package/dist/integrations/github-dependabot/package.json +27 -0
  76. package/dist/integrations/github-dependabot/setup.js +103 -0
  77. package/dist/integrations/github-dependabot/tools.js +915 -0
  78. package/dist/integrations/github-gists/auth.js +53 -0
  79. package/dist/integrations/github-gists/index.js +11 -0
  80. package/dist/integrations/github-gists/package.json +27 -0
  81. package/dist/integrations/github-gists/setup.js +103 -0
  82. package/dist/integrations/github-gists/tools.js +545 -0
  83. package/dist/integrations/github-git/auth.js +53 -0
  84. package/dist/integrations/github-git/index.js +11 -0
  85. package/dist/integrations/github-git/package.json +27 -0
  86. package/dist/integrations/github-git/setup.js +103 -0
  87. package/dist/integrations/github-git/tools.js +513 -0
  88. package/dist/integrations/github-issues/auth.js +53 -0
  89. package/dist/integrations/github-issues/index.js +11 -0
  90. package/dist/integrations/github-issues/package.json +27 -0
  91. package/dist/integrations/github-issues/setup.js +103 -0
  92. package/dist/integrations/github-issues/tools.js +2232 -0
  93. package/dist/integrations/github-orgs/auth.js +53 -0
  94. package/dist/integrations/github-orgs/index.js +11 -0
  95. package/dist/integrations/github-orgs/package.json +27 -0
  96. package/dist/integrations/github-orgs/setup.js +103 -0
  97. package/dist/integrations/github-orgs/tools.js +3512 -0
  98. package/dist/integrations/github-packages/auth.js +53 -0
  99. package/dist/integrations/github-packages/index.js +11 -0
  100. package/dist/integrations/github-packages/package.json +27 -0
  101. package/dist/integrations/github-packages/setup.js +103 -0
  102. package/dist/integrations/github-packages/tools.js +1088 -0
  103. package/dist/integrations/github-pulls/auth.js +53 -0
  104. package/dist/integrations/github-pulls/index.js +11 -0
  105. package/dist/integrations/github-pulls/package.json +27 -0
  106. package/dist/integrations/github-pulls/setup.js +103 -0
  107. package/dist/integrations/github-pulls/tools.js +1252 -0
  108. package/dist/integrations/github-reactions/auth.js +53 -0
  109. package/dist/integrations/github-reactions/index.js +11 -0
  110. package/dist/integrations/github-reactions/package.json +27 -0
  111. package/dist/integrations/github-reactions/setup.js +103 -0
  112. package/dist/integrations/github-reactions/tools.js +706 -0
  113. package/dist/integrations/github-repos/auth.js +53 -0
  114. package/dist/integrations/github-repos/index.js +11 -0
  115. package/dist/integrations/github-repos/package.json +27 -0
  116. package/dist/integrations/github-repos/setup.js +103 -0
  117. package/dist/integrations/github-repos/tools.js +7286 -0
  118. package/dist/integrations/github-search/auth.js +53 -0
  119. package/dist/integrations/github-search/index.js +11 -0
  120. package/dist/integrations/github-search/package.json +27 -0
  121. package/dist/integrations/github-search/setup.js +103 -0
  122. package/dist/integrations/github-search/tools.js +370 -0
  123. package/dist/integrations/github-teams/auth.js +53 -0
  124. package/dist/integrations/github-teams/index.js +11 -0
  125. package/dist/integrations/github-teams/package.json +27 -0
  126. package/dist/integrations/github-teams/setup.js +103 -0
  127. package/dist/integrations/github-teams/tools.js +633 -0
  128. package/dist/integrations/github-users/auth.js +53 -0
  129. package/dist/integrations/github-users/index.js +11 -0
  130. package/dist/integrations/github-users/package.json +27 -0
  131. package/dist/integrations/github-users/setup.js +103 -0
  132. package/dist/integrations/github-users/tools.js +1118 -0
  133. package/dist/integrations/notion/api.js +108 -0
  134. package/dist/integrations/notion/auth.js +59 -0
  135. package/dist/integrations/notion/endpoints.json +630 -0
  136. package/dist/integrations/notion/index.js +11 -0
  137. package/dist/integrations/notion/package.json +33 -0
  138. package/dist/integrations/notion/publish-to-adoptai.js +271 -0
  139. package/dist/integrations/notion/scripts/generate-endpoints.mjs +306 -0
  140. package/dist/integrations/notion/setup.js +89 -0
  141. package/dist/integrations/notion/tools.js +586 -0
  142. package/dist/integrations/notion/tools.original.js +568 -0
  143. package/dist/integrations/salesforce/.env +8 -0
  144. package/dist/integrations/salesforce/.env.example +15 -0
  145. package/dist/integrations/salesforce/auth.js +311 -0
  146. package/dist/integrations/salesforce/endpoints.json +1359 -0
  147. package/dist/integrations/salesforce/env.js +9 -0
  148. package/dist/integrations/salesforce/index.js +12 -0
  149. package/dist/integrations/salesforce/package.json +42 -0
  150. package/dist/integrations/salesforce/publish-smart-specs.js +890 -0
  151. package/dist/integrations/salesforce/publish-to-adoptai.js +386 -0
  152. package/dist/integrations/salesforce/scripts/extract-postman.mjs +222 -0
  153. package/dist/integrations/salesforce/setup.js +112 -0
  154. package/dist/integrations/salesforce/tools.js +4544 -0
  155. package/dist/integrations/salesforce/tools.original.js +4487 -0
  156. package/dist/server/mcp-server.js +50 -0
  157. package/dist/server/tool-loader.js +47 -0
  158. package/dist/specs/figma-api.json +13621 -0
  159. package/dist/specs/split/salesforce-auth.json +3931 -0
  160. package/dist/specs/split/salesforce-bulk-v1.json +1489 -0
  161. package/dist/specs/split/salesforce-bulk-v2.json +1951 -0
  162. package/dist/specs/split/salesforce-composite.json +1246 -0
  163. package/dist/specs/split/salesforce-connect.json +11639 -0
  164. package/dist/specs/split/salesforce-einstein-prediction-service.json +576 -0
  165. package/dist/specs/split/salesforce-event-platform.json +2682 -0
  166. package/dist/specs/split/salesforce-graphql.json +1754 -0
  167. package/dist/specs/split/salesforce-industries.json +4115 -0
  168. package/dist/specs/split/salesforce-metadata.json +555 -0
  169. package/dist/specs/split/salesforce-rest.json +4798 -0
  170. package/dist/specs/split/salesforce-soap.json +210 -0
  171. package/dist/specs/split/salesforce-subscription-management.json +1299 -0
  172. package/dist/specs/split/salesforce-tooling.json +2026 -0
  173. package/dist/specs/split/salesforce-ui.json +7426 -0
  174. package/package.json +47 -0
@@ -0,0 +1,1252 @@
1
+ import axios from 'axios';
2
+ import { buildAuthHeaders } from './auth.js';
3
+
4
+ const BASE_URL = 'https://api.github.com';
5
+ const APP_ID = 'github-pulls';
6
+
7
+ function handleError(err) {
8
+ const status = err.response?.status;
9
+ const msg =
10
+ err.response?.data?.message ||
11
+ err.response?.data?.error ||
12
+ err.message;
13
+ if (status === 401) {
14
+ throw new Error(
15
+ `Token invalid.\nRun: npx adoptai-${APP_ID}-mcp --client cursor`
16
+ );
17
+ }
18
+ if (status === 403) {
19
+ throw new Error('Insufficient permissions. Check your API key scopes.');
20
+ }
21
+ if (status === 404) {
22
+ throw new Error('Resource not found. Check your parameters.');
23
+ }
24
+ if (status === 429) {
25
+ throw new Error('Rate limit exceeded. Please wait and try again.');
26
+ }
27
+ throw new Error(msg || 'API request failed');
28
+ }
29
+
30
+ /**
31
+ * @param {string} method
32
+ * @param {string} pathTemplate path starting with /
33
+ * @param {Record<string, unknown>} params
34
+ * @param {{ deleteSendsJsonBody?: boolean }} [opts] GitHub uses JSON body on some DELETE routes
35
+ */
36
+ async function apiRequest(method, pathTemplate, params = {}, opts = {}) {
37
+ const { deleteSendsJsonBody = false } = opts;
38
+ const headers = buildAuthHeaders();
39
+ let url = BASE_URL + pathTemplate;
40
+ const pathKeys = [...pathTemplate.matchAll(/\{([^}]+)\}/g)].map((m) => m[1]);
41
+
42
+ for (const key of pathKeys) {
43
+ const value = params[key];
44
+ if (value !== undefined && value !== null) {
45
+ url = url.replace(`{${key}}`, encodeURIComponent(String(value)));
46
+ }
47
+ }
48
+
49
+ const rest = { ...params };
50
+ for (const key of pathKeys) delete rest[key];
51
+
52
+ const m = method.toUpperCase();
53
+ const useQuery = m === 'GET' || (m === 'DELETE' && !deleteSendsJsonBody);
54
+ const queryParams = {};
55
+ const bodyParams = {};
56
+
57
+ for (const [key, value] of Object.entries(rest)) {
58
+ if (value === undefined) continue;
59
+ if (useQuery) queryParams[key] = value;
60
+ else bodyParams[key] = value;
61
+ }
62
+
63
+ try {
64
+ const res = await axios({
65
+ method: m,
66
+ url,
67
+ headers: { 'Content-Type': 'application/json', ...headers },
68
+ params: Object.keys(queryParams).length ? queryParams : undefined,
69
+ data: Object.keys(bodyParams).length ? bodyParams : undefined,
70
+ timeout: 30000,
71
+ });
72
+ if (res.status === 204 || res.data === '' || res.data === undefined) {
73
+ return { ok: true, status: res.status };
74
+ }
75
+ return res.data;
76
+ } catch (err) {
77
+ handleError(err);
78
+ }
79
+ }
80
+
81
+ const ENDPOINTS = [
82
+ {
83
+ "name": "pulls_list",
84
+ "description": "List pull requests",
85
+ "method": "GET",
86
+ "path": "/repos/{owner}/{repo}/pulls",
87
+ "deleteSendsJsonBody": false,
88
+ "inputSchema": {
89
+ "type": "object",
90
+ "properties": {
91
+ "owner": {
92
+ "type": "string",
93
+ "description": "The account owner of the repository. The name is not case sensitive."
94
+ },
95
+ "repo": {
96
+ "type": "string",
97
+ "description": "The name of the repository without the `.git` extension. The name is not case sensitive."
98
+ },
99
+ "state": {
100
+ "type": "string",
101
+ "description": "Either `open`, `closed`, or `all` to filter by state.",
102
+ "enum": [
103
+ "open",
104
+ "closed",
105
+ "all"
106
+ ]
107
+ },
108
+ "head": {
109
+ "type": "string",
110
+ "description": "Filter pulls by head user or head organization and branch name in the format of `user:ref-name` or `organization:ref-name`. For example: `github:new-script-format` or `octocat:test-branch`."
111
+ },
112
+ "base": {
113
+ "type": "string",
114
+ "description": "Filter pulls by base branch name. Example: `gh-pages`."
115
+ },
116
+ "sort": {
117
+ "type": "string",
118
+ "description": "What to sort results by. `popularity` will sort by the number of comments. `long-running` will sort by date created and will limit the results to pull requests that have been open for more than a month and have had activity within the past month.",
119
+ "enum": [
120
+ "created",
121
+ "updated",
122
+ "popularity",
123
+ "long-running"
124
+ ]
125
+ },
126
+ "direction": {
127
+ "type": "string",
128
+ "description": "The direction of the sort. Default: `desc` when sort is `created` or sort is not specified, otherwise `asc`.",
129
+ "enum": [
130
+ "asc",
131
+ "desc"
132
+ ]
133
+ },
134
+ "per_page": {
135
+ "type": "number",
136
+ "description": "The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\""
137
+ },
138
+ "page": {
139
+ "type": "number",
140
+ "description": "The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\""
141
+ }
142
+ },
143
+ "required": [
144
+ "owner",
145
+ "repo"
146
+ ]
147
+ }
148
+ },
149
+ {
150
+ "name": "pulls_create",
151
+ "description": "Create a pull request",
152
+ "method": "POST",
153
+ "path": "/repos/{owner}/{repo}/pulls",
154
+ "deleteSendsJsonBody": false,
155
+ "inputSchema": {
156
+ "type": "object",
157
+ "properties": {
158
+ "owner": {
159
+ "type": "string",
160
+ "description": "The account owner of the repository. The name is not case sensitive."
161
+ },
162
+ "repo": {
163
+ "type": "string",
164
+ "description": "The name of the repository without the `.git` extension. The name is not case sensitive."
165
+ },
166
+ "title": {
167
+ "type": "string",
168
+ "description": "The title of the new pull request. Required unless `issue` is specified."
169
+ },
170
+ "head": {
171
+ "type": "string",
172
+ "description": "The name of the branch where your changes are implemented. For cross-repository pull requests in the same network, namespace `head` with a user like this: `username:branch`."
173
+ },
174
+ "head_repo": {
175
+ "type": "string",
176
+ "description": "The name of the repository where the changes in the pull request were made. This field is required for cross-repository pull requests if both repositories are owned by the same organization."
177
+ },
178
+ "base": {
179
+ "type": "string",
180
+ "description": "The name of the branch you want the changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repository that requests a merge to a base of another repository."
181
+ },
182
+ "body": {
183
+ "type": "string",
184
+ "description": "The contents of the pull request."
185
+ },
186
+ "maintainer_can_modify": {
187
+ "type": "boolean",
188
+ "description": "Indicates whether [maintainers can modify](https://docs.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/) the pull request."
189
+ },
190
+ "draft": {
191
+ "type": "boolean",
192
+ "description": "Indicates whether the pull request is a draft. See \"[Draft Pull Requests](https://docs.github.com/articles/about-pull-requests#draft-pull-requests)\" in the GitHub Help documentation to learn more."
193
+ },
194
+ "issue": {
195
+ "type": "number",
196
+ "description": "An issue in the repository to convert to a pull request. The issue title, body, and comments will become the title, body, and comments on the new pull request. Required unless `title` is specified."
197
+ }
198
+ },
199
+ "required": [
200
+ "owner",
201
+ "repo",
202
+ "head",
203
+ "base"
204
+ ]
205
+ }
206
+ },
207
+ {
208
+ "name": "pulls_list_review_comments_for_repo",
209
+ "description": "List review comments in a repository",
210
+ "method": "GET",
211
+ "path": "/repos/{owner}/{repo}/pulls/comments",
212
+ "deleteSendsJsonBody": false,
213
+ "inputSchema": {
214
+ "type": "object",
215
+ "properties": {
216
+ "owner": {
217
+ "type": "string",
218
+ "description": "The account owner of the repository. The name is not case sensitive."
219
+ },
220
+ "repo": {
221
+ "type": "string",
222
+ "description": "The name of the repository without the `.git` extension. The name is not case sensitive."
223
+ },
224
+ "sort": {
225
+ "type": "string",
226
+ "description": "The sort parameter",
227
+ "enum": [
228
+ "created",
229
+ "updated",
230
+ "created_at"
231
+ ]
232
+ },
233
+ "direction": {
234
+ "type": "string",
235
+ "description": "The direction to sort results. Ignored without `sort` parameter.",
236
+ "enum": [
237
+ "asc",
238
+ "desc"
239
+ ]
240
+ },
241
+ "since": {
242
+ "type": "string",
243
+ "description": "Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`."
244
+ },
245
+ "per_page": {
246
+ "type": "number",
247
+ "description": "The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\""
248
+ },
249
+ "page": {
250
+ "type": "number",
251
+ "description": "The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\""
252
+ }
253
+ },
254
+ "required": [
255
+ "owner",
256
+ "repo"
257
+ ]
258
+ }
259
+ },
260
+ {
261
+ "name": "pulls_get_review_comment",
262
+ "description": "Get a review comment for a pull request",
263
+ "method": "GET",
264
+ "path": "/repos/{owner}/{repo}/pulls/comments/{comment_id}",
265
+ "deleteSendsJsonBody": false,
266
+ "inputSchema": {
267
+ "type": "object",
268
+ "properties": {
269
+ "owner": {
270
+ "type": "string",
271
+ "description": "The account owner of the repository. The name is not case sensitive."
272
+ },
273
+ "repo": {
274
+ "type": "string",
275
+ "description": "The name of the repository without the `.git` extension. The name is not case sensitive."
276
+ },
277
+ "comment_id": {
278
+ "type": "number",
279
+ "description": "The unique identifier of the comment."
280
+ }
281
+ },
282
+ "required": [
283
+ "owner",
284
+ "repo",
285
+ "comment_id"
286
+ ]
287
+ }
288
+ },
289
+ {
290
+ "name": "pulls_update_review_comment",
291
+ "description": "Update a review comment for a pull request",
292
+ "method": "PATCH",
293
+ "path": "/repos/{owner}/{repo}/pulls/comments/{comment_id}",
294
+ "deleteSendsJsonBody": false,
295
+ "inputSchema": {
296
+ "type": "object",
297
+ "properties": {
298
+ "owner": {
299
+ "type": "string",
300
+ "description": "The account owner of the repository. The name is not case sensitive."
301
+ },
302
+ "repo": {
303
+ "type": "string",
304
+ "description": "The name of the repository without the `.git` extension. The name is not case sensitive."
305
+ },
306
+ "comment_id": {
307
+ "type": "number",
308
+ "description": "The unique identifier of the comment."
309
+ },
310
+ "body": {
311
+ "type": "string",
312
+ "description": "The text of the reply to the review comment."
313
+ }
314
+ },
315
+ "required": [
316
+ "owner",
317
+ "repo",
318
+ "comment_id",
319
+ "body"
320
+ ]
321
+ }
322
+ },
323
+ {
324
+ "name": "pulls_delete_review_comment",
325
+ "description": "Delete a review comment for a pull request",
326
+ "method": "DELETE",
327
+ "path": "/repos/{owner}/{repo}/pulls/comments/{comment_id}",
328
+ "deleteSendsJsonBody": false,
329
+ "inputSchema": {
330
+ "type": "object",
331
+ "properties": {
332
+ "owner": {
333
+ "type": "string",
334
+ "description": "The account owner of the repository. The name is not case sensitive."
335
+ },
336
+ "repo": {
337
+ "type": "string",
338
+ "description": "The name of the repository without the `.git` extension. The name is not case sensitive."
339
+ },
340
+ "comment_id": {
341
+ "type": "number",
342
+ "description": "The unique identifier of the comment."
343
+ }
344
+ },
345
+ "required": [
346
+ "owner",
347
+ "repo",
348
+ "comment_id"
349
+ ]
350
+ }
351
+ },
352
+ {
353
+ "name": "pulls_get",
354
+ "description": "Get a pull request",
355
+ "method": "GET",
356
+ "path": "/repos/{owner}/{repo}/pulls/{pull_number}",
357
+ "deleteSendsJsonBody": false,
358
+ "inputSchema": {
359
+ "type": "object",
360
+ "properties": {
361
+ "owner": {
362
+ "type": "string",
363
+ "description": "The account owner of the repository. The name is not case sensitive."
364
+ },
365
+ "repo": {
366
+ "type": "string",
367
+ "description": "The name of the repository without the `.git` extension. The name is not case sensitive."
368
+ },
369
+ "pull_number": {
370
+ "type": "number",
371
+ "description": "The number that identifies the pull request."
372
+ }
373
+ },
374
+ "required": [
375
+ "owner",
376
+ "repo",
377
+ "pull_number"
378
+ ]
379
+ }
380
+ },
381
+ {
382
+ "name": "pulls_update",
383
+ "description": "Update a pull request",
384
+ "method": "PATCH",
385
+ "path": "/repos/{owner}/{repo}/pulls/{pull_number}",
386
+ "deleteSendsJsonBody": false,
387
+ "inputSchema": {
388
+ "type": "object",
389
+ "properties": {
390
+ "owner": {
391
+ "type": "string",
392
+ "description": "The account owner of the repository. The name is not case sensitive."
393
+ },
394
+ "repo": {
395
+ "type": "string",
396
+ "description": "The name of the repository without the `.git` extension. The name is not case sensitive."
397
+ },
398
+ "pull_number": {
399
+ "type": "number",
400
+ "description": "The number that identifies the pull request."
401
+ },
402
+ "title": {
403
+ "type": "string",
404
+ "description": "The title of the pull request."
405
+ },
406
+ "body": {
407
+ "type": "string",
408
+ "description": "The contents of the pull request."
409
+ },
410
+ "state": {
411
+ "type": "string",
412
+ "description": "State of this Pull Request. Either `open` or `closed`.",
413
+ "enum": [
414
+ "open",
415
+ "closed"
416
+ ]
417
+ },
418
+ "base": {
419
+ "type": "string",
420
+ "description": "The name of the branch you want your changes pulled into. This should be an existing branch on the current repository. You cannot update the base branch on a pull request to point to another repository."
421
+ },
422
+ "maintainer_can_modify": {
423
+ "type": "boolean",
424
+ "description": "Indicates whether [maintainers can modify](https://docs.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/) the pull request."
425
+ }
426
+ },
427
+ "required": [
428
+ "owner",
429
+ "repo",
430
+ "pull_number"
431
+ ]
432
+ }
433
+ },
434
+ {
435
+ "name": "pulls_list_review_comments",
436
+ "description": "List review comments on a pull request",
437
+ "method": "GET",
438
+ "path": "/repos/{owner}/{repo}/pulls/{pull_number}/comments",
439
+ "deleteSendsJsonBody": false,
440
+ "inputSchema": {
441
+ "type": "object",
442
+ "properties": {
443
+ "owner": {
444
+ "type": "string",
445
+ "description": "The account owner of the repository. The name is not case sensitive."
446
+ },
447
+ "repo": {
448
+ "type": "string",
449
+ "description": "The name of the repository without the `.git` extension. The name is not case sensitive."
450
+ },
451
+ "pull_number": {
452
+ "type": "number",
453
+ "description": "The number that identifies the pull request."
454
+ },
455
+ "sort": {
456
+ "type": "string",
457
+ "description": "The property to sort the results by.",
458
+ "enum": [
459
+ "created",
460
+ "updated"
461
+ ]
462
+ },
463
+ "direction": {
464
+ "type": "string",
465
+ "description": "The direction to sort results. Ignored without `sort` parameter.",
466
+ "enum": [
467
+ "asc",
468
+ "desc"
469
+ ]
470
+ },
471
+ "since": {
472
+ "type": "string",
473
+ "description": "Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`."
474
+ },
475
+ "per_page": {
476
+ "type": "number",
477
+ "description": "The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\""
478
+ },
479
+ "page": {
480
+ "type": "number",
481
+ "description": "The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\""
482
+ }
483
+ },
484
+ "required": [
485
+ "owner",
486
+ "repo",
487
+ "pull_number"
488
+ ]
489
+ }
490
+ },
491
+ {
492
+ "name": "pulls_create_review_comment",
493
+ "description": "Create a review comment for a pull request",
494
+ "method": "POST",
495
+ "path": "/repos/{owner}/{repo}/pulls/{pull_number}/comments",
496
+ "deleteSendsJsonBody": false,
497
+ "inputSchema": {
498
+ "type": "object",
499
+ "properties": {
500
+ "owner": {
501
+ "type": "string",
502
+ "description": "The account owner of the repository. The name is not case sensitive."
503
+ },
504
+ "repo": {
505
+ "type": "string",
506
+ "description": "The name of the repository without the `.git` extension. The name is not case sensitive."
507
+ },
508
+ "pull_number": {
509
+ "type": "number",
510
+ "description": "The number that identifies the pull request."
511
+ },
512
+ "body": {
513
+ "type": "string",
514
+ "description": "The text of the review comment."
515
+ },
516
+ "commit_id": {
517
+ "type": "string",
518
+ "description": "The SHA of the commit needing a comment. Not using the latest commit SHA may render your comment outdated if a subsequent commit modifies the line you specify as the `position`."
519
+ },
520
+ "path": {
521
+ "type": "string",
522
+ "description": "The relative path to the file that necessitates a comment."
523
+ },
524
+ "position": {
525
+ "type": "number",
526
+ "description": "**This parameter is closing down. Use `line` instead**. The position in the diff where you want to add a review comment. Note this value is not the same as the line number in the file. The position value equals the number of lines down from the first \"@@\" hunk header in the file you want to add a comment. The line just below the \"@@\" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file."
527
+ },
528
+ "side": {
529
+ "type": "string",
530
+ "description": "In a split diff view, the side of the diff that the pull request's changes appear on. Can be `LEFT` or `RIGHT`. Use `LEFT` for deletions that appear in red. Use `RIGHT` for additions that appear in green or unchanged lines that appear in white and are shown for context. For a multi-line comment, side represents whether the last line of the comment range is a deletion or addition. For more information, see \"[Diff view options](https://docs.github.com/articles/about-comparing-branches-in-pull-requests#diff-view-options)\" in the GitHub Help documentation.",
531
+ "enum": [
532
+ "LEFT",
533
+ "RIGHT"
534
+ ]
535
+ },
536
+ "line": {
537
+ "type": "number",
538
+ "description": "**Required unless using `subject_type:file`**. The line of the blob in the pull request diff that the comment applies to. For a multi-line comment, the last line of the range that your comment applies to."
539
+ },
540
+ "start_line": {
541
+ "type": "number",
542
+ "description": "**Required when using multi-line comments unless using `in_reply_to`**. The `start_line` is the first line in the pull request diff that your multi-line comment applies to. To learn more about multi-line comments, see \"[Commenting on a pull request](https://docs.github.com/articles/commenting-on-a-pull-request#adding-line-comments-to-a-pull-request)\" in the GitHub Help documentation."
543
+ },
544
+ "start_side": {
545
+ "type": "string",
546
+ "description": "**Required when using multi-line comments unless using `in_reply_to`**. The `start_side` is the starting side of the diff that the comment applies to. Can be `LEFT` or `RIGHT`. To learn more about multi-line comments, see \"[Commenting on a pull request](https://docs.github.com/articles/commenting-on-a-pull-request#adding-line-comments-to-a-pull-request)\" in the GitHub Help documentation. See `side` in this table for additional context.",
547
+ "enum": [
548
+ "LEFT",
549
+ "RIGHT",
550
+ "side"
551
+ ]
552
+ },
553
+ "in_reply_to": {
554
+ "type": "number",
555
+ "description": "The ID of the review comment to reply to. To find the ID of a review comment with [\"List review comments on a pull request\"](#list-review-comments-on-a-pull-request). When specified, all parameters other than `body` in the request body are ignored."
556
+ },
557
+ "subject_type": {
558
+ "type": "string",
559
+ "description": "The level at which the comment is targeted.",
560
+ "enum": [
561
+ "line",
562
+ "file"
563
+ ]
564
+ }
565
+ },
566
+ "required": [
567
+ "owner",
568
+ "repo",
569
+ "pull_number",
570
+ "body",
571
+ "commit_id",
572
+ "path"
573
+ ]
574
+ }
575
+ },
576
+ {
577
+ "name": "pulls_create_reply_for_review_comment",
578
+ "description": "Create a reply for a review comment",
579
+ "method": "POST",
580
+ "path": "/repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies",
581
+ "deleteSendsJsonBody": false,
582
+ "inputSchema": {
583
+ "type": "object",
584
+ "properties": {
585
+ "owner": {
586
+ "type": "string",
587
+ "description": "The account owner of the repository. The name is not case sensitive."
588
+ },
589
+ "repo": {
590
+ "type": "string",
591
+ "description": "The name of the repository without the `.git` extension. The name is not case sensitive."
592
+ },
593
+ "pull_number": {
594
+ "type": "number",
595
+ "description": "The number that identifies the pull request."
596
+ },
597
+ "comment_id": {
598
+ "type": "number",
599
+ "description": "The unique identifier of the comment."
600
+ },
601
+ "body": {
602
+ "type": "string",
603
+ "description": "The text of the review comment."
604
+ }
605
+ },
606
+ "required": [
607
+ "owner",
608
+ "repo",
609
+ "pull_number",
610
+ "comment_id",
611
+ "body"
612
+ ]
613
+ }
614
+ },
615
+ {
616
+ "name": "pulls_list_commits",
617
+ "description": "List commits on a pull request",
618
+ "method": "GET",
619
+ "path": "/repos/{owner}/{repo}/pulls/{pull_number}/commits",
620
+ "deleteSendsJsonBody": false,
621
+ "inputSchema": {
622
+ "type": "object",
623
+ "properties": {
624
+ "owner": {
625
+ "type": "string",
626
+ "description": "The account owner of the repository. The name is not case sensitive."
627
+ },
628
+ "repo": {
629
+ "type": "string",
630
+ "description": "The name of the repository without the `.git` extension. The name is not case sensitive."
631
+ },
632
+ "pull_number": {
633
+ "type": "number",
634
+ "description": "The number that identifies the pull request."
635
+ },
636
+ "per_page": {
637
+ "type": "number",
638
+ "description": "The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\""
639
+ },
640
+ "page": {
641
+ "type": "number",
642
+ "description": "The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\""
643
+ }
644
+ },
645
+ "required": [
646
+ "owner",
647
+ "repo",
648
+ "pull_number"
649
+ ]
650
+ }
651
+ },
652
+ {
653
+ "name": "pulls_list_files",
654
+ "description": "List pull requests files",
655
+ "method": "GET",
656
+ "path": "/repos/{owner}/{repo}/pulls/{pull_number}/files",
657
+ "deleteSendsJsonBody": false,
658
+ "inputSchema": {
659
+ "type": "object",
660
+ "properties": {
661
+ "owner": {
662
+ "type": "string",
663
+ "description": "The account owner of the repository. The name is not case sensitive."
664
+ },
665
+ "repo": {
666
+ "type": "string",
667
+ "description": "The name of the repository without the `.git` extension. The name is not case sensitive."
668
+ },
669
+ "pull_number": {
670
+ "type": "number",
671
+ "description": "The number that identifies the pull request."
672
+ },
673
+ "per_page": {
674
+ "type": "number",
675
+ "description": "The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\""
676
+ },
677
+ "page": {
678
+ "type": "number",
679
+ "description": "The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\""
680
+ }
681
+ },
682
+ "required": [
683
+ "owner",
684
+ "repo",
685
+ "pull_number"
686
+ ]
687
+ }
688
+ },
689
+ {
690
+ "name": "pulls_check_if_merged",
691
+ "description": "Check if a pull request has been merged",
692
+ "method": "GET",
693
+ "path": "/repos/{owner}/{repo}/pulls/{pull_number}/merge",
694
+ "deleteSendsJsonBody": false,
695
+ "inputSchema": {
696
+ "type": "object",
697
+ "properties": {
698
+ "owner": {
699
+ "type": "string",
700
+ "description": "The account owner of the repository. The name is not case sensitive."
701
+ },
702
+ "repo": {
703
+ "type": "string",
704
+ "description": "The name of the repository without the `.git` extension. The name is not case sensitive."
705
+ },
706
+ "pull_number": {
707
+ "type": "number",
708
+ "description": "The number that identifies the pull request."
709
+ }
710
+ },
711
+ "required": [
712
+ "owner",
713
+ "repo",
714
+ "pull_number"
715
+ ]
716
+ }
717
+ },
718
+ {
719
+ "name": "pulls_merge",
720
+ "description": "Merge a pull request",
721
+ "method": "PUT",
722
+ "path": "/repos/{owner}/{repo}/pulls/{pull_number}/merge",
723
+ "deleteSendsJsonBody": false,
724
+ "inputSchema": {
725
+ "type": "object",
726
+ "properties": {
727
+ "owner": {
728
+ "type": "string",
729
+ "description": "The account owner of the repository. The name is not case sensitive."
730
+ },
731
+ "repo": {
732
+ "type": "string",
733
+ "description": "The name of the repository without the `.git` extension. The name is not case sensitive."
734
+ },
735
+ "pull_number": {
736
+ "type": "number",
737
+ "description": "The number that identifies the pull request."
738
+ },
739
+ "commit_title": {
740
+ "type": "string",
741
+ "description": "Title for the automatic commit message."
742
+ },
743
+ "commit_message": {
744
+ "type": "string",
745
+ "description": "Extra detail to append to automatic commit message."
746
+ },
747
+ "sha": {
748
+ "type": "string",
749
+ "description": "SHA that pull request head must match to allow merge."
750
+ },
751
+ "merge_method": {
752
+ "type": "string",
753
+ "description": "The merge method to use.",
754
+ "enum": [
755
+ "merge",
756
+ "squash",
757
+ "rebase"
758
+ ]
759
+ }
760
+ },
761
+ "required": [
762
+ "owner",
763
+ "repo",
764
+ "pull_number"
765
+ ]
766
+ }
767
+ },
768
+ {
769
+ "name": "pulls_list_requested_reviewers",
770
+ "description": "Get all requested reviewers for a pull request",
771
+ "method": "GET",
772
+ "path": "/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers",
773
+ "deleteSendsJsonBody": false,
774
+ "inputSchema": {
775
+ "type": "object",
776
+ "properties": {
777
+ "owner": {
778
+ "type": "string",
779
+ "description": "The account owner of the repository. The name is not case sensitive."
780
+ },
781
+ "repo": {
782
+ "type": "string",
783
+ "description": "The name of the repository without the `.git` extension. The name is not case sensitive."
784
+ },
785
+ "pull_number": {
786
+ "type": "number",
787
+ "description": "The number that identifies the pull request."
788
+ }
789
+ },
790
+ "required": [
791
+ "owner",
792
+ "repo",
793
+ "pull_number"
794
+ ]
795
+ }
796
+ },
797
+ {
798
+ "name": "pulls_request_reviewers",
799
+ "description": "Request reviewers for a pull request",
800
+ "method": "POST",
801
+ "path": "/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers",
802
+ "deleteSendsJsonBody": false,
803
+ "inputSchema": {
804
+ "type": "object",
805
+ "properties": {
806
+ "owner": {
807
+ "type": "string",
808
+ "description": "The account owner of the repository. The name is not case sensitive."
809
+ },
810
+ "repo": {
811
+ "type": "string",
812
+ "description": "The name of the repository without the `.git` extension. The name is not case sensitive."
813
+ },
814
+ "pull_number": {
815
+ "type": "number",
816
+ "description": "The number that identifies the pull request."
817
+ },
818
+ "reviewers": {
819
+ "type": "array",
820
+ "description": "An array of user `login`s that will be requested."
821
+ },
822
+ "team_reviewers": {
823
+ "type": "array",
824
+ "description": "An array of team `slug`s that will be requested."
825
+ }
826
+ },
827
+ "required": [
828
+ "owner",
829
+ "repo",
830
+ "pull_number"
831
+ ]
832
+ }
833
+ },
834
+ {
835
+ "name": "pulls_remove_requested_reviewers",
836
+ "description": "Remove requested reviewers from a pull request",
837
+ "method": "DELETE",
838
+ "path": "/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers",
839
+ "deleteSendsJsonBody": true,
840
+ "inputSchema": {
841
+ "type": "object",
842
+ "properties": {
843
+ "owner": {
844
+ "type": "string",
845
+ "description": "The account owner of the repository. The name is not case sensitive."
846
+ },
847
+ "repo": {
848
+ "type": "string",
849
+ "description": "The name of the repository without the `.git` extension. The name is not case sensitive."
850
+ },
851
+ "pull_number": {
852
+ "type": "number",
853
+ "description": "The number that identifies the pull request."
854
+ },
855
+ "reviewers": {
856
+ "type": "array",
857
+ "description": "An array of user `login`s that will be removed."
858
+ },
859
+ "team_reviewers": {
860
+ "type": "array",
861
+ "description": "An array of team `slug`s that will be removed."
862
+ }
863
+ },
864
+ "required": [
865
+ "owner",
866
+ "repo",
867
+ "pull_number",
868
+ "reviewers"
869
+ ]
870
+ }
871
+ },
872
+ {
873
+ "name": "pulls_list_reviews",
874
+ "description": "List reviews for a pull request",
875
+ "method": "GET",
876
+ "path": "/repos/{owner}/{repo}/pulls/{pull_number}/reviews",
877
+ "deleteSendsJsonBody": false,
878
+ "inputSchema": {
879
+ "type": "object",
880
+ "properties": {
881
+ "owner": {
882
+ "type": "string",
883
+ "description": "The account owner of the repository. The name is not case sensitive."
884
+ },
885
+ "repo": {
886
+ "type": "string",
887
+ "description": "The name of the repository without the `.git` extension. The name is not case sensitive."
888
+ },
889
+ "pull_number": {
890
+ "type": "number",
891
+ "description": "The number that identifies the pull request."
892
+ },
893
+ "per_page": {
894
+ "type": "number",
895
+ "description": "The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\""
896
+ },
897
+ "page": {
898
+ "type": "number",
899
+ "description": "The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\""
900
+ }
901
+ },
902
+ "required": [
903
+ "owner",
904
+ "repo",
905
+ "pull_number"
906
+ ]
907
+ }
908
+ },
909
+ {
910
+ "name": "pulls_create_review",
911
+ "description": "Create a review for a pull request",
912
+ "method": "POST",
913
+ "path": "/repos/{owner}/{repo}/pulls/{pull_number}/reviews",
914
+ "deleteSendsJsonBody": false,
915
+ "inputSchema": {
916
+ "type": "object",
917
+ "properties": {
918
+ "owner": {
919
+ "type": "string",
920
+ "description": "The account owner of the repository. The name is not case sensitive."
921
+ },
922
+ "repo": {
923
+ "type": "string",
924
+ "description": "The name of the repository without the `.git` extension. The name is not case sensitive."
925
+ },
926
+ "pull_number": {
927
+ "type": "number",
928
+ "description": "The number that identifies the pull request."
929
+ },
930
+ "commit_id": {
931
+ "type": "string",
932
+ "description": "The SHA of the commit that needs a review. Not using the latest commit SHA may render your review comment outdated if a subsequent commit modifies the line you specify as the `position`. Defaults to the most recent commit in the pull request when you do not specify a value."
933
+ },
934
+ "body": {
935
+ "type": "string",
936
+ "description": "**Required** when using `REQUEST_CHANGES` or `COMMENT` for the `event` parameter. The body text of the pull request review."
937
+ },
938
+ "event": {
939
+ "type": "string",
940
+ "description": "The review action you want to perform. The review actions include: `APPROVE`, `REQUEST_CHANGES`, or `COMMENT`. By leaving this blank, you set the review action state to `PENDING`, which means you will need to [submit the pull request review](https://docs.github.com/rest/pulls/reviews#submit-a-review-for-a-pull-request) when you are ready.",
941
+ "enum": [
942
+ "APPROVE",
943
+ "REQUEST_CHANGES",
944
+ "COMMENT"
945
+ ]
946
+ },
947
+ "comments": {
948
+ "type": "array",
949
+ "description": "Use the following table to specify the location, destination, and contents of the draft review comment."
950
+ }
951
+ },
952
+ "required": [
953
+ "owner",
954
+ "repo",
955
+ "pull_number"
956
+ ]
957
+ }
958
+ },
959
+ {
960
+ "name": "pulls_get_review",
961
+ "description": "Get a review for a pull request",
962
+ "method": "GET",
963
+ "path": "/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}",
964
+ "deleteSendsJsonBody": false,
965
+ "inputSchema": {
966
+ "type": "object",
967
+ "properties": {
968
+ "owner": {
969
+ "type": "string",
970
+ "description": "The account owner of the repository. The name is not case sensitive."
971
+ },
972
+ "repo": {
973
+ "type": "string",
974
+ "description": "The name of the repository without the `.git` extension. The name is not case sensitive."
975
+ },
976
+ "pull_number": {
977
+ "type": "number",
978
+ "description": "The number that identifies the pull request."
979
+ },
980
+ "review_id": {
981
+ "type": "number",
982
+ "description": "The unique identifier of the review."
983
+ }
984
+ },
985
+ "required": [
986
+ "owner",
987
+ "repo",
988
+ "pull_number",
989
+ "review_id"
990
+ ]
991
+ }
992
+ },
993
+ {
994
+ "name": "pulls_update_review",
995
+ "description": "Update a review for a pull request",
996
+ "method": "PUT",
997
+ "path": "/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}",
998
+ "deleteSendsJsonBody": false,
999
+ "inputSchema": {
1000
+ "type": "object",
1001
+ "properties": {
1002
+ "owner": {
1003
+ "type": "string",
1004
+ "description": "The account owner of the repository. The name is not case sensitive."
1005
+ },
1006
+ "repo": {
1007
+ "type": "string",
1008
+ "description": "The name of the repository without the `.git` extension. The name is not case sensitive."
1009
+ },
1010
+ "pull_number": {
1011
+ "type": "number",
1012
+ "description": "The number that identifies the pull request."
1013
+ },
1014
+ "review_id": {
1015
+ "type": "number",
1016
+ "description": "The unique identifier of the review."
1017
+ },
1018
+ "body": {
1019
+ "type": "string",
1020
+ "description": "The body text of the pull request review."
1021
+ }
1022
+ },
1023
+ "required": [
1024
+ "owner",
1025
+ "repo",
1026
+ "pull_number",
1027
+ "review_id",
1028
+ "body"
1029
+ ]
1030
+ }
1031
+ },
1032
+ {
1033
+ "name": "pulls_delete_pending_review",
1034
+ "description": "Delete a pending review for a pull request",
1035
+ "method": "DELETE",
1036
+ "path": "/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}",
1037
+ "deleteSendsJsonBody": false,
1038
+ "inputSchema": {
1039
+ "type": "object",
1040
+ "properties": {
1041
+ "owner": {
1042
+ "type": "string",
1043
+ "description": "The account owner of the repository. The name is not case sensitive."
1044
+ },
1045
+ "repo": {
1046
+ "type": "string",
1047
+ "description": "The name of the repository without the `.git` extension. The name is not case sensitive."
1048
+ },
1049
+ "pull_number": {
1050
+ "type": "number",
1051
+ "description": "The number that identifies the pull request."
1052
+ },
1053
+ "review_id": {
1054
+ "type": "number",
1055
+ "description": "The unique identifier of the review."
1056
+ }
1057
+ },
1058
+ "required": [
1059
+ "owner",
1060
+ "repo",
1061
+ "pull_number",
1062
+ "review_id"
1063
+ ]
1064
+ }
1065
+ },
1066
+ {
1067
+ "name": "pulls_list_comments_for_review",
1068
+ "description": "List comments for a pull request review",
1069
+ "method": "GET",
1070
+ "path": "/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments",
1071
+ "deleteSendsJsonBody": false,
1072
+ "inputSchema": {
1073
+ "type": "object",
1074
+ "properties": {
1075
+ "owner": {
1076
+ "type": "string",
1077
+ "description": "The account owner of the repository. The name is not case sensitive."
1078
+ },
1079
+ "repo": {
1080
+ "type": "string",
1081
+ "description": "The name of the repository without the `.git` extension. The name is not case sensitive."
1082
+ },
1083
+ "pull_number": {
1084
+ "type": "number",
1085
+ "description": "The number that identifies the pull request."
1086
+ },
1087
+ "review_id": {
1088
+ "type": "number",
1089
+ "description": "The unique identifier of the review."
1090
+ },
1091
+ "per_page": {
1092
+ "type": "number",
1093
+ "description": "The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\""
1094
+ },
1095
+ "page": {
1096
+ "type": "number",
1097
+ "description": "The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\""
1098
+ }
1099
+ },
1100
+ "required": [
1101
+ "owner",
1102
+ "repo",
1103
+ "pull_number",
1104
+ "review_id"
1105
+ ]
1106
+ }
1107
+ },
1108
+ {
1109
+ "name": "pulls_dismiss_review",
1110
+ "description": "Dismiss a review for a pull request",
1111
+ "method": "PUT",
1112
+ "path": "/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals",
1113
+ "deleteSendsJsonBody": false,
1114
+ "inputSchema": {
1115
+ "type": "object",
1116
+ "properties": {
1117
+ "owner": {
1118
+ "type": "string",
1119
+ "description": "The account owner of the repository. The name is not case sensitive."
1120
+ },
1121
+ "repo": {
1122
+ "type": "string",
1123
+ "description": "The name of the repository without the `.git` extension. The name is not case sensitive."
1124
+ },
1125
+ "pull_number": {
1126
+ "type": "number",
1127
+ "description": "The number that identifies the pull request."
1128
+ },
1129
+ "review_id": {
1130
+ "type": "number",
1131
+ "description": "The unique identifier of the review."
1132
+ },
1133
+ "message": {
1134
+ "type": "string",
1135
+ "description": "The message for the pull request review dismissal"
1136
+ },
1137
+ "event": {
1138
+ "type": "string",
1139
+ "description": "The event field",
1140
+ "enum": [
1141
+ "DISMISS"
1142
+ ]
1143
+ }
1144
+ },
1145
+ "required": [
1146
+ "owner",
1147
+ "repo",
1148
+ "pull_number",
1149
+ "review_id",
1150
+ "message"
1151
+ ]
1152
+ }
1153
+ },
1154
+ {
1155
+ "name": "pulls_submit_review",
1156
+ "description": "Submit a review for a pull request",
1157
+ "method": "POST",
1158
+ "path": "/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events",
1159
+ "deleteSendsJsonBody": false,
1160
+ "inputSchema": {
1161
+ "type": "object",
1162
+ "properties": {
1163
+ "owner": {
1164
+ "type": "string",
1165
+ "description": "The account owner of the repository. The name is not case sensitive."
1166
+ },
1167
+ "repo": {
1168
+ "type": "string",
1169
+ "description": "The name of the repository without the `.git` extension. The name is not case sensitive."
1170
+ },
1171
+ "pull_number": {
1172
+ "type": "number",
1173
+ "description": "The number that identifies the pull request."
1174
+ },
1175
+ "review_id": {
1176
+ "type": "number",
1177
+ "description": "The unique identifier of the review."
1178
+ },
1179
+ "body": {
1180
+ "type": "string",
1181
+ "description": "The body text of the pull request review"
1182
+ },
1183
+ "event": {
1184
+ "type": "string",
1185
+ "description": "The review action you want to perform. The review actions include: `APPROVE`, `REQUEST_CHANGES`, or `COMMENT`. When you leave this blank, the API returns _HTTP 422 (Unrecognizable entity)_ and sets the review action state to `PENDING`, which means you will need to re-submit the pull request review using a review action.",
1186
+ "enum": [
1187
+ "APPROVE",
1188
+ "REQUEST_CHANGES",
1189
+ "COMMENT"
1190
+ ]
1191
+ }
1192
+ },
1193
+ "required": [
1194
+ "owner",
1195
+ "repo",
1196
+ "pull_number",
1197
+ "review_id",
1198
+ "event"
1199
+ ]
1200
+ }
1201
+ },
1202
+ {
1203
+ "name": "pulls_update_branch",
1204
+ "description": "Update a pull request branch",
1205
+ "method": "PUT",
1206
+ "path": "/repos/{owner}/{repo}/pulls/{pull_number}/update-branch",
1207
+ "deleteSendsJsonBody": false,
1208
+ "inputSchema": {
1209
+ "type": "object",
1210
+ "properties": {
1211
+ "owner": {
1212
+ "type": "string",
1213
+ "description": "The account owner of the repository. The name is not case sensitive."
1214
+ },
1215
+ "repo": {
1216
+ "type": "string",
1217
+ "description": "The name of the repository without the `.git` extension. The name is not case sensitive."
1218
+ },
1219
+ "pull_number": {
1220
+ "type": "number",
1221
+ "description": "The number that identifies the pull request."
1222
+ },
1223
+ "expected_head_sha": {
1224
+ "type": "string",
1225
+ "description": "The expected SHA of the pull request's HEAD ref. This is the most recent commit on the pull request's branch. If the expected SHA does not match the pull request's HEAD, you will receive a `422 Unprocessable Entity` status. You can use the \"[List commits](https://docs.github.com/rest/commits/commits#list-commits)\" endpoint to find the most recent commit SHA. Default: SHA of the pull request's current HEAD ref."
1226
+ }
1227
+ },
1228
+ "required": [
1229
+ "owner",
1230
+ "repo",
1231
+ "pull_number"
1232
+ ]
1233
+ }
1234
+ }
1235
+ ];
1236
+
1237
+ export const tools = ENDPOINTS.map((e) => ({
1238
+ name: e.name,
1239
+ description: e.description,
1240
+ method: e.method,
1241
+ path: e.path,
1242
+ deleteSendsJsonBody: Boolean(e.deleteSendsJsonBody),
1243
+ inputSchema: e.inputSchema,
1244
+ handler: async (params) => {
1245
+ const result = await apiRequest(e.method, e.path, params, {
1246
+ deleteSendsJsonBody: e.deleteSendsJsonBody,
1247
+ });
1248
+ return {
1249
+ content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
1250
+ };
1251
+ },
1252
+ }));