@digitalocean/mcp 0.0.13 → 1.0.0-aplha.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.
- package/README.md +2 -190
- package/dist/app-create-schema.json +1946 -0
- package/dist/app-update-schema.json +1957 -0
- package/dist/mcp-digitalocean-darwin-amd64 +0 -0
- package/dist/mcp-digitalocean-darwin-arm64 +0 -0
- package/dist/mcp-digitalocean-linux-386 +0 -0
- package/dist/mcp-digitalocean-linux-amd64 +0 -0
- package/dist/mcp-digitalocean-linux-arm +0 -0
- package/dist/mcp-digitalocean-linux-arm64 +0 -0
- package/dist/mcp-digitalocean-windows-386.exe +0 -0
- package/dist/mcp-digitalocean-windows-amd64.exe +0 -0
- package/dist/mcp-digitalocean-windows-arm.exe +0 -0
- package/dist/mcp-digitalocean-windows-arm64.exe +0 -0
- package/index.js +87 -0
- package/package.json +35 -29
- package/build/DOMcpServer.js +0 -18
- package/build/api.js +0 -95
- package/build/index.js +0 -18
- package/build/index.js.map +0 -7
- package/build/logger.js +0 -47
- package/build/server.js +0 -29
- package/build/specs/digitalocean-openapi.yaml.zod.js +0 -10231
- package/build/tools/app.js +0 -613
- package/build/tools/databases.js +0 -306
- package/build/version.js +0 -5
package/build/tools/app.js
DELETED
|
@@ -1,613 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.registerAppTools = registerAppTools;
|
|
4
|
-
const digitalocean_openapi_yaml_zod_1 = require("../specs/digitalocean-openapi.yaml.zod");
|
|
5
|
-
const api_1 = require("../api");
|
|
6
|
-
const zod_1 = require("zod");
|
|
7
|
-
const ListApps = {
|
|
8
|
-
name: "list_apps",
|
|
9
|
-
description: `
|
|
10
|
-
List all apps on your account. Information about the current active
|
|
11
|
-
deployment as well as any in progress ones will also be included for
|
|
12
|
-
each app.
|
|
13
|
-
`,
|
|
14
|
-
parameters: digitalocean_openapi_yaml_zod_1.get_Apps_list.parameters.shape,
|
|
15
|
-
cb: async (params, extra) => {
|
|
16
|
-
const { client } = (0, api_1.createClient)(extra);
|
|
17
|
-
const res = await client.get("/v2/apps", {
|
|
18
|
-
query: params.query,
|
|
19
|
-
});
|
|
20
|
-
const apps = res.apps ?? [];
|
|
21
|
-
if (apps.length === 0) {
|
|
22
|
-
return {
|
|
23
|
-
content: [{ type: "text", text: "No apps found" }],
|
|
24
|
-
isError: true,
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
const content = [];
|
|
28
|
-
apps.forEach((app) => {
|
|
29
|
-
content.push({
|
|
30
|
-
type: "text",
|
|
31
|
-
text: `App ID: ${app.id}\nName: ${app.spec.name}\nRegion: ${app.spec.region}\n`,
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
return {
|
|
35
|
-
content,
|
|
36
|
-
_meta: {
|
|
37
|
-
links: res.links,
|
|
38
|
-
meta: res.meta,
|
|
39
|
-
},
|
|
40
|
-
};
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
const CreateApp = {
|
|
44
|
-
name: "create_app",
|
|
45
|
-
description: `
|
|
46
|
-
Create a new app by submitting an app specification. For documentation
|
|
47
|
-
on app specifications ("AppSpec" objects), please refer to [the product
|
|
48
|
-
documentation](https://docs.digitalocean.com/products/app-platform/reference/app-spec/).
|
|
49
|
-
`,
|
|
50
|
-
parameters: digitalocean_openapi_yaml_zod_1.post_Apps_create.parameters.shape,
|
|
51
|
-
cb: async (params, extra) => {
|
|
52
|
-
try {
|
|
53
|
-
const { client } = (0, api_1.createClient)(extra);
|
|
54
|
-
const res = await client.post("/v2/apps", params);
|
|
55
|
-
return {
|
|
56
|
-
content: [{ type: "text", text: JSON.stringify(res.app, null, 2) }],
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
catch (error) {
|
|
60
|
-
return {
|
|
61
|
-
content: [{ type: "text", text: `Error creating app: ${error}` }],
|
|
62
|
-
isError: true,
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
};
|
|
67
|
-
const GetApp = {
|
|
68
|
-
name: "get_app",
|
|
69
|
-
description: "Get an app by ID",
|
|
70
|
-
parameters: digitalocean_openapi_yaml_zod_1.get_Apps_get.parameters.shape,
|
|
71
|
-
cb: async (params, extra) => {
|
|
72
|
-
try {
|
|
73
|
-
const { client } = (0, api_1.createClient)(extra);
|
|
74
|
-
const res = await client.get(`/v2/apps/{id}`, {
|
|
75
|
-
query: {},
|
|
76
|
-
path: params.path,
|
|
77
|
-
});
|
|
78
|
-
return {
|
|
79
|
-
content: [{ type: "text", text: JSON.stringify(res.app, null, 2) }],
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
catch (error) {
|
|
83
|
-
return {
|
|
84
|
-
content: [{ type: "text", text: `Error getting app: ${error}` }],
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
};
|
|
89
|
-
const UpdateApp = {
|
|
90
|
-
name: "update_app",
|
|
91
|
-
description: `
|
|
92
|
-
Update an existing app by submitting a new app specification. For
|
|
93
|
-
documentation on app specifications ("AppSpec" objects), please refer to
|
|
94
|
-
[the product documentation](https://docs.digitalocean.com/products/app-platform/reference/app-spec/).
|
|
95
|
-
`,
|
|
96
|
-
parameters: digitalocean_openapi_yaml_zod_1.put_Apps_update.parameters.shape,
|
|
97
|
-
cb: async (params, extra) => {
|
|
98
|
-
try {
|
|
99
|
-
const { client } = (0, api_1.createClient)(extra);
|
|
100
|
-
const res = await client.put(`/v2/apps/{id}`, params);
|
|
101
|
-
const app = res.app;
|
|
102
|
-
return {
|
|
103
|
-
content: [{ type: "text", text: JSON.stringify(app, null, 2) }],
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
catch (error) {
|
|
107
|
-
return {
|
|
108
|
-
content: [{ type: "text", text: `Error updating app: ${error}` }],
|
|
109
|
-
isError: true,
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
};
|
|
114
|
-
const DeleteApp = {
|
|
115
|
-
name: "delete_app",
|
|
116
|
-
description: "Delete an app by ID",
|
|
117
|
-
parameters: digitalocean_openapi_yaml_zod_1.delete_Apps_delete.parameters.shape,
|
|
118
|
-
cb: async (params, extra) => {
|
|
119
|
-
try {
|
|
120
|
-
const { client } = (0, api_1.createClient)(extra);
|
|
121
|
-
const res = await client.delete(`/v2/apps/{id}`, params);
|
|
122
|
-
return {
|
|
123
|
-
content: [{ type: "text", text: "Add successfully deleted" }],
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
catch (error) {
|
|
127
|
-
return {
|
|
128
|
-
content: [{ type: "text", text: `Error deleting app: ${error}` }],
|
|
129
|
-
isError: true,
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
},
|
|
133
|
-
};
|
|
134
|
-
const GetDeploymentLogsUrlSchema = zod_1.z.object({
|
|
135
|
-
deployment_id: zod_1.z
|
|
136
|
-
.string()
|
|
137
|
-
.describe("The ID of the deployment. If not provided, the active deployment will be used.")
|
|
138
|
-
.optional(),
|
|
139
|
-
type: zod_1.z.enum(["BUILD", "DEPLOY", "RUN", "RUN_RESTARTED"]),
|
|
140
|
-
app_id: zod_1.z.string().describe("The ID of the app."),
|
|
141
|
-
});
|
|
142
|
-
const GetDeploymentLogsUrl = {
|
|
143
|
-
name: "get_deployment_logs_url",
|
|
144
|
-
description: `
|
|
145
|
-
Gets the URL of the logs for a deployment. Before fetching the logs, you need to
|
|
146
|
-
get the URL of the logs.
|
|
147
|
-
`,
|
|
148
|
-
parameters: GetDeploymentLogsUrlSchema.shape,
|
|
149
|
-
cb: async (params, extra) => {
|
|
150
|
-
try {
|
|
151
|
-
const { client } = (0, api_1.createClient)(extra);
|
|
152
|
-
let content = [];
|
|
153
|
-
if (params.deployment_id) {
|
|
154
|
-
const res = await client.get(`/v2/apps/{app_id}/deployments/{deployment_id}/logs`, {
|
|
155
|
-
query: {
|
|
156
|
-
type: params.type,
|
|
157
|
-
},
|
|
158
|
-
path: {
|
|
159
|
-
app_id: params.app_id,
|
|
160
|
-
deployment_id: params.deployment_id,
|
|
161
|
-
},
|
|
162
|
-
});
|
|
163
|
-
content.push({
|
|
164
|
-
type: "text",
|
|
165
|
-
text: JSON.stringify(res, null, 2),
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
else {
|
|
169
|
-
const res = await client.get(`/v2/apps/{app_id}/logs`, {
|
|
170
|
-
query: {
|
|
171
|
-
type: params.type,
|
|
172
|
-
},
|
|
173
|
-
path: {
|
|
174
|
-
app_id: params.app_id,
|
|
175
|
-
},
|
|
176
|
-
});
|
|
177
|
-
content.push({
|
|
178
|
-
type: "text",
|
|
179
|
-
text: JSON.stringify(res, null, 2),
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
return {
|
|
183
|
-
content,
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
catch (error) {
|
|
187
|
-
return {
|
|
188
|
-
content: [{ type: "text", text: `Error getting logs: ${error}` }],
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
},
|
|
192
|
-
};
|
|
193
|
-
const DownloadLogsSchema = zod_1.z.object({
|
|
194
|
-
url: zod_1.z.string().describe("The URL to the bucket containing the logs"),
|
|
195
|
-
});
|
|
196
|
-
const DownloadLogs = {
|
|
197
|
-
name: "download_logs",
|
|
198
|
-
description: `
|
|
199
|
-
Give the URL of the logs, download the logs and return them as a string.
|
|
200
|
-
`,
|
|
201
|
-
parameters: DownloadLogsSchema.shape,
|
|
202
|
-
cb: async (params, extra) => {
|
|
203
|
-
try {
|
|
204
|
-
const res = await fetch(params.url);
|
|
205
|
-
const text = await res.text();
|
|
206
|
-
return {
|
|
207
|
-
content: [{ type: "text", text }],
|
|
208
|
-
};
|
|
209
|
-
}
|
|
210
|
-
catch (error) {
|
|
211
|
-
return {
|
|
212
|
-
content: [{ type: "text", text: `Error getting logs: ${error}` }],
|
|
213
|
-
isError: true,
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
},
|
|
217
|
-
};
|
|
218
|
-
const ListDeployments = {
|
|
219
|
-
name: "list_deployments",
|
|
220
|
-
description: "List all deployments for an app",
|
|
221
|
-
parameters: digitalocean_openapi_yaml_zod_1.get_Apps_list_deployments.parameters.shape,
|
|
222
|
-
cb: async (params, extra) => {
|
|
223
|
-
try {
|
|
224
|
-
const { client } = (0, api_1.createClient)(extra);
|
|
225
|
-
const res = await client.get(`/v2/apps/{app_id}/deployments`, params);
|
|
226
|
-
const deployments = res.deployments ?? [];
|
|
227
|
-
const content = [];
|
|
228
|
-
deployments.forEach((deployment) => {
|
|
229
|
-
content.push({
|
|
230
|
-
type: "text",
|
|
231
|
-
text: `Deployment ID: ${deployment.id}\nStatus: ${deployment.phase}\nCreated At: ${deployment.created_at}\nUpdated At: ${deployment.updated_at}\n `,
|
|
232
|
-
});
|
|
233
|
-
});
|
|
234
|
-
content.push({
|
|
235
|
-
type: "text",
|
|
236
|
-
text: `${JSON.stringify(res.links, null, 2)}`,
|
|
237
|
-
});
|
|
238
|
-
return {
|
|
239
|
-
content,
|
|
240
|
-
};
|
|
241
|
-
}
|
|
242
|
-
catch (error) {
|
|
243
|
-
return {
|
|
244
|
-
content: [
|
|
245
|
-
{ type: "text", text: `Error listing deployments: ${error}` },
|
|
246
|
-
],
|
|
247
|
-
isError: true,
|
|
248
|
-
};
|
|
249
|
-
}
|
|
250
|
-
},
|
|
251
|
-
};
|
|
252
|
-
const CreateDeployment = {
|
|
253
|
-
name: "create_deployment",
|
|
254
|
-
description: "Create a new deployment for an app",
|
|
255
|
-
parameters: digitalocean_openapi_yaml_zod_1.post_Apps_create_deployment.parameters.shape,
|
|
256
|
-
cb: async (params, extra) => {
|
|
257
|
-
try {
|
|
258
|
-
const { client } = (0, api_1.createClient)(extra);
|
|
259
|
-
const res = await client.post(`/v2/apps/{app_id}/deployments`, params);
|
|
260
|
-
const deployment = res.deployment;
|
|
261
|
-
return {
|
|
262
|
-
content: [{ type: "text", text: JSON.stringify(deployment) }],
|
|
263
|
-
};
|
|
264
|
-
}
|
|
265
|
-
catch (error) {
|
|
266
|
-
return {
|
|
267
|
-
content: [
|
|
268
|
-
{ type: "text", text: `Error creating deployment: ${error}` },
|
|
269
|
-
],
|
|
270
|
-
isError: true,
|
|
271
|
-
};
|
|
272
|
-
}
|
|
273
|
-
},
|
|
274
|
-
};
|
|
275
|
-
const GetDeployment = {
|
|
276
|
-
name: "get_deployment",
|
|
277
|
-
description: "Get a deployment by ID",
|
|
278
|
-
parameters: digitalocean_openapi_yaml_zod_1.get_Apps_get_deployment.parameters.shape,
|
|
279
|
-
cb: async (params, extra) => {
|
|
280
|
-
try {
|
|
281
|
-
const { client } = (0, api_1.createClient)(extra);
|
|
282
|
-
const res = await client.get(`/v2/apps/{app_id}/deployments/{deployment_id}`, params);
|
|
283
|
-
const deployment = res.deployment;
|
|
284
|
-
return {
|
|
285
|
-
content: [{ type: "text", text: JSON.stringify(deployment) }],
|
|
286
|
-
};
|
|
287
|
-
}
|
|
288
|
-
catch (error) {
|
|
289
|
-
return {
|
|
290
|
-
content: [
|
|
291
|
-
{ type: "text", text: `Error getting deployment: ${error}` },
|
|
292
|
-
],
|
|
293
|
-
isError: true,
|
|
294
|
-
};
|
|
295
|
-
}
|
|
296
|
-
},
|
|
297
|
-
};
|
|
298
|
-
const CancelDeployment = {
|
|
299
|
-
name: "cancel_deployment",
|
|
300
|
-
description: "Cancel a deployment by ID",
|
|
301
|
-
parameters: digitalocean_openapi_yaml_zod_1.post_Apps_cancel_deployment.parameters.shape,
|
|
302
|
-
cb: async (params, extra) => {
|
|
303
|
-
try {
|
|
304
|
-
const { client } = (0, api_1.createClient)(extra);
|
|
305
|
-
const res = await client.post(`/v2/apps/{app_id}/deployments/{deployment_id}/cancel`, params);
|
|
306
|
-
return {
|
|
307
|
-
content: [{ type: "text", text: JSON.stringify(res) }],
|
|
308
|
-
};
|
|
309
|
-
}
|
|
310
|
-
catch (error) {
|
|
311
|
-
return {
|
|
312
|
-
content: [
|
|
313
|
-
{ type: "text", text: `Error canceling deployment: ${error}` },
|
|
314
|
-
],
|
|
315
|
-
};
|
|
316
|
-
}
|
|
317
|
-
},
|
|
318
|
-
};
|
|
319
|
-
const ListInstanceSizes = {
|
|
320
|
-
name: "list_instance_sizes",
|
|
321
|
-
description: "List all instance sizes for `service`, `worker`, and `job` components supported by App Platform.",
|
|
322
|
-
parameters: undefined,
|
|
323
|
-
cb: async (extra) => {
|
|
324
|
-
try {
|
|
325
|
-
const { client } = (0, api_1.createClient)(extra);
|
|
326
|
-
const res = await client.get("/v2/apps/tiers/instance_sizes");
|
|
327
|
-
const instanceSizes = res.instance_sizes ?? [];
|
|
328
|
-
const content = [];
|
|
329
|
-
instanceSizes.forEach((instanceSize) => {
|
|
330
|
-
content.push({
|
|
331
|
-
type: "text",
|
|
332
|
-
text: `${JSON.stringify(instanceSize, null, 2)}`,
|
|
333
|
-
});
|
|
334
|
-
});
|
|
335
|
-
return {
|
|
336
|
-
content,
|
|
337
|
-
_meta: {
|
|
338
|
-
instanceSizes,
|
|
339
|
-
},
|
|
340
|
-
};
|
|
341
|
-
}
|
|
342
|
-
catch (error) {
|
|
343
|
-
return {
|
|
344
|
-
content: [
|
|
345
|
-
{ type: "text", text: `Error listing instance sizes: ${error}` },
|
|
346
|
-
],
|
|
347
|
-
isError: true,
|
|
348
|
-
};
|
|
349
|
-
}
|
|
350
|
-
},
|
|
351
|
-
};
|
|
352
|
-
const GetInstanceSizeBySlug = {
|
|
353
|
-
name: "get_instance_size_by_slug",
|
|
354
|
-
description: "Retrieve information about a specific instance size slug for `service`,`worker`, and `job` components.",
|
|
355
|
-
parameters: digitalocean_openapi_yaml_zod_1.get_Apps_get_instanceSize.parameters.shape,
|
|
356
|
-
cb: async (params, extra) => {
|
|
357
|
-
try {
|
|
358
|
-
const { client } = (0, api_1.createClient)(extra);
|
|
359
|
-
const res = await client.get(`/v2/apps/tiers/instance_sizes/{slug}`, params);
|
|
360
|
-
return {
|
|
361
|
-
content: [{ type: "text", text: JSON.stringify(res.instance_size) }],
|
|
362
|
-
};
|
|
363
|
-
}
|
|
364
|
-
catch (error) {
|
|
365
|
-
return {
|
|
366
|
-
content: [
|
|
367
|
-
{ type: "text", text: `Error getting instance size: ${error}` },
|
|
368
|
-
],
|
|
369
|
-
isError: true,
|
|
370
|
-
};
|
|
371
|
-
}
|
|
372
|
-
},
|
|
373
|
-
};
|
|
374
|
-
const ListRegions = {
|
|
375
|
-
name: "list_app_regions",
|
|
376
|
-
description: "List all regions supported by App Platform.",
|
|
377
|
-
cb: async (extra) => {
|
|
378
|
-
try {
|
|
379
|
-
const { client } = (0, api_1.createClient)(extra);
|
|
380
|
-
const res = await client.get("/v2/apps/regions");
|
|
381
|
-
const regions = res.regions ?? [];
|
|
382
|
-
const content = [];
|
|
383
|
-
regions.forEach((region) => {
|
|
384
|
-
content.push({
|
|
385
|
-
type: "text",
|
|
386
|
-
text: `Region: ${region.label}
|
|
387
|
-
Slug: ${region.slug}
|
|
388
|
-
Continent: ${region.continent}
|
|
389
|
-
Default: ${region.default ? "Yes" : "No"}
|
|
390
|
-
Disabled: ${region.disabled ? "Yes" : "No"}
|
|
391
|
-
`,
|
|
392
|
-
});
|
|
393
|
-
});
|
|
394
|
-
return {
|
|
395
|
-
content,
|
|
396
|
-
};
|
|
397
|
-
}
|
|
398
|
-
catch (error) {
|
|
399
|
-
return {
|
|
400
|
-
content: [{ type: "text", text: `Error listing regions: ${error}` }],
|
|
401
|
-
isError: true,
|
|
402
|
-
};
|
|
403
|
-
}
|
|
404
|
-
},
|
|
405
|
-
};
|
|
406
|
-
const ValidateAppSpec = {
|
|
407
|
-
name: "validate_app_spec",
|
|
408
|
-
description: `
|
|
409
|
-
Propose and validate a spec for a new or existing app. The request returns some
|
|
410
|
-
information about the proposed app, including app cost and upgrade cost.
|
|
411
|
-
If an existing app ID is specified, the app spec is treated as a
|
|
412
|
-
proposed update to the existing app.
|
|
413
|
-
`,
|
|
414
|
-
parameters: digitalocean_openapi_yaml_zod_1.post_Apps_validate_appSpec.parameters.shape,
|
|
415
|
-
cb: async (params, extra) => {
|
|
416
|
-
try {
|
|
417
|
-
const { client } = (0, api_1.createClient)(extra);
|
|
418
|
-
const res = await client.post("/v2/apps/propose", params);
|
|
419
|
-
return {
|
|
420
|
-
content: [{ type: "text", text: JSON.stringify(res) }],
|
|
421
|
-
};
|
|
422
|
-
}
|
|
423
|
-
catch (error) {
|
|
424
|
-
return {
|
|
425
|
-
content: [
|
|
426
|
-
{ type: "text", text: `Error validating app spec: ${error}` },
|
|
427
|
-
],
|
|
428
|
-
isError: true,
|
|
429
|
-
};
|
|
430
|
-
}
|
|
431
|
-
},
|
|
432
|
-
};
|
|
433
|
-
const ListAppAlerts = {
|
|
434
|
-
name: "list_app_alerts",
|
|
435
|
-
description: `
|
|
436
|
-
List alerts associated to the app and any components. This includes
|
|
437
|
-
configuration information about the alerts including emails, slack
|
|
438
|
-
webhooks, and triggering events or conditions.
|
|
439
|
-
`,
|
|
440
|
-
parameters: digitalocean_openapi_yaml_zod_1.get_Apps_list_alerts.parameters.shape,
|
|
441
|
-
cb: async (params, extra) => {
|
|
442
|
-
try {
|
|
443
|
-
const { client } = (0, api_1.createClient)(extra);
|
|
444
|
-
const res = await client.get(`/v2/apps/{app_id}/alerts`, params);
|
|
445
|
-
return {
|
|
446
|
-
content: [
|
|
447
|
-
{
|
|
448
|
-
type: "text",
|
|
449
|
-
text: JSON.stringify(res, null, 2),
|
|
450
|
-
},
|
|
451
|
-
],
|
|
452
|
-
};
|
|
453
|
-
}
|
|
454
|
-
catch (error) {
|
|
455
|
-
return {
|
|
456
|
-
content: [{ type: "text", text: `Error listing app alerts: ${error}` }],
|
|
457
|
-
isError: true,
|
|
458
|
-
};
|
|
459
|
-
}
|
|
460
|
-
},
|
|
461
|
-
};
|
|
462
|
-
const UpdateAppAlertDestinations = {
|
|
463
|
-
name: "update_app_alert_destinations",
|
|
464
|
-
description: "Update alert destinations for an app",
|
|
465
|
-
parameters: digitalocean_openapi_yaml_zod_1.post_Apps_assign_alertDestinations.parameters.shape,
|
|
466
|
-
cb: async (params, extra) => {
|
|
467
|
-
try {
|
|
468
|
-
const { client } = (0, api_1.createClient)(extra);
|
|
469
|
-
const res = await client.post(`/v2/apps/{app_id}/alerts/{alert_id}/destinations`, params);
|
|
470
|
-
return {
|
|
471
|
-
content: [{ type: "text", text: JSON.stringify(res) }],
|
|
472
|
-
};
|
|
473
|
-
}
|
|
474
|
-
catch (error) {
|
|
475
|
-
return {
|
|
476
|
-
content: [
|
|
477
|
-
{ type: "text", text: `Error updating alert destinations: ${error}` },
|
|
478
|
-
],
|
|
479
|
-
isError: true,
|
|
480
|
-
};
|
|
481
|
-
}
|
|
482
|
-
},
|
|
483
|
-
};
|
|
484
|
-
const RollbackApp = {
|
|
485
|
-
name: "rollback_app",
|
|
486
|
-
description: `
|
|
487
|
-
Rollback an app to a previous deployment. A new deployment will be
|
|
488
|
-
created to perform the rollback.
|
|
489
|
-
The app will be pinned to the rollback deployment preventing any new
|
|
490
|
-
deployments from being created, either manually or through Auto Deploy on Push webhooks.
|
|
491
|
-
To resume deployments, the rollback must beeither committed or reverted.
|
|
492
|
-
It is recommended to use the Validate App Rollback endpoint to double check if the rollback is valid and if there are any warnings.
|
|
493
|
-
`,
|
|
494
|
-
parameters: digitalocean_openapi_yaml_zod_1.post_Apps_create_rollback.parameters.shape,
|
|
495
|
-
cb: async (params, extra) => {
|
|
496
|
-
try {
|
|
497
|
-
const { client } = (0, api_1.createClient)(extra);
|
|
498
|
-
const res = await client.post(`/v2/apps/{app_id}/rollback`, params);
|
|
499
|
-
return {
|
|
500
|
-
content: [{ type: "text", text: JSON.stringify(res, null, 2) }],
|
|
501
|
-
};
|
|
502
|
-
}
|
|
503
|
-
catch (error) {
|
|
504
|
-
return {
|
|
505
|
-
content: [{ type: "text", text: `Error rolling back app: ${error}` }],
|
|
506
|
-
isError: true,
|
|
507
|
-
};
|
|
508
|
-
}
|
|
509
|
-
},
|
|
510
|
-
};
|
|
511
|
-
const ValidateAppRollback = {
|
|
512
|
-
name: "validate_app_rollback",
|
|
513
|
-
description: `
|
|
514
|
-
Check whether an app can be rolled back to a specific deployment. This
|
|
515
|
-
endpoint can also be used to check if there are any warnings or validation conditions that will
|
|
516
|
-
cause the rollback to proceed under un-ideal circumstances. For example, if a component must be rebuilt
|
|
517
|
-
as part of the rollback causing it to take longer than usual.
|
|
518
|
-
`,
|
|
519
|
-
parameters: digitalocean_openapi_yaml_zod_1.post_Apps_validate_rollback.parameters.shape,
|
|
520
|
-
cb: async (params, extra) => {
|
|
521
|
-
try {
|
|
522
|
-
const { client } = (0, api_1.createClient)(extra);
|
|
523
|
-
const res = await client.post(`/v2/apps/{app_id}/rollback/validate`, params);
|
|
524
|
-
return {
|
|
525
|
-
content: [{ type: "text", text: JSON.stringify(res, null, 2) }],
|
|
526
|
-
};
|
|
527
|
-
}
|
|
528
|
-
catch (error) {
|
|
529
|
-
return {
|
|
530
|
-
content: [
|
|
531
|
-
{ type: "text", text: `Error validating app rollback: ${error}` },
|
|
532
|
-
],
|
|
533
|
-
isError: true,
|
|
534
|
-
};
|
|
535
|
-
}
|
|
536
|
-
},
|
|
537
|
-
};
|
|
538
|
-
const CommitAppRollback = {
|
|
539
|
-
name: "commit_app_rollback",
|
|
540
|
-
description: `
|
|
541
|
-
Commit an app rollback. This action permanently applies the rollback and
|
|
542
|
-
unpins the app to resume new deployments.
|
|
543
|
-
`,
|
|
544
|
-
parameters: digitalocean_openapi_yaml_zod_1.post_Apps_commit_rollback.parameters.shape,
|
|
545
|
-
cb: async (params, extra) => {
|
|
546
|
-
try {
|
|
547
|
-
const { client } = (0, api_1.createClient)(extra);
|
|
548
|
-
await client.post(`/v2/apps/{app_id}/rollback/commit`, params);
|
|
549
|
-
return {
|
|
550
|
-
content: [
|
|
551
|
-
{ type: "text", text: "App rollback committed successfully." },
|
|
552
|
-
],
|
|
553
|
-
};
|
|
554
|
-
}
|
|
555
|
-
catch (error) {
|
|
556
|
-
return {
|
|
557
|
-
content: [
|
|
558
|
-
{ type: "text", text: `Error committing app rollback: ${error}` },
|
|
559
|
-
],
|
|
560
|
-
isError: true,
|
|
561
|
-
};
|
|
562
|
-
}
|
|
563
|
-
},
|
|
564
|
-
};
|
|
565
|
-
const RevertAppRollback = {
|
|
566
|
-
name: "revert_app_rollback",
|
|
567
|
-
description: `
|
|
568
|
-
Revert an app rollback. This action reverts the active rollback by
|
|
569
|
-
creating a new deployment from the latest app spec prior to the
|
|
570
|
-
rollback and unpins the app to resume new deployments.
|
|
571
|
-
`,
|
|
572
|
-
parameters: digitalocean_openapi_yaml_zod_1.post_Apps_revert_rollback.parameters.shape,
|
|
573
|
-
cb: async (params, extra) => {
|
|
574
|
-
try {
|
|
575
|
-
const { client } = (0, api_1.createClient)(extra);
|
|
576
|
-
const res = await client.post(`/v2/apps/{app_id}/rollback/revert`, params);
|
|
577
|
-
return {
|
|
578
|
-
content: [{ type: "text", text: JSON.stringify(res, null, 2) }],
|
|
579
|
-
};
|
|
580
|
-
}
|
|
581
|
-
catch (error) {
|
|
582
|
-
return {
|
|
583
|
-
content: [
|
|
584
|
-
{ type: "text", text: `Error reverting app rollback: ${error}` },
|
|
585
|
-
],
|
|
586
|
-
isError: true,
|
|
587
|
-
};
|
|
588
|
-
}
|
|
589
|
-
},
|
|
590
|
-
};
|
|
591
|
-
function registerAppTools(server) {
|
|
592
|
-
server.registerTool(ListApps);
|
|
593
|
-
server.registerTool(CreateApp);
|
|
594
|
-
server.registerTool(GetApp);
|
|
595
|
-
server.registerTool(UpdateApp);
|
|
596
|
-
server.registerTool(DeleteApp);
|
|
597
|
-
server.registerTool(GetDeploymentLogsUrl);
|
|
598
|
-
server.registerTool(DownloadLogs); // Custom tool to download logs
|
|
599
|
-
server.registerTool(ListDeployments);
|
|
600
|
-
server.registerTool(CreateDeployment);
|
|
601
|
-
server.registerTool(GetDeployment);
|
|
602
|
-
server.registerTool(CancelDeployment);
|
|
603
|
-
server.registerTool(ListInstanceSizes);
|
|
604
|
-
server.registerTool(GetInstanceSizeBySlug);
|
|
605
|
-
server.registerTool(ListRegions);
|
|
606
|
-
server.registerTool(ValidateAppSpec);
|
|
607
|
-
server.registerTool(ListAppAlerts);
|
|
608
|
-
server.registerTool(UpdateAppAlertDestinations);
|
|
609
|
-
server.registerTool(RollbackApp);
|
|
610
|
-
server.registerTool(ValidateAppRollback);
|
|
611
|
-
server.registerTool(CommitAppRollback);
|
|
612
|
-
server.registerTool(RevertAppRollback);
|
|
613
|
-
}
|