liara-mcp 0.3.5 → 1.0.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 (144) hide show
  1. package/dist/api/types.d.ts +14 -3
  2. package/dist/api/types.d.ts.map +1 -1
  3. package/dist/handlers/app-handlers.d.ts +3 -0
  4. package/dist/handlers/app-handlers.d.ts.map +1 -0
  5. package/dist/handlers/app-handlers.js +48 -0
  6. package/dist/handlers/app-handlers.js.map +1 -0
  7. package/dist/handlers/database-handlers.d.ts +3 -0
  8. package/dist/handlers/database-handlers.d.ts.map +1 -0
  9. package/dist/handlers/database-handlers.js +75 -0
  10. package/dist/handlers/database-handlers.js.map +1 -0
  11. package/dist/handlers/deployment-handlers.d.ts +3 -0
  12. package/dist/handlers/deployment-handlers.d.ts.map +1 -0
  13. package/dist/handlers/deployment-handlers.js +43 -0
  14. package/dist/handlers/deployment-handlers.js.map +1 -0
  15. package/dist/handlers/disk-handlers.d.ts +3 -0
  16. package/dist/handlers/disk-handlers.d.ts.map +1 -0
  17. package/dist/handlers/disk-handlers.js +48 -0
  18. package/dist/handlers/disk-handlers.js.map +1 -0
  19. package/dist/handlers/dns-handlers.d.ts +3 -0
  20. package/dist/handlers/dns-handlers.d.ts.map +1 -0
  21. package/dist/handlers/dns-handlers.js +63 -0
  22. package/dist/handlers/dns-handlers.js.map +1 -0
  23. package/dist/handlers/domain-handlers.d.ts +3 -0
  24. package/dist/handlers/domain-handlers.d.ts.map +1 -0
  25. package/dist/handlers/domain-handlers.js +28 -0
  26. package/dist/handlers/domain-handlers.js.map +1 -0
  27. package/dist/handlers/env-handlers.d.ts +3 -0
  28. package/dist/handlers/env-handlers.d.ts.map +1 -0
  29. package/dist/handlers/env-handlers.js +32 -0
  30. package/dist/handlers/env-handlers.js.map +1 -0
  31. package/dist/handlers/index.d.ts +7 -0
  32. package/dist/handlers/index.d.ts.map +1 -0
  33. package/dist/handlers/index.js +80 -0
  34. package/dist/handlers/index.js.map +1 -0
  35. package/dist/handlers/mail-handlers.d.ts +3 -0
  36. package/dist/handlers/mail-handlers.d.ts.map +1 -0
  37. package/dist/handlers/mail-handlers.js +51 -0
  38. package/dist/handlers/mail-handlers.js.map +1 -0
  39. package/dist/handlers/network-handlers.d.ts +3 -0
  40. package/dist/handlers/network-handlers.d.ts.map +1 -0
  41. package/dist/handlers/network-handlers.js +28 -0
  42. package/dist/handlers/network-handlers.js.map +1 -0
  43. package/dist/handlers/observability-handlers.d.ts +3 -0
  44. package/dist/handlers/observability-handlers.d.ts.map +1 -0
  45. package/dist/handlers/observability-handlers.js +24 -0
  46. package/dist/handlers/observability-handlers.js.map +1 -0
  47. package/dist/handlers/plan-handlers.d.ts +3 -0
  48. package/dist/handlers/plan-handlers.d.ts.map +1 -0
  49. package/dist/handlers/plan-handlers.js +20 -0
  50. package/dist/handlers/plan-handlers.js.map +1 -0
  51. package/dist/handlers/settings-handlers.d.ts +3 -0
  52. package/dist/handlers/settings-handlers.d.ts.map +1 -0
  53. package/dist/handlers/settings-handlers.js +29 -0
  54. package/dist/handlers/settings-handlers.js.map +1 -0
  55. package/dist/handlers/storage-handlers.d.ts +3 -0
  56. package/dist/handlers/storage-handlers.d.ts.map +1 -0
  57. package/dist/handlers/storage-handlers.js +48 -0
  58. package/dist/handlers/storage-handlers.js.map +1 -0
  59. package/dist/handlers/types.d.ts +27 -0
  60. package/dist/handlers/types.d.ts.map +1 -0
  61. package/dist/handlers/types.js +31 -0
  62. package/dist/handlers/types.js.map +1 -0
  63. package/dist/handlers/user-handlers.d.ts +3 -0
  64. package/dist/handlers/user-handlers.d.ts.map +1 -0
  65. package/dist/handlers/user-handlers.js +16 -0
  66. package/dist/handlers/user-handlers.js.map +1 -0
  67. package/dist/handlers/vm-handlers.d.ts +3 -0
  68. package/dist/handlers/vm-handlers.d.ts.map +1 -0
  69. package/dist/handlers/vm-handlers.js +68 -0
  70. package/dist/handlers/vm-handlers.js.map +1 -0
  71. package/dist/index.js +7 -3000
  72. package/dist/index.js.map +1 -1
  73. package/dist/services/databases.d.ts.map +1 -1
  74. package/dist/services/databases.js +68 -24
  75. package/dist/services/databases.js.map +1 -1
  76. package/dist/tools/app-tools.d.ts +6 -0
  77. package/dist/tools/app-tools.d.ts.map +1 -0
  78. package/dist/tools/app-tools.js +133 -0
  79. package/dist/tools/app-tools.js.map +1 -0
  80. package/dist/tools/database-tools.d.ts +6 -0
  81. package/dist/tools/database-tools.d.ts.map +1 -0
  82. package/dist/tools/database-tools.js +252 -0
  83. package/dist/tools/database-tools.js.map +1 -0
  84. package/dist/tools/deployment-tools.d.ts +6 -0
  85. package/dist/tools/deployment-tools.d.ts.map +1 -0
  86. package/dist/tools/deployment-tools.js +140 -0
  87. package/dist/tools/deployment-tools.js.map +1 -0
  88. package/dist/tools/disk-tools.d.ts +6 -0
  89. package/dist/tools/disk-tools.d.ts.map +1 -0
  90. package/dist/tools/disk-tools.js +167 -0
  91. package/dist/tools/disk-tools.js.map +1 -0
  92. package/dist/tools/dns-tools.d.ts +6 -0
  93. package/dist/tools/dns-tools.d.ts.map +1 -0
  94. package/dist/tools/dns-tools.js +184 -0
  95. package/dist/tools/dns-tools.js.map +1 -0
  96. package/dist/tools/domain-tools.d.ts +6 -0
  97. package/dist/tools/domain-tools.d.ts.map +1 -0
  98. package/dist/tools/domain-tools.js +63 -0
  99. package/dist/tools/domain-tools.js.map +1 -0
  100. package/dist/tools/env-tools.d.ts +6 -0
  101. package/dist/tools/env-tools.d.ts.map +1 -0
  102. package/dist/tools/env-tools.js +112 -0
  103. package/dist/tools/env-tools.js.map +1 -0
  104. package/dist/tools/index.d.ts +25 -0
  105. package/dist/tools/index.d.ts.map +1 -0
  106. package/dist/tools/index.js +57 -0
  107. package/dist/tools/index.js.map +1 -0
  108. package/dist/tools/mail-tools.d.ts +6 -0
  109. package/dist/tools/mail-tools.d.ts.map +1 -0
  110. package/dist/tools/mail-tools.js +148 -0
  111. package/dist/tools/mail-tools.js.map +1 -0
  112. package/dist/tools/network-tools.d.ts +6 -0
  113. package/dist/tools/network-tools.d.ts.map +1 -0
  114. package/dist/tools/network-tools.js +63 -0
  115. package/dist/tools/network-tools.js.map +1 -0
  116. package/dist/tools/observability-tools.d.ts +6 -0
  117. package/dist/tools/observability-tools.d.ts.map +1 -0
  118. package/dist/tools/observability-tools.js +49 -0
  119. package/dist/tools/observability-tools.js.map +1 -0
  120. package/dist/tools/plan-tools.d.ts +6 -0
  121. package/dist/tools/plan-tools.d.ts.map +1 -0
  122. package/dist/tools/plan-tools.js +38 -0
  123. package/dist/tools/plan-tools.js.map +1 -0
  124. package/dist/tools/settings-tools.d.ts +6 -0
  125. package/dist/tools/settings-tools.d.ts.map +1 -0
  126. package/dist/tools/settings-tools.js +77 -0
  127. package/dist/tools/settings-tools.js.map +1 -0
  128. package/dist/tools/storage-tools.d.ts +6 -0
  129. package/dist/tools/storage-tools.d.ts.map +1 -0
  130. package/dist/tools/storage-tools.js +166 -0
  131. package/dist/tools/storage-tools.js.map +1 -0
  132. package/dist/tools/types.d.ts +34 -0
  133. package/dist/tools/types.d.ts.map +1 -0
  134. package/dist/tools/types.js +27 -0
  135. package/dist/tools/types.js.map +1 -0
  136. package/dist/tools/user-tools.d.ts +6 -0
  137. package/dist/tools/user-tools.d.ts.map +1 -0
  138. package/dist/tools/user-tools.js +13 -0
  139. package/dist/tools/user-tools.js.map +1 -0
  140. package/dist/tools/vm-tools.d.ts +6 -0
  141. package/dist/tools/vm-tools.d.ts.map +1 -0
  142. package/dist/tools/vm-tools.js +240 -0
  143. package/dist/tools/vm-tools.js.map +1 -0
  144. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -3,24 +3,10 @@
3
3
  import 'dotenv/config';
4
4
  import { Server } from '@modelcontextprotocol/sdk/server/index.js';
5
5
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
6
- import { CallToolRequestSchema, ErrorCode, ListToolsRequestSchema, McpError, } from '@modelcontextprotocol/sdk/types.js';
6
+ import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
7
7
  import { createLiaraClient } from './api/client.js';
8
- import { formatErrorForMcp, LiaraMcpError } from './utils/errors.js';
9
- import * as appService from './services/apps.js';
10
- import * as envService from './services/environment.js';
11
- import * as deployService from './services/deployment.js';
12
- import * as dbService from './services/databases.js';
13
- import * as storageService from './services/storage.js';
14
- import * as planService from './services/plans.js';
15
- import * as dnsService from './services/dns.js';
16
- import * as mailService from './services/mail.js';
17
- import * as iaasService from './services/iaas.js';
18
- import * as diskService from './services/disks.js';
19
- import * as networkService from './services/network.js';
20
- import * as userService from './services/user.js';
21
- import * as observabilityService from './services/observability.js';
22
- import * as settingsService from './services/settings.js';
23
- import * as domainService from './services/domains.js';
8
+ import { getAllTools } from './tools/index.js';
9
+ import { handleToolCall } from './handlers/index.js';
24
10
  /**
25
11
  * Liara MCP Server
26
12
  * Provides tools for managing Liara cloud infrastructure
@@ -31,7 +17,7 @@ class LiaraMcpServer {
31
17
  constructor() {
32
18
  this.server = new Server({
33
19
  name: 'liara-mcp',
34
- version: '0.3.3',
20
+ version: '1.0.0',
35
21
  }, {
36
22
  capabilities: {
37
23
  tools: {},
@@ -57,2994 +43,15 @@ class LiaraMcpServer {
57
43
  this.setupListToolsHandler();
58
44
  this.setupCallToolHandler();
59
45
  }
60
- /**
61
- * Get pagination properties for tool schemas
62
- */
63
- getPaginationProperties() {
64
- return {
65
- page: {
66
- type: 'number',
67
- description: 'Page number (1-based)',
68
- },
69
- perPage: {
70
- type: 'number',
71
- description: 'Number of items per page',
72
- },
73
- limit: {
74
- type: 'number',
75
- description: 'Alternative to perPage: maximum number of items to return',
76
- },
77
- offset: {
78
- type: 'number',
79
- description: 'Alternative to page: number of items to skip',
80
- },
81
- };
82
- }
83
- /**
84
- * Extract pagination options from tool arguments
85
- */
86
- extractPagination(args) {
87
- if (args?.page || args?.perPage || args?.limit || args?.offset) {
88
- return {
89
- page: args.page,
90
- perPage: args.perPage,
91
- limit: args.limit,
92
- offset: args.offset,
93
- };
94
- }
95
- return undefined;
96
- }
97
46
  setupListToolsHandler() {
98
47
  this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
99
- tools: [
100
- // App Management Tools
101
- {
102
- name: 'liara_list_apps',
103
- description: 'List all apps/projects in your Liara account',
104
- inputSchema: {
105
- type: 'object',
106
- properties: this.getPaginationProperties(),
107
- },
108
- },
109
- {
110
- name: 'liara_get_app',
111
- description: 'Get detailed information about a specific app',
112
- inputSchema: {
113
- type: 'object',
114
- properties: {
115
- name: {
116
- type: 'string',
117
- description: 'The name of the app',
118
- },
119
- },
120
- required: ['name'],
121
- },
122
- },
123
- {
124
- name: 'liara_create_app',
125
- description: 'Create a new app',
126
- inputSchema: {
127
- type: 'object',
128
- properties: {
129
- name: {
130
- type: 'string',
131
- description: 'App name (3-32 chars, lowercase, alphanumeric with hyphens)',
132
- },
133
- platform: {
134
- type: 'string',
135
- description: 'Platform type',
136
- enum: appService.getAvailablePlatforms(),
137
- },
138
- planID: {
139
- type: 'string',
140
- description: 'Plan ID for the app',
141
- },
142
- region: {
143
- type: 'string',
144
- description: 'Deployment region (optional)',
145
- },
146
- },
147
- required: ['name', 'platform', 'planID'],
148
- },
149
- },
150
- {
151
- name: 'liara_delete_app',
152
- description: 'Delete an app',
153
- inputSchema: {
154
- type: 'object',
155
- properties: {
156
- name: {
157
- type: 'string',
158
- description: 'The name of the app to delete',
159
- },
160
- },
161
- required: ['name'],
162
- },
163
- },
164
- {
165
- name: 'liara_start_app',
166
- description: 'Start an app (scale up)',
167
- inputSchema: {
168
- type: 'object',
169
- properties: {
170
- name: {
171
- type: 'string',
172
- description: 'The name of the app to start',
173
- },
174
- },
175
- required: ['name'],
176
- },
177
- },
178
- {
179
- name: 'liara_stop_app',
180
- description: 'Stop an app (scale down)',
181
- inputSchema: {
182
- type: 'object',
183
- properties: {
184
- name: {
185
- type: 'string',
186
- description: 'The name of the app to stop',
187
- },
188
- },
189
- required: ['name'],
190
- },
191
- },
192
- {
193
- name: 'liara_restart_app',
194
- description: 'Restart an app',
195
- inputSchema: {
196
- type: 'object',
197
- properties: {
198
- name: {
199
- type: 'string',
200
- description: 'The name of the app to restart',
201
- },
202
- },
203
- required: ['name'],
204
- },
205
- },
206
- {
207
- name: 'liara_resize_app',
208
- description: 'Change app plan (resize resources)',
209
- inputSchema: {
210
- type: 'object',
211
- properties: {
212
- name: {
213
- type: 'string',
214
- description: 'The name of the app',
215
- },
216
- planID: {
217
- type: 'string',
218
- description: 'New plan ID',
219
- },
220
- },
221
- required: ['name', 'planID'],
222
- },
223
- },
224
- // Environment Variable Tools
225
- {
226
- name: 'liara_set_env_vars',
227
- description: 'Set or update environment variables for an app',
228
- inputSchema: {
229
- type: 'object',
230
- properties: {
231
- appName: {
232
- type: 'string',
233
- description: 'The name of the app',
234
- },
235
- variables: {
236
- type: 'array',
237
- description: 'Array of environment variables',
238
- items: {
239
- type: 'object',
240
- properties: {
241
- key: {
242
- type: 'string',
243
- description: 'Variable name (uppercase, alphanumeric with underscores)',
244
- },
245
- value: {
246
- type: 'string',
247
- description: 'Variable value',
248
- },
249
- },
250
- required: ['key', 'value'],
251
- },
252
- },
253
- },
254
- required: ['appName', 'variables'],
255
- },
256
- },
257
- {
258
- name: 'liara_set_env_var',
259
- description: 'Set a single environment variable for an app',
260
- inputSchema: {
261
- type: 'object',
262
- properties: {
263
- appName: {
264
- type: 'string',
265
- description: 'The name of the app',
266
- },
267
- key: {
268
- type: 'string',
269
- description: 'Variable name (uppercase, alphanumeric with underscores)',
270
- },
271
- value: {
272
- type: 'string',
273
- description: 'Variable value',
274
- },
275
- },
276
- required: ['appName', 'key', 'value'],
277
- },
278
- },
279
- {
280
- name: 'liara_get_env_vars',
281
- description: 'Get all environment variables for an app',
282
- inputSchema: {
283
- type: 'object',
284
- properties: {
285
- appName: {
286
- type: 'string',
287
- description: 'The name of the app',
288
- },
289
- },
290
- required: ['appName'],
291
- },
292
- },
293
- {
294
- name: 'liara_delete_env_var',
295
- description: 'Delete/unset an environment variable for an app',
296
- inputSchema: {
297
- type: 'object',
298
- properties: {
299
- appName: {
300
- type: 'string',
301
- description: 'The name of the app',
302
- },
303
- key: {
304
- type: 'string',
305
- description: 'Variable name to delete',
306
- },
307
- },
308
- required: ['appName', 'key'],
309
- },
310
- },
311
- {
312
- name: 'liara_delete_env_vars',
313
- description: 'Delete/unset multiple environment variables for an app',
314
- inputSchema: {
315
- type: 'object',
316
- properties: {
317
- appName: {
318
- type: 'string',
319
- description: 'The name of the app',
320
- },
321
- keys: {
322
- type: 'array',
323
- description: 'Array of variable names to delete',
324
- items: {
325
- type: 'string',
326
- },
327
- },
328
- },
329
- required: ['appName', 'keys'],
330
- },
331
- },
332
- // App Settings Tools
333
- {
334
- name: 'liara_set_zero_downtime',
335
- description: 'Enable or disable zero-downtime deployment for an app',
336
- inputSchema: {
337
- type: 'object',
338
- properties: {
339
- appName: {
340
- type: 'string',
341
- description: 'The name of the app',
342
- },
343
- enabled: {
344
- type: 'boolean',
345
- description: 'Enable (true) or disable (false) zero-downtime deployment',
346
- },
347
- },
348
- required: ['appName', 'enabled'],
349
- },
350
- },
351
- {
352
- name: 'liara_set_default_subdomain',
353
- description: 'Enable or disable default subdomain for an app',
354
- inputSchema: {
355
- type: 'object',
356
- properties: {
357
- appName: {
358
- type: 'string',
359
- description: 'The name of the app',
360
- },
361
- enabled: {
362
- type: 'boolean',
363
- description: 'Enable (true) or disable (false) default subdomain',
364
- },
365
- },
366
- required: ['appName', 'enabled'],
367
- },
368
- },
369
- {
370
- name: 'liara_set_fixed_ip',
371
- description: 'Enable or disable static IP for an app (returns IP when enabling)',
372
- inputSchema: {
373
- type: 'object',
374
- properties: {
375
- appName: {
376
- type: 'string',
377
- description: 'The name of the app',
378
- },
379
- enabled: {
380
- type: 'boolean',
381
- description: 'Enable (true) or disable (false) static IP',
382
- },
383
- },
384
- required: ['appName', 'enabled'],
385
- },
386
- },
387
- {
388
- name: 'liara_set_read_only',
389
- description: 'Enable or disable read-only mode for an app',
390
- inputSchema: {
391
- type: 'object',
392
- properties: {
393
- appName: {
394
- type: 'string',
395
- description: 'The name of the app',
396
- },
397
- enabled: {
398
- type: 'boolean',
399
- description: 'Enable (true) or disable (false) read-only mode',
400
- },
401
- },
402
- required: ['appName', 'enabled'],
403
- },
404
- },
405
- // Deployment Tools
406
- {
407
- name: 'liara_upload_source',
408
- description: 'Upload source code (.tar.gz file) for deployment',
409
- inputSchema: {
410
- type: 'object',
411
- properties: {
412
- appName: {
413
- type: 'string',
414
- description: 'The name of the app',
415
- },
416
- filePath: {
417
- type: 'string',
418
- description: 'Path to the .tar.gz file to upload',
419
- },
420
- },
421
- required: ['appName', 'filePath'],
422
- },
423
- },
424
- {
425
- name: 'liara_deploy_release',
426
- description: 'Deploy a release using a source ID',
427
- inputSchema: {
428
- type: 'object',
429
- properties: {
430
- appName: {
431
- type: 'string',
432
- description: 'The name of the app',
433
- },
434
- sourceID: {
435
- type: 'string',
436
- description: 'Source ID from previous source upload',
437
- },
438
- envVars: {
439
- type: 'array',
440
- description: 'Optional environment variables for this deployment',
441
- items: {
442
- type: 'object',
443
- properties: {
444
- key: { type: 'string' },
445
- value: { type: 'string' },
446
- },
447
- },
448
- },
449
- },
450
- required: ['appName', 'sourceID'],
451
- },
452
- },
453
- {
454
- name: 'liara_list_releases',
455
- description: 'List all releases for an app',
456
- inputSchema: {
457
- type: 'object',
458
- properties: {
459
- appName: {
460
- type: 'string',
461
- description: 'The name of the app',
462
- },
463
- ...this.getPaginationProperties(),
464
- },
465
- required: ['appName'],
466
- },
467
- },
468
- {
469
- name: 'liara_get_release',
470
- description: 'Get details of a specific release',
471
- inputSchema: {
472
- type: 'object',
473
- properties: {
474
- appName: {
475
- type: 'string',
476
- description: 'The name of the app',
477
- },
478
- releaseID: {
479
- type: 'string',
480
- description: 'The release ID',
481
- },
482
- },
483
- required: ['appName', 'releaseID'],
484
- },
485
- },
486
- {
487
- name: 'liara_rollback_release',
488
- description: 'Rollback to a previous release',
489
- inputSchema: {
490
- type: 'object',
491
- properties: {
492
- appName: {
493
- type: 'string',
494
- description: 'The name of the app',
495
- },
496
- releaseID: {
497
- type: 'string',
498
- description: 'The release ID to rollback to',
499
- },
500
- },
501
- required: ['appName', 'releaseID'],
502
- },
503
- },
504
- {
505
- name: 'liara_list_sources',
506
- description: 'List all uploaded sources for an app',
507
- inputSchema: {
508
- type: 'object',
509
- properties: {
510
- appName: {
511
- type: 'string',
512
- description: 'The name of the app',
513
- },
514
- ...this.getPaginationProperties(),
515
- },
516
- required: ['appName'],
517
- },
518
- },
519
- {
520
- name: 'liara_delete_source',
521
- description: 'Delete an uploaded source',
522
- inputSchema: {
523
- type: 'object',
524
- properties: {
525
- appName: {
526
- type: 'string',
527
- description: 'The name of the app',
528
- },
529
- sourceID: {
530
- type: 'string',
531
- description: 'The source ID to delete',
532
- },
533
- },
534
- required: ['appName', 'sourceID'],
535
- },
536
- },
537
- // Database Tools
538
- {
539
- name: 'liara_list_databases',
540
- description: 'List all databases in your Liara account',
541
- inputSchema: {
542
- type: 'object',
543
- properties: this.getPaginationProperties(),
544
- },
545
- },
546
- {
547
- name: 'liara_get_database',
548
- description: 'Get details of a specific database',
549
- inputSchema: {
550
- type: 'object',
551
- properties: {
552
- name: {
553
- type: 'string',
554
- description: 'The name of the database',
555
- },
556
- },
557
- required: ['name'],
558
- },
559
- },
560
- {
561
- name: 'liara_get_database_connection',
562
- description: 'Get database connection information (host, port, credentials)',
563
- inputSchema: {
564
- type: 'object',
565
- properties: {
566
- databaseName: {
567
- type: 'string',
568
- description: 'The name of the database',
569
- },
570
- },
571
- required: ['databaseName'],
572
- },
573
- },
574
- {
575
- name: 'liara_update_database',
576
- description: 'Update database settings such as plan (resize) or version',
577
- inputSchema: {
578
- type: 'object',
579
- properties: {
580
- name: {
581
- type: 'string',
582
- description: 'The name of the database',
583
- },
584
- planID: {
585
- type: 'string',
586
- description: 'New plan ID to resize the database',
587
- },
588
- version: {
589
- type: 'string',
590
- description: 'New database version',
591
- },
592
- },
593
- required: ['name'],
594
- anyOf: [
595
- { required: ['planID'] },
596
- { required: ['version'] },
597
- ],
598
- },
599
- },
600
- {
601
- name: 'liara_create_database',
602
- description: 'Create a new database',
603
- inputSchema: {
604
- type: 'object',
605
- properties: {
606
- name: {
607
- type: 'string',
608
- description: 'Database name',
609
- },
610
- type: {
611
- type: 'string',
612
- description: 'Database type',
613
- enum: dbService.getAvailableDatabaseTypes(),
614
- },
615
- planID: {
616
- type: 'string',
617
- description: 'Plan ID for the database',
618
- },
619
- version: {
620
- type: 'string',
621
- description: 'Database version (optional)',
622
- },
623
- },
624
- required: ['name', 'type', 'planID'],
625
- },
626
- },
627
- {
628
- name: 'liara_delete_database',
629
- description: 'Delete a database',
630
- inputSchema: {
631
- type: 'object',
632
- properties: {
633
- name: {
634
- type: 'string',
635
- description: 'The name of the database to delete',
636
- },
637
- },
638
- required: ['name'],
639
- },
640
- },
641
- {
642
- name: 'liara_start_database',
643
- description: 'Start a database',
644
- inputSchema: {
645
- type: 'object',
646
- properties: {
647
- name: {
648
- type: 'string',
649
- description: 'The name of the database',
650
- },
651
- },
652
- required: ['name'],
653
- },
654
- },
655
- {
656
- name: 'liara_stop_database',
657
- description: 'Stop a database',
658
- inputSchema: {
659
- type: 'object',
660
- properties: {
661
- name: {
662
- type: 'string',
663
- description: 'The name of the database',
664
- },
665
- },
666
- required: ['name'],
667
- },
668
- },
669
- {
670
- name: 'liara_resize_database',
671
- description: 'Change database plan (resize resources)',
672
- inputSchema: {
673
- type: 'object',
674
- properties: {
675
- name: {
676
- type: 'string',
677
- description: 'The name of the database',
678
- },
679
- planID: {
680
- type: 'string',
681
- description: 'New plan ID',
682
- },
683
- },
684
- required: ['name', 'planID'],
685
- },
686
- },
687
- {
688
- name: 'liara_create_backup',
689
- description: 'Create a database backup',
690
- inputSchema: {
691
- type: 'object',
692
- properties: {
693
- databaseName: {
694
- type: 'string',
695
- description: 'The name of the database',
696
- },
697
- },
698
- required: ['databaseName'],
699
- },
700
- },
701
- {
702
- name: 'liara_list_backups',
703
- description: 'List backups for a database',
704
- inputSchema: {
705
- type: 'object',
706
- properties: {
707
- databaseName: {
708
- type: 'string',
709
- description: 'The name of the database',
710
- },
711
- ...this.getPaginationProperties(),
712
- },
713
- required: ['databaseName'],
714
- },
715
- },
716
- {
717
- name: 'liara_get_backup_download_url',
718
- description: 'Get download URL for a database backup',
719
- inputSchema: {
720
- type: 'object',
721
- properties: {
722
- databaseName: {
723
- type: 'string',
724
- description: 'The name of the database',
725
- },
726
- backupId: {
727
- type: 'string',
728
- description: 'The backup ID',
729
- },
730
- },
731
- required: ['databaseName', 'backupId'],
732
- },
733
- },
734
- {
735
- name: 'liara_restart_database',
736
- description: 'Restart a database',
737
- inputSchema: {
738
- type: 'object',
739
- properties: {
740
- name: {
741
- type: 'string',
742
- description: 'The name of the database',
743
- },
744
- },
745
- required: ['name'],
746
- },
747
- },
748
- {
749
- name: 'liara_restore_backup',
750
- description: 'Restore a database from a backup',
751
- inputSchema: {
752
- type: 'object',
753
- properties: {
754
- databaseName: {
755
- type: 'string',
756
- description: 'The name of the database',
757
- },
758
- backupId: {
759
- type: 'string',
760
- description: 'The backup ID to restore from',
761
- },
762
- },
763
- required: ['databaseName', 'backupId'],
764
- },
765
- },
766
- {
767
- name: 'liara_delete_backup',
768
- description: 'Delete a database backup',
769
- inputSchema: {
770
- type: 'object',
771
- properties: {
772
- databaseName: {
773
- type: 'string',
774
- description: 'The name of the database',
775
- },
776
- backupId: {
777
- type: 'string',
778
- description: 'The backup ID to delete',
779
- },
780
- },
781
- required: ['databaseName', 'backupId'],
782
- },
783
- },
784
- // Storage (Bucket) Tools
785
- {
786
- name: 'liara_list_buckets',
787
- description: 'List all storage buckets',
788
- inputSchema: {
789
- type: 'object',
790
- properties: this.getPaginationProperties(),
791
- },
792
- },
793
- {
794
- name: 'liara_get_bucket',
795
- description: 'Get details of a specific bucket',
796
- inputSchema: {
797
- type: 'object',
798
- properties: {
799
- name: {
800
- type: 'string',
801
- description: 'The name of the bucket',
802
- },
803
- },
804
- required: ['name'],
805
- },
806
- },
807
- {
808
- name: 'liara_create_bucket',
809
- description: 'Create a new storage bucket',
810
- inputSchema: {
811
- type: 'object',
812
- properties: {
813
- name: {
814
- type: 'string',
815
- description: 'Bucket name',
816
- },
817
- region: {
818
- type: 'string',
819
- description: 'Region (optional)',
820
- },
821
- permission: {
822
- type: 'string',
823
- description: 'Permission level',
824
- enum: ['private', 'public-read'],
825
- },
826
- },
827
- required: ['name'],
828
- },
829
- },
830
- {
831
- name: 'liara_delete_bucket',
832
- description: 'Delete a storage bucket',
833
- inputSchema: {
834
- type: 'object',
835
- properties: {
836
- name: {
837
- type: 'string',
838
- description: 'The name of the bucket to delete',
839
- },
840
- },
841
- required: ['name'],
842
- },
843
- },
844
- {
845
- name: 'liara_get_bucket_credentials',
846
- description: 'Get S3-compatible credentials for a bucket',
847
- inputSchema: {
848
- type: 'object',
849
- properties: {
850
- name: {
851
- type: 'string',
852
- description: 'The name of the bucket',
853
- },
854
- },
855
- required: ['name'],
856
- },
857
- },
858
- {
859
- name: 'liara_list_objects',
860
- description: 'List objects in a bucket',
861
- inputSchema: {
862
- type: 'object',
863
- properties: {
864
- bucketName: {
865
- type: 'string',
866
- description: 'The name of the bucket',
867
- },
868
- prefix: {
869
- type: 'string',
870
- description: 'Prefix to filter objects (optional)',
871
- },
872
- maxKeys: {
873
- type: 'number',
874
- description: 'Maximum number of objects to return (optional)',
875
- },
876
- },
877
- required: ['bucketName'],
878
- },
879
- },
880
- {
881
- name: 'liara_upload_object',
882
- description: 'Upload an object to a bucket',
883
- inputSchema: {
884
- type: 'object',
885
- properties: {
886
- bucketName: {
887
- type: 'string',
888
- description: 'The name of the bucket',
889
- },
890
- objectKey: {
891
- type: 'string',
892
- description: 'The object key (path)',
893
- },
894
- filePath: {
895
- type: 'string',
896
- description: 'Path to the file to upload',
897
- },
898
- },
899
- required: ['bucketName', 'objectKey', 'filePath'],
900
- },
901
- },
902
- {
903
- name: 'liara_get_object_download_url',
904
- description: 'Get download URL for an object',
905
- inputSchema: {
906
- type: 'object',
907
- properties: {
908
- bucketName: {
909
- type: 'string',
910
- description: 'The name of the bucket',
911
- },
912
- objectKey: {
913
- type: 'string',
914
- description: 'The object key',
915
- },
916
- expiresIn: {
917
- type: 'number',
918
- description: 'URL expiration time in seconds (optional)',
919
- },
920
- },
921
- required: ['bucketName', 'objectKey'],
922
- },
923
- },
924
- {
925
- name: 'liara_delete_object',
926
- description: 'Delete an object from a bucket',
927
- inputSchema: {
928
- type: 'object',
929
- properties: {
930
- bucketName: {
931
- type: 'string',
932
- description: 'The name of the bucket',
933
- },
934
- objectKey: {
935
- type: 'string',
936
- description: 'The object key to delete',
937
- },
938
- },
939
- required: ['bucketName', 'objectKey'],
940
- },
941
- },
942
- // Plan Tools
943
- {
944
- name: 'liara_list_plans',
945
- description: 'List available plans (apps, databases, or VMs)',
946
- inputSchema: {
947
- type: 'object',
948
- properties: {
949
- planType: {
950
- type: 'string',
951
- description: 'Filter by plan type',
952
- enum: ['app', 'database', 'vm'],
953
- },
954
- ...this.getPaginationProperties(),
955
- },
956
- },
957
- },
958
- {
959
- name: 'liara_get_plan',
960
- description: 'Get details of a specific plan',
961
- inputSchema: {
962
- type: 'object',
963
- properties: {
964
- planId: {
965
- type: 'string',
966
- description: 'The plan ID',
967
- },
968
- },
969
- required: ['planId'],
970
- },
971
- },
972
- // DNS Tools
973
- {
974
- name: 'liara_list_zones',
975
- description: 'List all DNS zones',
976
- inputSchema: {
977
- type: 'object',
978
- properties: this.getPaginationProperties(),
979
- },
980
- },
981
- {
982
- name: 'liara_get_zone',
983
- description: 'Get details of a DNS zone',
984
- inputSchema: {
985
- type: 'object',
986
- properties: {
987
- zoneId: {
988
- type: 'string',
989
- description: 'The zone ID',
990
- },
991
- },
992
- required: ['zoneId'],
993
- },
994
- },
995
- {
996
- name: 'liara_create_zone',
997
- description: 'Create a new DNS zone',
998
- inputSchema: {
999
- type: 'object',
1000
- properties: {
1001
- name: {
1002
- type: 'string',
1003
- description: 'Zone name (domain)',
1004
- },
1005
- },
1006
- required: ['name'],
1007
- },
1008
- },
1009
- {
1010
- name: 'liara_delete_zone',
1011
- description: 'Delete a DNS zone',
1012
- inputSchema: {
1013
- type: 'object',
1014
- properties: {
1015
- zoneId: {
1016
- type: 'string',
1017
- description: 'The zone ID to delete',
1018
- },
1019
- },
1020
- required: ['zoneId'],
1021
- },
1022
- },
1023
- {
1024
- name: 'liara_list_dns_records',
1025
- description: 'List DNS records for a zone',
1026
- inputSchema: {
1027
- type: 'object',
1028
- properties: {
1029
- zoneId: {
1030
- type: 'string',
1031
- description: 'The zone ID',
1032
- },
1033
- ...this.getPaginationProperties(),
1034
- },
1035
- required: ['zoneId'],
1036
- },
1037
- },
1038
- {
1039
- name: 'liara_create_dns_record',
1040
- description: 'Create a DNS record',
1041
- inputSchema: {
1042
- type: 'object',
1043
- properties: {
1044
- zoneId: {
1045
- type: 'string',
1046
- description: 'The zone ID',
1047
- },
1048
- type: {
1049
- type: 'string',
1050
- description: 'Record type',
1051
- enum: ['A', 'AAAA', 'CNAME', 'MX', 'TXT', 'NS', 'SRV'],
1052
- },
1053
- name: {
1054
- type: 'string',
1055
- description: 'Record name',
1056
- },
1057
- value: {
1058
- type: 'string',
1059
- description: 'Record value',
1060
- },
1061
- ttl: {
1062
- type: 'number',
1063
- description: 'TTL in seconds (optional)',
1064
- },
1065
- priority: {
1066
- type: 'number',
1067
- description: 'Priority (for MX and SRV records, optional)',
1068
- },
1069
- },
1070
- required: ['zoneId', 'type', 'name', 'value'],
1071
- },
1072
- },
1073
- {
1074
- name: 'liara_get_dns_record',
1075
- description: 'Get details of a DNS record',
1076
- inputSchema: {
1077
- type: 'object',
1078
- properties: {
1079
- zoneId: {
1080
- type: 'string',
1081
- description: 'The zone ID',
1082
- },
1083
- recordId: {
1084
- type: 'string',
1085
- description: 'The record ID',
1086
- },
1087
- },
1088
- required: ['zoneId', 'recordId'],
1089
- },
1090
- },
1091
- {
1092
- name: 'liara_update_dns_record',
1093
- description: 'Update a DNS record',
1094
- inputSchema: {
1095
- type: 'object',
1096
- properties: {
1097
- zoneId: {
1098
- type: 'string',
1099
- description: 'The zone ID',
1100
- },
1101
- recordId: {
1102
- type: 'string',
1103
- description: 'The record ID',
1104
- },
1105
- type: {
1106
- type: 'string',
1107
- description: 'Record type (optional)',
1108
- enum: ['A', 'AAAA', 'CNAME', 'MX', 'TXT', 'NS', 'SRV'],
1109
- },
1110
- name: {
1111
- type: 'string',
1112
- description: 'Record name (optional)',
1113
- },
1114
- value: {
1115
- type: 'string',
1116
- description: 'Record value (optional)',
1117
- },
1118
- ttl: {
1119
- type: 'number',
1120
- description: 'TTL in seconds (optional)',
1121
- },
1122
- priority: {
1123
- type: 'number',
1124
- description: 'Priority (for MX and SRV records, optional)',
1125
- },
1126
- },
1127
- required: ['zoneId', 'recordId'],
1128
- },
1129
- },
1130
- {
1131
- name: 'liara_delete_dns_record',
1132
- description: 'Delete a DNS record',
1133
- inputSchema: {
1134
- type: 'object',
1135
- properties: {
1136
- zoneId: {
1137
- type: 'string',
1138
- description: 'The zone ID',
1139
- },
1140
- recordId: {
1141
- type: 'string',
1142
- description: 'The record ID to delete',
1143
- },
1144
- },
1145
- required: ['zoneId', 'recordId'],
1146
- },
1147
- },
1148
- // Domain Tools (App Domains)
1149
- {
1150
- name: 'liara_list_domains',
1151
- description: 'List all domains attached to apps',
1152
- inputSchema: {
1153
- type: 'object',
1154
- properties: this.getPaginationProperties(),
1155
- },
1156
- },
1157
- {
1158
- name: 'liara_get_domain',
1159
- description: 'Get details of a domain',
1160
- inputSchema: {
1161
- type: 'object',
1162
- properties: {
1163
- domainId: {
1164
- type: 'string',
1165
- description: 'The domain ID',
1166
- },
1167
- },
1168
- required: ['domainId'],
1169
- },
1170
- },
1171
- {
1172
- name: 'liara_add_domain',
1173
- description: 'Add a domain to an app',
1174
- inputSchema: {
1175
- type: 'object',
1176
- properties: {
1177
- appName: {
1178
- type: 'string',
1179
- description: 'The name of the app',
1180
- },
1181
- domain: {
1182
- type: 'string',
1183
- description: 'Domain name to add',
1184
- },
1185
- },
1186
- required: ['appName', 'domain'],
1187
- },
1188
- },
1189
- {
1190
- name: 'liara_remove_domain',
1191
- description: 'Remove a domain from an app',
1192
- inputSchema: {
1193
- type: 'object',
1194
- properties: {
1195
- domainId: {
1196
- type: 'string',
1197
- description: 'The domain ID to remove',
1198
- },
1199
- },
1200
- required: ['domainId'],
1201
- },
1202
- },
1203
- // Mail Tools
1204
- {
1205
- name: 'liara_list_mail_servers',
1206
- description: 'List all mail servers',
1207
- inputSchema: {
1208
- type: 'object',
1209
- properties: this.getPaginationProperties(),
1210
- },
1211
- },
1212
- {
1213
- name: 'liara_get_mail_server',
1214
- description: 'Get details of a mail server',
1215
- inputSchema: {
1216
- type: 'object',
1217
- properties: {
1218
- mailId: {
1219
- type: 'string',
1220
- description: 'The mail server ID',
1221
- },
1222
- },
1223
- required: ['mailId'],
1224
- },
1225
- },
1226
- {
1227
- name: 'liara_create_mail_server',
1228
- description: 'Create a new mail server',
1229
- inputSchema: {
1230
- type: 'object',
1231
- properties: {
1232
- name: {
1233
- type: 'string',
1234
- description: 'Mail server name',
1235
- },
1236
- mode: {
1237
- type: 'string',
1238
- description: 'Mail server mode',
1239
- enum: ['DEV', 'LIVE'],
1240
- },
1241
- planID: {
1242
- type: 'string',
1243
- description: 'Plan ID for the mail server (required)',
1244
- },
1245
- domain: {
1246
- type: 'string',
1247
- description: 'Domain name for the mail server (required)',
1248
- },
1249
- },
1250
- required: ['planID', 'domain'],
1251
- },
1252
- },
1253
- {
1254
- name: 'liara_delete_mail_server',
1255
- description: 'Delete a mail server',
1256
- inputSchema: {
1257
- type: 'object',
1258
- properties: {
1259
- mailId: {
1260
- type: 'string',
1261
- description: 'The mail server ID to delete',
1262
- },
1263
- },
1264
- required: ['mailId'],
1265
- },
1266
- },
1267
- {
1268
- name: 'liara_send_email',
1269
- description: 'Send an email via a mail server',
1270
- inputSchema: {
1271
- type: 'object',
1272
- properties: {
1273
- mailId: {
1274
- type: 'string',
1275
- description: 'The mail server ID',
1276
- },
1277
- from: {
1278
- type: 'string',
1279
- description: 'From email address',
1280
- },
1281
- to: {
1282
- type: 'string',
1283
- description: 'To email address(es) - comma-separated for multiple',
1284
- },
1285
- subject: {
1286
- type: 'string',
1287
- description: 'Email subject',
1288
- },
1289
- html: {
1290
- type: 'string',
1291
- description: 'HTML email content (optional)',
1292
- },
1293
- text: {
1294
- type: 'string',
1295
- description: 'Plain text email content (optional)',
1296
- },
1297
- },
1298
- required: ['mailId', 'from', 'to', 'subject'],
1299
- },
1300
- },
1301
- {
1302
- name: 'liara_start_mail_server',
1303
- description: 'Start a mail server',
1304
- inputSchema: {
1305
- type: 'object',
1306
- properties: {
1307
- mailId: {
1308
- type: 'string',
1309
- description: 'The mail server ID',
1310
- },
1311
- },
1312
- required: ['mailId'],
1313
- },
1314
- },
1315
- {
1316
- name: 'liara_stop_mail_server',
1317
- description: 'Stop a mail server',
1318
- inputSchema: {
1319
- type: 'object',
1320
- properties: {
1321
- mailId: {
1322
- type: 'string',
1323
- description: 'The mail server ID',
1324
- },
1325
- },
1326
- required: ['mailId'],
1327
- },
1328
- },
1329
- {
1330
- name: 'liara_restart_mail_server',
1331
- description: 'Restart a mail server',
1332
- inputSchema: {
1333
- type: 'object',
1334
- properties: {
1335
- mailId: {
1336
- type: 'string',
1337
- description: 'The mail server ID',
1338
- },
1339
- },
1340
- required: ['mailId'],
1341
- },
1342
- },
1343
- // VM (IaaS) Tools
1344
- {
1345
- name: 'liara_list_vms',
1346
- description: 'List all virtual machines',
1347
- inputSchema: {
1348
- type: 'object',
1349
- properties: this.getPaginationProperties(),
1350
- },
1351
- },
1352
- {
1353
- name: 'liara_get_vm',
1354
- description: 'Get details of a virtual machine',
1355
- inputSchema: {
1356
- type: 'object',
1357
- properties: {
1358
- vmId: {
1359
- type: 'string',
1360
- description: 'The VM ID',
1361
- },
1362
- },
1363
- required: ['vmId'],
1364
- },
1365
- },
1366
- {
1367
- name: 'liara_create_vm',
1368
- description: 'Create a new virtual machine',
1369
- inputSchema: {
1370
- type: 'object',
1371
- properties: {
1372
- name: {
1373
- type: 'string',
1374
- description: 'VM name',
1375
- },
1376
- planID: {
1377
- type: 'string',
1378
- description: 'Plan ID for the VM',
1379
- },
1380
- os: {
1381
- type: 'string',
1382
- description: 'Operating system',
1383
- },
1384
- sshKey: {
1385
- type: 'string',
1386
- description: 'SSH public key (optional)',
1387
- },
1388
- network: {
1389
- type: 'string',
1390
- description: 'Network ID (required by the API)',
1391
- },
1392
- },
1393
- required: ['name', 'planID', 'os', 'network'],
1394
- },
1395
- },
1396
- {
1397
- name: 'liara_start_vm',
1398
- description: 'Start a virtual machine',
1399
- inputSchema: {
1400
- type: 'object',
1401
- properties: {
1402
- vmId: {
1403
- type: 'string',
1404
- description: 'The VM ID',
1405
- },
1406
- },
1407
- required: ['vmId'],
1408
- },
1409
- },
1410
- {
1411
- name: 'liara_stop_vm',
1412
- description: 'Stop a virtual machine',
1413
- inputSchema: {
1414
- type: 'object',
1415
- properties: {
1416
- vmId: {
1417
- type: 'string',
1418
- description: 'The VM ID',
1419
- },
1420
- },
1421
- required: ['vmId'],
1422
- },
1423
- },
1424
- {
1425
- name: 'liara_restart_vm',
1426
- description: 'Restart a virtual machine',
1427
- inputSchema: {
1428
- type: 'object',
1429
- properties: {
1430
- vmId: {
1431
- type: 'string',
1432
- description: 'The VM ID',
1433
- },
1434
- },
1435
- required: ['vmId'],
1436
- },
1437
- },
1438
- {
1439
- name: 'liara_delete_vm',
1440
- inputSchema: {
1441
- type: 'object',
1442
- properties: {
1443
- vmId: {
1444
- type: 'string',
1445
- description: 'The VM ID',
1446
- },
1447
- },
1448
- required: ['vmId'],
1449
- },
1450
- },
1451
- {
1452
- name: 'liara_delete_vm',
1453
- description: 'Delete a virtual machine',
1454
- inputSchema: {
1455
- type: 'object',
1456
- properties: {
1457
- vmId: {
1458
- type: 'string',
1459
- description: 'The VM ID to delete',
1460
- },
1461
- },
1462
- required: ['vmId'],
1463
- },
1464
- },
1465
- {
1466
- name: 'liara_resize_vm',
1467
- description: 'Resize a virtual machine (change plan)',
1468
- inputSchema: {
1469
- type: 'object',
1470
- properties: {
1471
- vmId: {
1472
- type: 'string',
1473
- description: 'The VM ID',
1474
- },
1475
- planID: {
1476
- type: 'string',
1477
- description: 'New plan ID',
1478
- },
1479
- },
1480
- required: ['vmId', 'planID'],
1481
- },
1482
- },
1483
- {
1484
- name: 'liara_create_snapshot',
1485
- description: 'Create a VM snapshot',
1486
- inputSchema: {
1487
- type: 'object',
1488
- properties: {
1489
- vmId: {
1490
- type: 'string',
1491
- description: 'The VM ID',
1492
- },
1493
- name: {
1494
- type: 'string',
1495
- description: 'Snapshot name (optional)',
1496
- },
1497
- },
1498
- required: ['vmId'],
1499
- },
1500
- },
1501
- {
1502
- name: 'liara_list_snapshots',
1503
- description: 'List VM snapshots',
1504
- inputSchema: {
1505
- type: 'object',
1506
- properties: {
1507
- vmId: {
1508
- type: 'string',
1509
- description: 'The VM ID',
1510
- },
1511
- ...this.getPaginationProperties(),
1512
- },
1513
- required: ['vmId'],
1514
- },
1515
- },
1516
- {
1517
- name: 'liara_restore_snapshot',
1518
- description: 'Restore a VM from a snapshot',
1519
- inputSchema: {
1520
- type: 'object',
1521
- properties: {
1522
- vmId: {
1523
- type: 'string',
1524
- description: 'The VM ID',
1525
- },
1526
- snapshotId: {
1527
- type: 'string',
1528
- description: 'The snapshot ID',
1529
- },
1530
- },
1531
- required: ['vmId', 'snapshotId'],
1532
- },
1533
- },
1534
- {
1535
- name: 'liara_delete_snapshot',
1536
- description: 'Delete a VM snapshot',
1537
- inputSchema: {
1538
- type: 'object',
1539
- properties: {
1540
- vmId: {
1541
- type: 'string',
1542
- description: 'The VM ID',
1543
- },
1544
- snapshotId: {
1545
- type: 'string',
1546
- description: 'The snapshot ID to delete',
1547
- },
1548
- },
1549
- required: ['vmId', 'snapshotId'],
1550
- },
1551
- },
1552
- {
1553
- name: 'liara_attach_network',
1554
- description: 'Attach a network to a VM',
1555
- inputSchema: {
1556
- type: 'object',
1557
- properties: {
1558
- vmId: {
1559
- type: 'string',
1560
- description: 'The VM ID',
1561
- },
1562
- networkId: {
1563
- type: 'string',
1564
- description: 'The network ID',
1565
- },
1566
- },
1567
- required: ['vmId', 'networkId'],
1568
- },
1569
- },
1570
- {
1571
- name: 'liara_detach_network',
1572
- description: 'Detach a network from a VM',
1573
- inputSchema: {
1574
- type: 'object',
1575
- properties: {
1576
- vmId: {
1577
- type: 'string',
1578
- description: 'The VM ID',
1579
- },
1580
- networkId: {
1581
- type: 'string',
1582
- description: 'The network ID',
1583
- },
1584
- },
1585
- required: ['vmId', 'networkId'],
1586
- },
1587
- },
1588
- // Disk Tools
1589
- {
1590
- name: 'liara_list_disks',
1591
- description: 'List disks for an app',
1592
- inputSchema: {
1593
- type: 'object',
1594
- properties: {
1595
- appName: {
1596
- type: 'string',
1597
- description: 'The name of the app',
1598
- },
1599
- ...this.getPaginationProperties(),
1600
- },
1601
- required: ['appName'],
1602
- },
1603
- },
1604
- {
1605
- name: 'liara_create_disk',
1606
- description: 'Create a new disk for an app',
1607
- inputSchema: {
1608
- type: 'object',
1609
- properties: {
1610
- appName: {
1611
- type: 'string',
1612
- description: 'The name of the app',
1613
- },
1614
- name: {
1615
- type: 'string',
1616
- description: 'Disk name',
1617
- },
1618
- size: {
1619
- type: 'number',
1620
- description: 'Disk size in GB',
1621
- },
1622
- mountPath: {
1623
- type: 'string',
1624
- description: 'Mount path for the disk',
1625
- },
1626
- },
1627
- required: ['appName', 'name', 'size', 'mountPath'],
1628
- },
1629
- },
1630
- {
1631
- name: 'liara_delete_disk',
1632
- description: 'Delete a disk',
1633
- inputSchema: {
1634
- type: 'object',
1635
- properties: {
1636
- appName: {
1637
- type: 'string',
1638
- description: 'The name of the app',
1639
- },
1640
- diskName: {
1641
- type: 'string',
1642
- description: 'The name of the disk to delete',
1643
- },
1644
- },
1645
- required: ['appName', 'diskName'],
1646
- },
1647
- },
1648
- {
1649
- name: 'liara_get_disk',
1650
- description: 'Get details of a specific disk',
1651
- inputSchema: {
1652
- type: 'object',
1653
- properties: {
1654
- appName: {
1655
- type: 'string',
1656
- description: 'The name of the app',
1657
- },
1658
- diskName: {
1659
- type: 'string',
1660
- description: 'The name of the disk',
1661
- },
1662
- },
1663
- required: ['appName', 'diskName'],
1664
- },
1665
- },
1666
- {
1667
- name: 'liara_resize_disk',
1668
- description: 'Resize a disk',
1669
- inputSchema: {
1670
- type: 'object',
1671
- properties: {
1672
- appName: {
1673
- type: 'string',
1674
- description: 'The name of the app',
1675
- },
1676
- diskName: {
1677
- type: 'string',
1678
- description: 'The name of the disk',
1679
- },
1680
- size: {
1681
- type: 'number',
1682
- description: 'New disk size in GB',
1683
- },
1684
- },
1685
- required: ['appName', 'diskName', 'size'],
1686
- },
1687
- },
1688
- {
1689
- name: 'liara_create_ftp_access',
1690
- description: 'Create FTP access for a disk',
1691
- inputSchema: {
1692
- type: 'object',
1693
- properties: {
1694
- appName: {
1695
- type: 'string',
1696
- description: 'The name of the app',
1697
- },
1698
- diskName: {
1699
- type: 'string',
1700
- description: 'The name of the disk',
1701
- },
1702
- },
1703
- required: ['appName', 'diskName'],
1704
- },
1705
- },
1706
- {
1707
- name: 'liara_list_ftp_accesses',
1708
- description: 'List FTP accesses for a disk',
1709
- inputSchema: {
1710
- type: 'object',
1711
- properties: {
1712
- appName: {
1713
- type: 'string',
1714
- description: 'The name of the app',
1715
- },
1716
- diskName: {
1717
- type: 'string',
1718
- description: 'The name of the disk',
1719
- },
1720
- ...this.getPaginationProperties(),
1721
- },
1722
- required: ['appName', 'diskName'],
1723
- },
1724
- },
1725
- {
1726
- name: 'liara_delete_ftp_access',
1727
- description: 'Delete/revoke FTP access for a disk',
1728
- inputSchema: {
1729
- type: 'object',
1730
- properties: {
1731
- appName: {
1732
- type: 'string',
1733
- description: 'The name of the app',
1734
- },
1735
- diskName: {
1736
- type: 'string',
1737
- description: 'The name of the disk',
1738
- },
1739
- ftpId: {
1740
- type: 'string',
1741
- description: 'The FTP access ID to delete',
1742
- },
1743
- },
1744
- required: ['appName', 'diskName', 'ftpId'],
1745
- },
1746
- },
1747
- // Network Tools
1748
- {
1749
- name: 'liara_list_networks',
1750
- description: 'List all networks',
1751
- inputSchema: {
1752
- type: 'object',
1753
- properties: this.getPaginationProperties(),
1754
- },
1755
- },
1756
- {
1757
- name: 'liara_get_network',
1758
- description: 'Get details of a network',
1759
- inputSchema: {
1760
- type: 'object',
1761
- properties: {
1762
- networkId: {
1763
- type: 'string',
1764
- description: 'The network ID',
1765
- },
1766
- },
1767
- required: ['networkId'],
1768
- },
1769
- },
1770
- {
1771
- name: 'liara_create_network',
1772
- description: 'Create a new network',
1773
- inputSchema: {
1774
- type: 'object',
1775
- properties: {
1776
- name: {
1777
- type: 'string',
1778
- description: 'Network name',
1779
- },
1780
- cidr: {
1781
- type: 'string',
1782
- description: 'CIDR block (optional)',
1783
- },
1784
- },
1785
- required: ['name'],
1786
- },
1787
- },
1788
- {
1789
- name: 'liara_delete_network',
1790
- description: 'Delete a network',
1791
- inputSchema: {
1792
- type: 'object',
1793
- properties: {
1794
- networkId: {
1795
- type: 'string',
1796
- description: 'The network ID to delete',
1797
- },
1798
- },
1799
- required: ['networkId'],
1800
- },
1801
- },
1802
- // User Tools
1803
- {
1804
- name: 'liara_get_user',
1805
- description: 'Get comprehensive user information including plans and teams',
1806
- inputSchema: {
1807
- type: 'object',
1808
- properties: {},
1809
- },
1810
- },
1811
- // Observability Tools
1812
- {
1813
- name: 'liara_get_metrics',
1814
- description: 'Get app metrics summary',
1815
- inputSchema: {
1816
- type: 'object',
1817
- properties: {
1818
- appName: {
1819
- type: 'string',
1820
- description: 'The name of the app',
1821
- },
1822
- period: {
1823
- type: 'string',
1824
- description: 'Time period for metrics (optional)',
1825
- },
1826
- },
1827
- required: ['appName'],
1828
- },
1829
- },
1830
- {
1831
- name: 'liara_get_logs',
1832
- description: 'Get app logs',
1833
- inputSchema: {
1834
- type: 'object',
1835
- properties: {
1836
- appName: {
1837
- type: 'string',
1838
- description: 'The name of the app',
1839
- },
1840
- limit: {
1841
- type: 'number',
1842
- description: 'Maximum number of log entries (optional, default: 100)',
1843
- },
1844
- since: {
1845
- type: 'string',
1846
- description: 'ISO timestamp to fetch logs since (optional)',
1847
- },
1848
- until: {
1849
- type: 'string',
1850
- description: 'ISO timestamp to fetch logs until (optional)',
1851
- },
1852
- },
1853
- required: ['appName'],
1854
- },
1855
- },
1856
- ],
48
+ tools: getAllTools(),
1857
49
  }));
1858
50
  }
1859
51
  setupCallToolHandler() {
1860
52
  this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
1861
- try {
1862
- const { name, arguments: args } = request.params;
1863
- switch (name) {
1864
- // App Management
1865
- case 'liara_list_apps': {
1866
- const apps = await appService.listApps(this.client, this.extractPagination(args));
1867
- return {
1868
- content: [
1869
- {
1870
- type: 'text',
1871
- text: JSON.stringify(apps, null, 2),
1872
- },
1873
- ],
1874
- };
1875
- }
1876
- case 'liara_get_app': {
1877
- const app = await appService.getApp(this.client, args.name);
1878
- return {
1879
- content: [
1880
- {
1881
- type: 'text',
1882
- text: JSON.stringify(app, null, 2),
1883
- },
1884
- ],
1885
- };
1886
- }
1887
- case 'liara_create_app': {
1888
- const app = await appService.createApp(this.client, args);
1889
- return {
1890
- content: [
1891
- {
1892
- type: 'text',
1893
- text: JSON.stringify({
1894
- success: true,
1895
- data: app,
1896
- message: `App "${app.name}" created successfully`
1897
- }, null, 2),
1898
- },
1899
- ],
1900
- };
1901
- }
1902
- case 'liara_delete_app': {
1903
- await appService.deleteApp(this.client, args.name);
1904
- return {
1905
- content: [
1906
- {
1907
- type: 'text',
1908
- text: `App "${args.name}" deleted successfully.`,
1909
- },
1910
- ],
1911
- };
1912
- }
1913
- case 'liara_start_app': {
1914
- await appService.startApp(this.client, args.name);
1915
- return {
1916
- content: [
1917
- {
1918
- type: 'text',
1919
- text: `App "${args.name}" started successfully.`,
1920
- },
1921
- ],
1922
- };
1923
- }
1924
- case 'liara_stop_app': {
1925
- await appService.stopApp(this.client, args.name);
1926
- return {
1927
- content: [
1928
- {
1929
- type: 'text',
1930
- text: `App "${args.name}" stopped successfully.`,
1931
- },
1932
- ],
1933
- };
1934
- }
1935
- case 'liara_restart_app': {
1936
- await appService.restartApp(this.client, args.name);
1937
- return {
1938
- content: [
1939
- {
1940
- type: 'text',
1941
- text: `App "${args.name}" restarted successfully.`,
1942
- },
1943
- ],
1944
- };
1945
- }
1946
- case 'liara_resize_app': {
1947
- await appService.resizeApp(this.client, args.name, args.planID);
1948
- return {
1949
- content: [
1950
- {
1951
- type: 'text',
1952
- text: `App "${args.name}" resized to plan "${args.planID}" successfully.`,
1953
- },
1954
- ],
1955
- };
1956
- }
1957
- // Environment Variables
1958
- case 'liara_set_env_vars': {
1959
- const result = await envService.updateEnvVars(this.client, args.appName, args.variables);
1960
- return {
1961
- content: [
1962
- {
1963
- type: 'text',
1964
- text: result.message || 'Environment variables updated successfully.',
1965
- },
1966
- ],
1967
- };
1968
- }
1969
- case 'liara_set_env_var': {
1970
- const result = await envService.setEnvVar(this.client, args.appName, args.key, args.value);
1971
- return {
1972
- content: [
1973
- {
1974
- type: 'text',
1975
- text: result.message || `Environment variable ${args.key} set successfully.`,
1976
- },
1977
- ],
1978
- };
1979
- }
1980
- case 'liara_get_env_vars': {
1981
- const envVars = await envService.getEnvVars(this.client, args.appName);
1982
- return {
1983
- content: [
1984
- {
1985
- type: 'text',
1986
- text: JSON.stringify(envVars, null, 2),
1987
- },
1988
- ],
1989
- };
1990
- }
1991
- case 'liara_delete_env_var': {
1992
- const result = await envService.deleteEnvVar(this.client, args.appName, args.key);
1993
- return {
1994
- content: [
1995
- {
1996
- type: 'text',
1997
- text: result.message || `Environment variable ${args.key} deleted successfully.`,
1998
- },
1999
- ],
2000
- };
2001
- }
2002
- case 'liara_delete_env_vars': {
2003
- const result = await envService.deleteEnvVars(this.client, args.appName, args.keys);
2004
- return {
2005
- content: [
2006
- {
2007
- type: 'text',
2008
- text: result.message || 'Environment variables deleted successfully.',
2009
- },
2010
- ],
2011
- };
2012
- }
2013
- // App Settings
2014
- case 'liara_set_zero_downtime': {
2015
- const result = await settingsService.setZeroDowntime(this.client, args.appName, args.enabled);
2016
- return {
2017
- content: [
2018
- {
2019
- type: 'text',
2020
- text: result.message || `Zero-downtime deployment ${args.enabled ? 'enabled' : 'disabled'} successfully.`,
2021
- },
2022
- ],
2023
- };
2024
- }
2025
- case 'liara_set_default_subdomain': {
2026
- const result = await settingsService.setDefaultSubdomain(this.client, args.appName, args.enabled);
2027
- return {
2028
- content: [
2029
- {
2030
- type: 'text',
2031
- text: result.message || `Default subdomain ${args.enabled ? 'enabled' : 'disabled'} successfully.`,
2032
- },
2033
- ],
2034
- };
2035
- }
2036
- case 'liara_set_fixed_ip': {
2037
- const result = await settingsService.setFixedIP(this.client, args.appName, args.enabled);
2038
- const ipInfo = result.IP ? `\nStatic IP: ${result.IP}` : '';
2039
- return {
2040
- content: [
2041
- {
2042
- type: 'text',
2043
- text: (result.message || `Static IP ${args.enabled ? 'enabled' : 'disabled'} successfully.`) + ipInfo,
2044
- },
2045
- ],
2046
- };
2047
- }
2048
- case 'liara_set_read_only': {
2049
- const result = await settingsService.setReadOnly(this.client, args.appName, args.enabled);
2050
- return {
2051
- content: [
2052
- {
2053
- type: 'text',
2054
- text: result.message || `Read-only mode ${args.enabled ? 'enabled' : 'disabled'} successfully.`,
2055
- },
2056
- ],
2057
- };
2058
- }
2059
- // Deployment
2060
- case 'liara_upload_source': {
2061
- const result = await deployService.uploadSource(this.client, args.appName, args.filePath);
2062
- return {
2063
- content: [
2064
- {
2065
- type: 'text',
2066
- text: `Source uploaded successfully. Source ID: ${result.sourceID}`,
2067
- },
2068
- ],
2069
- };
2070
- }
2071
- case 'liara_deploy_release': {
2072
- const result = await deployService.deployRelease(this.client, args.appName, {
2073
- sourceID: args.sourceID,
2074
- envVars: args.envVars,
2075
- });
2076
- return {
2077
- content: [
2078
- {
2079
- type: 'text',
2080
- text: `Deployment initiated. Release ID: ${result.releaseID}`,
2081
- },
2082
- ],
2083
- };
2084
- }
2085
- case 'liara_list_releases': {
2086
- const releases = await deployService.listReleases(this.client, args.appName, this.extractPagination(args));
2087
- return {
2088
- content: [
2089
- {
2090
- type: 'text',
2091
- text: JSON.stringify(releases, null, 2),
2092
- },
2093
- ],
2094
- };
2095
- }
2096
- case 'liara_get_release': {
2097
- const release = await deployService.getRelease(this.client, args.appName, args.releaseID);
2098
- return {
2099
- content: [
2100
- {
2101
- type: 'text',
2102
- text: JSON.stringify(release, null, 2),
2103
- },
2104
- ],
2105
- };
2106
- }
2107
- case 'liara_rollback_release': {
2108
- const result = await deployService.rollbackRelease(this.client, args.appName, args.releaseID);
2109
- return {
2110
- content: [
2111
- {
2112
- type: 'text',
2113
- text: result.message || `Rolled back to release "${args.releaseID}" successfully.`,
2114
- },
2115
- ],
2116
- };
2117
- }
2118
- case 'liara_list_sources': {
2119
- const sources = await deployService.listSources(this.client, args.appName, this.extractPagination(args));
2120
- return {
2121
- content: [
2122
- {
2123
- type: 'text',
2124
- text: JSON.stringify(sources, null, 2),
2125
- },
2126
- ],
2127
- };
2128
- }
2129
- case 'liara_delete_source': {
2130
- await deployService.deleteSource(this.client, args.appName, args.sourceID);
2131
- return {
2132
- content: [
2133
- {
2134
- type: 'text',
2135
- text: `Source "${args.sourceID}" deleted successfully.`,
2136
- },
2137
- ],
2138
- };
2139
- }
2140
- // Databases
2141
- case 'liara_list_databases': {
2142
- const databases = await dbService.listDatabases(this.client);
2143
- return {
2144
- content: [
2145
- {
2146
- type: 'text',
2147
- text: JSON.stringify(databases, null, 2),
2148
- },
2149
- ],
2150
- };
2151
- }
2152
- case 'liara_get_database': {
2153
- const database = await dbService.getDatabase(this.client, args.name);
2154
- return {
2155
- content: [
2156
- {
2157
- type: 'text',
2158
- text: JSON.stringify(database, null, 2),
2159
- },
2160
- ],
2161
- };
2162
- }
2163
- case 'liara_get_database_connection': {
2164
- const connection = await dbService.getDatabaseConnection(this.client, args.databaseName);
2165
- return {
2166
- content: [
2167
- {
2168
- type: 'text',
2169
- text: JSON.stringify(connection, null, 2),
2170
- },
2171
- ],
2172
- };
2173
- }
2174
- case 'liara_update_database': {
2175
- const database = await dbService.updateDatabase(this.client, args.name, {
2176
- planID: args.planID,
2177
- version: args.version,
2178
- });
2179
- return {
2180
- content: [
2181
- {
2182
- type: 'text',
2183
- text: `Database "${args.name}" updated successfully.\n${JSON.stringify(database, null, 2)}`,
2184
- },
2185
- ],
2186
- };
2187
- }
2188
- case 'liara_create_database': {
2189
- const database = await dbService.createDatabase(this.client, args);
2190
- return {
2191
- content: [
2192
- {
2193
- type: 'text',
2194
- text: `Database "${database.name}" created successfully.\n${JSON.stringify(database, null, 2)}`,
2195
- },
2196
- ],
2197
- };
2198
- }
2199
- case 'liara_delete_database': {
2200
- await dbService.deleteDatabase(this.client, args.name);
2201
- return {
2202
- content: [
2203
- {
2204
- type: 'text',
2205
- text: `Database "${args.name}" deleted successfully.`,
2206
- },
2207
- ],
2208
- };
2209
- }
2210
- case 'liara_start_database': {
2211
- await dbService.startDatabase(this.client, args.name);
2212
- return {
2213
- content: [
2214
- {
2215
- type: 'text',
2216
- text: `Database "${args.name}" started successfully.`,
2217
- },
2218
- ],
2219
- };
2220
- }
2221
- case 'liara_stop_database': {
2222
- await dbService.stopDatabase(this.client, args.name);
2223
- return {
2224
- content: [
2225
- {
2226
- type: 'text',
2227
- text: `Database "${args.name}" stopped successfully.`,
2228
- },
2229
- ],
2230
- };
2231
- }
2232
- case 'liara_resize_database': {
2233
- await dbService.resizeDatabase(this.client, args.name, args.planID);
2234
- return {
2235
- content: [
2236
- {
2237
- type: 'text',
2238
- text: `Database "${args.name}" resized to plan "${args.planID}" successfully.`,
2239
- },
2240
- ],
2241
- };
2242
- }
2243
- case 'liara_create_backup': {
2244
- const backup = await dbService.createBackup(this.client, args.databaseName);
2245
- return {
2246
- content: [
2247
- {
2248
- type: 'text',
2249
- text: `Backup created successfully.\n${JSON.stringify(backup, null, 2)}`,
2250
- },
2251
- ],
2252
- };
2253
- }
2254
- case 'liara_list_backups': {
2255
- const backups = await dbService.listBackups(this.client, args.databaseName);
2256
- return {
2257
- content: [
2258
- {
2259
- type: 'text',
2260
- text: JSON.stringify(backups, null, 2),
2261
- },
2262
- ],
2263
- };
2264
- }
2265
- case 'liara_get_backup_download_url': {
2266
- const result = await dbService.getBackupDownloadUrl(this.client, args.databaseName, args.backupId);
2267
- return {
2268
- content: [
2269
- {
2270
- type: 'text',
2271
- text: JSON.stringify(result, null, 2),
2272
- },
2273
- ],
2274
- };
2275
- }
2276
- case 'liara_restart_database': {
2277
- await dbService.restartDatabase(this.client, args.name);
2278
- return {
2279
- content: [
2280
- {
2281
- type: 'text',
2282
- text: `Database "${args.name}" restarted successfully.`,
2283
- },
2284
- ],
2285
- };
2286
- }
2287
- case 'liara_restore_backup': {
2288
- const result = await dbService.restoreBackup(this.client, args.databaseName, args.backupId);
2289
- return {
2290
- content: [
2291
- {
2292
- type: 'text',
2293
- text: result.message || `Database "${args.databaseName}" restored from backup "${args.backupId}" successfully.`,
2294
- },
2295
- ],
2296
- };
2297
- }
2298
- case 'liara_delete_backup': {
2299
- await dbService.deleteBackup(this.client, args.databaseName, args.backupId);
2300
- return {
2301
- content: [
2302
- {
2303
- type: 'text',
2304
- text: `Backup "${args.backupId}" deleted successfully.`,
2305
- },
2306
- ],
2307
- };
2308
- }
2309
- // Storage
2310
- case 'liara_list_buckets': {
2311
- const buckets = await storageService.listBuckets(this.client, this.extractPagination(args));
2312
- return {
2313
- content: [
2314
- {
2315
- type: 'text',
2316
- text: JSON.stringify(buckets, null, 2),
2317
- },
2318
- ],
2319
- };
2320
- }
2321
- case 'liara_get_bucket': {
2322
- const bucket = await storageService.getBucket(this.client, args.name);
2323
- return {
2324
- content: [
2325
- {
2326
- type: 'text',
2327
- text: JSON.stringify(bucket, null, 2),
2328
- },
2329
- ],
2330
- };
2331
- }
2332
- case 'liara_create_bucket': {
2333
- const bucket = await storageService.createBucket(this.client, args);
2334
- return {
2335
- content: [
2336
- {
2337
- type: 'text',
2338
- text: `Bucket "${bucket.name}" created successfully.\n${JSON.stringify(bucket, null, 2)}`,
2339
- },
2340
- ],
2341
- };
2342
- }
2343
- case 'liara_delete_bucket': {
2344
- await storageService.deleteBucket(this.client, args.name);
2345
- return {
2346
- content: [
2347
- {
2348
- type: 'text',
2349
- text: `Bucket "${args.name}" deleted successfully.`,
2350
- },
2351
- ],
2352
- };
2353
- }
2354
- case 'liara_get_bucket_credentials': {
2355
- const credentials = await storageService.getBucketCredentials(this.client, args.name);
2356
- return {
2357
- content: [
2358
- {
2359
- type: 'text',
2360
- text: JSON.stringify(credentials, null, 2),
2361
- },
2362
- ],
2363
- };
2364
- }
2365
- case 'liara_list_objects': {
2366
- const objects = await storageService.listObjects(this.client, args.bucketName, args?.prefix, args?.maxKeys);
2367
- return {
2368
- content: [
2369
- {
2370
- type: 'text',
2371
- text: JSON.stringify(objects, null, 2),
2372
- },
2373
- ],
2374
- };
2375
- }
2376
- case 'liara_upload_object': {
2377
- const result = await storageService.uploadObject(this.client, args.bucketName, args.objectKey, args.filePath);
2378
- return {
2379
- content: [
2380
- {
2381
- type: 'text',
2382
- text: result.message || `Object "${args.objectKey}" uploaded successfully.`,
2383
- },
2384
- ],
2385
- };
2386
- }
2387
- case 'liara_get_object_download_url': {
2388
- const result = await storageService.getObjectDownloadUrl(this.client, args.bucketName, args.objectKey, args?.expiresIn);
2389
- return {
2390
- content: [
2391
- {
2392
- type: 'text',
2393
- text: JSON.stringify(result, null, 2),
2394
- },
2395
- ],
2396
- };
2397
- }
2398
- case 'liara_delete_object': {
2399
- await storageService.deleteObject(this.client, args.bucketName, args.objectKey);
2400
- return {
2401
- content: [
2402
- {
2403
- type: 'text',
2404
- text: `Object "${args.objectKey}" deleted successfully.`,
2405
- },
2406
- ],
2407
- };
2408
- }
2409
- // Plans
2410
- case 'liara_list_plans': {
2411
- const plans = await planService.listPlans(this.client, args?.planType, this.extractPagination(args));
2412
- return {
2413
- content: [
2414
- {
2415
- type: 'text',
2416
- text: JSON.stringify(plans, null, 2),
2417
- },
2418
- ],
2419
- };
2420
- }
2421
- case 'liara_get_plan': {
2422
- const plan = await planService.getPlan(this.client, args.planId);
2423
- return {
2424
- content: [
2425
- {
2426
- type: 'text',
2427
- text: JSON.stringify(plan, null, 2),
2428
- },
2429
- ],
2430
- };
2431
- }
2432
- // DNS
2433
- case 'liara_list_zones': {
2434
- const zones = await dnsService.listZones(this.client, this.extractPagination(args));
2435
- return {
2436
- content: [
2437
- {
2438
- type: 'text',
2439
- text: JSON.stringify(zones, null, 2),
2440
- },
2441
- ],
2442
- };
2443
- }
2444
- case 'liara_get_zone': {
2445
- const zone = await dnsService.getZone(this.client, args.zoneId);
2446
- return {
2447
- content: [
2448
- {
2449
- type: 'text',
2450
- text: JSON.stringify(zone, null, 2),
2451
- },
2452
- ],
2453
- };
2454
- }
2455
- case 'liara_create_zone': {
2456
- const zone = await dnsService.createZone(this.client, args.name);
2457
- return {
2458
- content: [
2459
- {
2460
- type: 'text',
2461
- text: `Zone "${zone.name}" created successfully.\n${JSON.stringify(zone, null, 2)}`,
2462
- },
2463
- ],
2464
- };
2465
- }
2466
- case 'liara_delete_zone': {
2467
- await dnsService.deleteZone(this.client, args.zoneId);
2468
- return {
2469
- content: [
2470
- {
2471
- type: 'text',
2472
- text: `Zone "${args.zoneId}" deleted successfully.`,
2473
- },
2474
- ],
2475
- };
2476
- }
2477
- case 'liara_list_dns_records': {
2478
- const records = await dnsService.listRecords(this.client, args.zoneId, this.extractPagination(args));
2479
- return {
2480
- content: [
2481
- {
2482
- type: 'text',
2483
- text: JSON.stringify(records, null, 2),
2484
- },
2485
- ],
2486
- };
2487
- }
2488
- case 'liara_create_dns_record': {
2489
- const record = await dnsService.createRecord(this.client, args.zoneId, {
2490
- type: args.type,
2491
- name: args.name,
2492
- value: args.value,
2493
- ttl: args?.ttl,
2494
- priority: args?.priority,
2495
- });
2496
- return {
2497
- content: [
2498
- {
2499
- type: 'text',
2500
- text: `DNS record created successfully.\n${JSON.stringify(record, null, 2)}`,
2501
- },
2502
- ],
2503
- };
2504
- }
2505
- case 'liara_get_dns_record': {
2506
- const record = await dnsService.getRecord(this.client, args.zoneId, args.recordId);
2507
- return {
2508
- content: [
2509
- {
2510
- type: 'text',
2511
- text: JSON.stringify(record, null, 2),
2512
- },
2513
- ],
2514
- };
2515
- }
2516
- case 'liara_update_dns_record': {
2517
- const record = await dnsService.updateRecord(this.client, args.zoneId, args.recordId, {
2518
- type: args?.type,
2519
- name: args?.name,
2520
- value: args?.value,
2521
- ttl: args?.ttl,
2522
- priority: args?.priority,
2523
- });
2524
- return {
2525
- content: [
2526
- {
2527
- type: 'text',
2528
- text: `DNS record updated successfully.\n${JSON.stringify(record, null, 2)}`,
2529
- },
2530
- ],
2531
- };
2532
- }
2533
- case 'liara_delete_dns_record': {
2534
- await dnsService.deleteRecord(this.client, args.zoneId, args.recordId);
2535
- return {
2536
- content: [
2537
- {
2538
- type: 'text',
2539
- text: `DNS record "${args.recordId}" deleted successfully.`,
2540
- },
2541
- ],
2542
- };
2543
- }
2544
- // Domains (App Domains)
2545
- case 'liara_list_domains': {
2546
- const domains = await domainService.listDomains(this.client, this.extractPagination(args));
2547
- return {
2548
- content: [
2549
- {
2550
- type: 'text',
2551
- text: JSON.stringify(domains, null, 2),
2552
- },
2553
- ],
2554
- };
2555
- }
2556
- case 'liara_get_domain': {
2557
- const domain = await domainService.getDomain(this.client, args.domainId);
2558
- return {
2559
- content: [
2560
- {
2561
- type: 'text',
2562
- text: JSON.stringify(domain, null, 2),
2563
- },
2564
- ],
2565
- };
2566
- }
2567
- case 'liara_add_domain': {
2568
- const domain = await domainService.addDomain(this.client, args.appName, args.domain);
2569
- return {
2570
- content: [
2571
- {
2572
- type: 'text',
2573
- text: `Domain "${domain.name}" added successfully.\n${JSON.stringify(domain, null, 2)}`,
2574
- },
2575
- ],
2576
- };
2577
- }
2578
- case 'liara_remove_domain': {
2579
- await domainService.removeDomain(this.client, args.domainId);
2580
- return {
2581
- content: [
2582
- {
2583
- type: 'text',
2584
- text: `Domain "${args.domainId}" removed successfully.`,
2585
- },
2586
- ],
2587
- };
2588
- }
2589
- // Mail
2590
- case 'liara_list_mail_servers': {
2591
- const servers = await mailService.listMailServers(this.client, this.extractPagination(args));
2592
- return {
2593
- content: [
2594
- {
2595
- type: 'text',
2596
- text: JSON.stringify(servers, null, 2),
2597
- },
2598
- ],
2599
- };
2600
- }
2601
- case 'liara_get_mail_server': {
2602
- const server = await mailService.getMailServer(this.client, args.mailId);
2603
- return {
2604
- content: [
2605
- {
2606
- type: 'text',
2607
- text: JSON.stringify(server, null, 2),
2608
- },
2609
- ],
2610
- };
2611
- }
2612
- case 'liara_create_mail_server': {
2613
- const server = await mailService.createMailServer(this.client, args.name, args?.mode, args?.planID, args?.domain);
2614
- return {
2615
- content: [
2616
- {
2617
- type: 'text',
2618
- text: `Mail server "${server.name}" created successfully.\n${JSON.stringify(server, null, 2)}`,
2619
- },
2620
- ],
2621
- };
2622
- }
2623
- case 'liara_delete_mail_server': {
2624
- await mailService.deleteMailServer(this.client, args.mailId);
2625
- return {
2626
- content: [
2627
- {
2628
- type: 'text',
2629
- text: `Mail server "${args.mailId}" deleted successfully.`,
2630
- },
2631
- ],
2632
- };
2633
- }
2634
- case 'liara_send_email': {
2635
- const toAddresses = args.to.split(',').map(s => s.trim());
2636
- const result = await mailService.sendEmail(this.client, args.mailId, {
2637
- from: args.from,
2638
- to: toAddresses.length === 1 ? toAddresses[0] : toAddresses,
2639
- subject: args.subject,
2640
- html: args?.html,
2641
- text: args?.text,
2642
- });
2643
- return {
2644
- content: [
2645
- {
2646
- type: 'text',
2647
- text: result.message || 'Email sent successfully.',
2648
- },
2649
- ],
2650
- };
2651
- }
2652
- case 'liara_start_mail_server': {
2653
- await mailService.startMailServer(this.client, args.mailId);
2654
- return {
2655
- content: [
2656
- {
2657
- type: 'text',
2658
- text: `Mail server "${args.mailId}" started successfully.`,
2659
- },
2660
- ],
2661
- };
2662
- }
2663
- case 'liara_stop_mail_server': {
2664
- await mailService.stopMailServer(this.client, args.mailId);
2665
- return {
2666
- content: [
2667
- {
2668
- type: 'text',
2669
- text: `Mail server "${args.mailId}" stopped successfully.`,
2670
- },
2671
- ],
2672
- };
2673
- }
2674
- case 'liara_restart_mail_server': {
2675
- await mailService.restartMailServer(this.client, args.mailId);
2676
- return {
2677
- content: [
2678
- {
2679
- type: 'text',
2680
- text: `Mail server "${args.mailId}" restarted successfully.`,
2681
- },
2682
- ],
2683
- };
2684
- }
2685
- // VMs
2686
- case 'liara_list_vms': {
2687
- const vms = await iaasService.listVMs(this.client, this.extractPagination(args));
2688
- return {
2689
- content: [
2690
- {
2691
- type: 'text',
2692
- text: JSON.stringify(vms, null, 2),
2693
- },
2694
- ],
2695
- };
2696
- }
2697
- case 'liara_get_vm': {
2698
- const vm = await iaasService.getVM(this.client, args.vmId);
2699
- return {
2700
- content: [
2701
- {
2702
- type: 'text',
2703
- text: JSON.stringify(vm, null, 2),
2704
- },
2705
- ],
2706
- };
2707
- }
2708
- case 'liara_create_vm': {
2709
- const vm = await iaasService.createVM(this.client, args);
2710
- return {
2711
- content: [
2712
- {
2713
- type: 'text',
2714
- text: `VM "${vm.name}" created successfully.\n${JSON.stringify(vm, null, 2)}`,
2715
- },
2716
- ],
2717
- };
2718
- }
2719
- case 'liara_start_vm': {
2720
- await iaasService.startVM(this.client, args.vmId);
2721
- return {
2722
- content: [
2723
- {
2724
- type: 'text',
2725
- text: `VM "${args.vmId}" started successfully.`,
2726
- },
2727
- ],
2728
- };
2729
- }
2730
- case 'liara_stop_vm': {
2731
- await iaasService.stopVM(this.client, args.vmId);
2732
- return {
2733
- content: [
2734
- {
2735
- type: 'text',
2736
- text: `VM "${args.vmId}" stopped successfully.`,
2737
- },
2738
- ],
2739
- };
2740
- }
2741
- case 'liara_restart_vm': {
2742
- await iaasService.restartVM(this.client, args.vmId);
2743
- return {
2744
- content: [
2745
- {
2746
- type: 'text',
2747
- text: `VM "${args.vmId}" restarted successfully.`,
2748
- },
2749
- ],
2750
- };
2751
- }
2752
- case 'liara_delete_vm': {
2753
- await iaasService.deleteVM(this.client, args.vmId);
2754
- return {
2755
- content: [
2756
- {
2757
- type: 'text',
2758
- text: `VM "${args.vmId}" deleted successfully.`,
2759
- },
2760
- ],
2761
- };
2762
- }
2763
- case 'liara_resize_vm': {
2764
- const vm = await iaasService.resizeVM(this.client, args.vmId, args.planID);
2765
- return {
2766
- content: [
2767
- {
2768
- type: 'text',
2769
- text: `VM "${args.vmId}" resized to plan "${args.planID}" successfully.\n${JSON.stringify(vm, null, 2)}`,
2770
- },
2771
- ],
2772
- };
2773
- }
2774
- case 'liara_create_snapshot': {
2775
- const snapshot = await iaasService.createSnapshot(this.client, args.vmId, args?.name);
2776
- return {
2777
- content: [
2778
- {
2779
- type: 'text',
2780
- text: `Snapshot created successfully.\n${JSON.stringify(snapshot, null, 2)}`,
2781
- },
2782
- ],
2783
- };
2784
- }
2785
- case 'liara_list_snapshots': {
2786
- const snapshots = await iaasService.listSnapshots(this.client, args.vmId, this.extractPagination(args));
2787
- return {
2788
- content: [
2789
- {
2790
- type: 'text',
2791
- text: JSON.stringify(snapshots, null, 2),
2792
- },
2793
- ],
2794
- };
2795
- }
2796
- case 'liara_restore_snapshot': {
2797
- const result = await iaasService.restoreSnapshot(this.client, args.vmId, args.snapshotId);
2798
- return {
2799
- content: [
2800
- {
2801
- type: 'text',
2802
- text: result.message || `VM "${args.vmId}" restored from snapshot "${args.snapshotId}" successfully.`,
2803
- },
2804
- ],
2805
- };
2806
- }
2807
- case 'liara_delete_snapshot': {
2808
- await iaasService.deleteSnapshot(this.client, args.vmId, args.snapshotId);
2809
- return {
2810
- content: [
2811
- {
2812
- type: 'text',
2813
- text: `Snapshot "${args.snapshotId}" deleted successfully.`,
2814
- },
2815
- ],
2816
- };
2817
- }
2818
- case 'liara_attach_network': {
2819
- const result = await iaasService.attachNetwork(this.client, args.vmId, args.networkId);
2820
- return {
2821
- content: [
2822
- {
2823
- type: 'text',
2824
- text: result.message || `Network "${args.networkId}" attached to VM "${args.vmId}" successfully.`,
2825
- },
2826
- ],
2827
- };
2828
- }
2829
- case 'liara_detach_network': {
2830
- await iaasService.detachNetwork(this.client, args.vmId, args.networkId);
2831
- return {
2832
- content: [
2833
- {
2834
- type: 'text',
2835
- text: `Network "${args.networkId}" detached from VM "${args.vmId}" successfully.`,
2836
- },
2837
- ],
2838
- };
2839
- }
2840
- // Disks
2841
- case 'liara_list_disks': {
2842
- const disks = await diskService.listDisks(this.client, args.appName, this.extractPagination(args));
2843
- return {
2844
- content: [
2845
- {
2846
- type: 'text',
2847
- text: JSON.stringify(disks, null, 2),
2848
- },
2849
- ],
2850
- };
2851
- }
2852
- case 'liara_create_disk': {
2853
- const disk = await diskService.createDisk(this.client, args.appName, {
2854
- name: args.name,
2855
- size: args.size,
2856
- mountPath: args.mountPath,
2857
- });
2858
- return {
2859
- content: [
2860
- {
2861
- type: 'text',
2862
- text: `Disk "${disk.name}" created successfully.\n${JSON.stringify(disk, null, 2)}`,
2863
- },
2864
- ],
2865
- };
2866
- }
2867
- case 'liara_get_disk': {
2868
- const disk = await diskService.getDisk(this.client, args.appName, args.diskName);
2869
- return {
2870
- content: [
2871
- {
2872
- type: 'text',
2873
- text: JSON.stringify(disk, null, 2),
2874
- },
2875
- ],
2876
- };
2877
- }
2878
- case 'liara_delete_disk': {
2879
- await diskService.deleteDisk(this.client, args.appName, args.diskName);
2880
- return {
2881
- content: [
2882
- {
2883
- type: 'text',
2884
- text: `Disk "${args.diskName}" deleted successfully.`,
2885
- },
2886
- ],
2887
- };
2888
- }
2889
- case 'liara_resize_disk': {
2890
- const disk = await diskService.resizeDisk(this.client, args.appName, args.diskName, args.size);
2891
- return {
2892
- content: [
2893
- {
2894
- type: 'text',
2895
- text: `Disk "${args.diskName}" resized to ${args.size}GB successfully.\n${JSON.stringify(disk, null, 2)}`,
2896
- },
2897
- ],
2898
- };
2899
- }
2900
- case 'liara_create_ftp_access': {
2901
- const ftp = await diskService.createFtpAccess(this.client, args.appName, args.diskName);
2902
- return {
2903
- content: [
2904
- {
2905
- type: 'text',
2906
- text: `FTP access created successfully.\n${JSON.stringify(ftp, null, 2)}`,
2907
- },
2908
- ],
2909
- };
2910
- }
2911
- case 'liara_list_ftp_accesses': {
2912
- const ftpAccesses = await diskService.listFtpAccesses(this.client, args.appName, args.diskName, this.extractPagination(args));
2913
- return {
2914
- content: [
2915
- {
2916
- type: 'text',
2917
- text: JSON.stringify(ftpAccesses, null, 2),
2918
- },
2919
- ],
2920
- };
2921
- }
2922
- case 'liara_delete_ftp_access': {
2923
- await diskService.deleteFtpAccess(this.client, args.appName, args.diskName, args.ftpId);
2924
- return {
2925
- content: [
2926
- {
2927
- type: 'text',
2928
- text: `FTP access "${args.ftpId}" deleted successfully.`,
2929
- },
2930
- ],
2931
- };
2932
- }
2933
- // Networks
2934
- case 'liara_list_networks': {
2935
- const networks = await networkService.listNetworks(this.client, this.extractPagination(args));
2936
- return {
2937
- content: [
2938
- {
2939
- type: 'text',
2940
- text: JSON.stringify(networks, null, 2),
2941
- },
2942
- ],
2943
- };
2944
- }
2945
- case 'liara_get_network': {
2946
- const network = await networkService.getNetwork(this.client, args.networkId);
2947
- return {
2948
- content: [
2949
- {
2950
- type: 'text',
2951
- text: JSON.stringify(network, null, 2),
2952
- },
2953
- ],
2954
- };
2955
- }
2956
- case 'liara_create_network': {
2957
- const network = await networkService.createNetwork(this.client, args.name, args?.cidr);
2958
- return {
2959
- content: [
2960
- {
2961
- type: 'text',
2962
- text: `Network "${network.name}" created successfully.\n${JSON.stringify(network, null, 2)}`,
2963
- },
2964
- ],
2965
- };
2966
- }
2967
- case 'liara_delete_network': {
2968
- await networkService.deleteNetwork(this.client, args.networkId);
2969
- return {
2970
- content: [
2971
- {
2972
- type: 'text',
2973
- text: `Network "${args.networkId}" deleted successfully.`,
2974
- },
2975
- ],
2976
- };
2977
- }
2978
- // User
2979
- case 'liara_get_user': {
2980
- const userInfo = await userService.getUserInfo(this.client);
2981
- return {
2982
- content: [
2983
- {
2984
- type: 'text',
2985
- text: JSON.stringify(userInfo, null, 2),
2986
- },
2987
- ],
2988
- };
2989
- }
2990
- // Observability
2991
- case 'liara_get_metrics': {
2992
- const metrics = await observabilityService.getAppMetrics(this.client, args.appName, args?.period);
2993
- return {
2994
- content: [
2995
- {
2996
- type: 'text',
2997
- text: JSON.stringify(metrics, null, 2),
2998
- },
2999
- ],
3000
- };
3001
- }
3002
- case 'liara_get_logs': {
3003
- const logs = await observabilityService.getAppLogs(this.client, args.appName, {
3004
- limit: args?.limit,
3005
- since: args?.since,
3006
- until: args?.until,
3007
- });
3008
- return {
3009
- content: [
3010
- {
3011
- type: 'text',
3012
- text: JSON.stringify(logs, null, 2),
3013
- },
3014
- ],
3015
- };
3016
- }
3017
- default:
3018
- throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${name}`);
3019
- }
3020
- }
3021
- catch (error) {
3022
- // Extract base message (without suggestions) and suggestions separately
3023
- // to avoid duplication in the response
3024
- const errorMessage = formatErrorForMcp(error);
3025
- const suggestions = (error instanceof LiaraMcpError && error.suggestions)
3026
- ? error.suggestions
3027
- : undefined;
3028
- const errorCode = (error instanceof LiaraMcpError && error.code)
3029
- ? error.code
3030
- : 'UNKNOWN_ERROR';
3031
- return {
3032
- content: [
3033
- {
3034
- type: 'text',
3035
- text: JSON.stringify({
3036
- success: false,
3037
- error: {
3038
- code: errorCode,
3039
- message: errorMessage,
3040
- ...(suggestions && { suggestions })
3041
- }
3042
- }, null, 2),
3043
- },
3044
- ],
3045
- isError: true,
3046
- };
3047
- }
53
+ const { name, arguments: args } = request.params;
54
+ return handleToolCall(this.client, name, args);
3048
55
  });
3049
56
  }
3050
57
  async run() {