@vucinatim/agentic-devtools 0.1.2 → 0.1.4
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 +52 -2
- package/docs/auth-and-setup-guidelines.md +41 -2
- package/docs/publishing.md +12 -0
- package/docs/testing.md +4 -0
- package/docs/usage.md +70 -1
- package/package.json +1 -1
- package/src/cli.mjs +1 -1
- package/src/tools/railway/auth.mjs +1 -1
- package/src/tools/railway/client.mjs +751 -0
- package/src/tools/railway/mcp.mjs +535 -9
|
@@ -24,7 +24,8 @@ Optional environment variables:
|
|
|
24
24
|
RAILWAY_PROJECT_ID
|
|
25
25
|
RAILWAY_API_ENDPOINT
|
|
26
26
|
|
|
27
|
-
Project tokens can
|
|
27
|
+
Project tokens can manage resources scoped to the attached project environment.
|
|
28
|
+
Account and workspace tokens can inspect and manage broader Railway resources.
|
|
28
29
|
|
|
29
30
|
If env vars are not provided, use the connectRailway tool to open the browser-based setup flow and save a local Railway token.
|
|
30
31
|
`;
|
|
@@ -47,7 +48,7 @@ const createServer = () => {
|
|
|
47
48
|
},
|
|
48
49
|
{
|
|
49
50
|
instructions:
|
|
50
|
-
"Use these tools
|
|
51
|
+
"Use these tools to inspect and manage Railway projects, environments, services, domains, variables, deployments, and volumes through the documented public API. Prefer read tools first, then use targeted write tools. Delete tools are destructive and should be used deliberately.",
|
|
51
52
|
},
|
|
52
53
|
);
|
|
53
54
|
|
|
@@ -91,16 +92,12 @@ const createServer = () => {
|
|
|
91
92
|
};
|
|
92
93
|
}
|
|
93
94
|
|
|
94
|
-
const
|
|
95
|
+
const validation = await client.validateAccountToken();
|
|
95
96
|
return {
|
|
96
97
|
ok: true,
|
|
97
98
|
tokenSource: client.auth.source,
|
|
98
99
|
tokenKind: client.auth.kind,
|
|
99
|
-
|
|
100
|
-
name: viewer.name,
|
|
101
|
-
email: viewer.email,
|
|
102
|
-
workspaceCount: viewer.workspaces.length,
|
|
103
|
-
},
|
|
100
|
+
validation,
|
|
104
101
|
};
|
|
105
102
|
}),
|
|
106
103
|
),
|
|
@@ -160,6 +157,21 @@ const createServer = () => {
|
|
|
160
157
|
),
|
|
161
158
|
);
|
|
162
159
|
|
|
160
|
+
server.registerTool(
|
|
161
|
+
"listRailwayProjectMembers",
|
|
162
|
+
{
|
|
163
|
+
description:
|
|
164
|
+
"List members of a Railway project. Requires an account or workspace token.",
|
|
165
|
+
inputSchema: {
|
|
166
|
+
projectId: z.string().min(1).optional(),
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
async ({ projectId } = {}) =>
|
|
170
|
+
createToolResult(
|
|
171
|
+
await withClient((client) => client.getProjectMembers(projectId)),
|
|
172
|
+
),
|
|
173
|
+
);
|
|
174
|
+
|
|
163
175
|
server.registerTool(
|
|
164
176
|
"inspectRailwayProjectToken",
|
|
165
177
|
{
|
|
@@ -187,6 +199,74 @@ const createServer = () => {
|
|
|
187
199
|
),
|
|
188
200
|
);
|
|
189
201
|
|
|
202
|
+
server.registerTool(
|
|
203
|
+
"createRailwayProject",
|
|
204
|
+
{
|
|
205
|
+
description:
|
|
206
|
+
"Create a Railway project. Requires an account or workspace token.",
|
|
207
|
+
inputSchema: {
|
|
208
|
+
name: z.string().min(1).optional(),
|
|
209
|
+
description: z.string().optional(),
|
|
210
|
+
workspaceId: z.string().min(1).optional(),
|
|
211
|
+
defaultEnvironmentName: z.string().min(1).optional(),
|
|
212
|
+
isMonorepo: z.boolean().optional(),
|
|
213
|
+
isPublic: z.boolean().optional(),
|
|
214
|
+
prDeploys: z.boolean().optional(),
|
|
215
|
+
runtime: z.string().min(1).optional(),
|
|
216
|
+
repo: z.unknown().optional(),
|
|
217
|
+
},
|
|
218
|
+
},
|
|
219
|
+
async (args = {}) =>
|
|
220
|
+
createToolResult(await withClient((client) => client.createProject(args))),
|
|
221
|
+
);
|
|
222
|
+
|
|
223
|
+
server.registerTool(
|
|
224
|
+
"updateRailwayProject",
|
|
225
|
+
{
|
|
226
|
+
description:
|
|
227
|
+
"Update Railway project settings such as name, description, or PR environment behavior.",
|
|
228
|
+
inputSchema: {
|
|
229
|
+
projectId: z.string().min(1).optional(),
|
|
230
|
+
name: z.string().min(1).optional(),
|
|
231
|
+
description: z.string().optional(),
|
|
232
|
+
baseEnvironmentId: z.string().min(1).optional(),
|
|
233
|
+
botPrEnvironments: z.boolean().optional(),
|
|
234
|
+
focusedPrEnvironments: z.boolean().optional(),
|
|
235
|
+
isPublic: z.boolean().optional(),
|
|
236
|
+
prDeploys: z.boolean().optional(),
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
|
+
async (args = {}) =>
|
|
240
|
+
createToolResult(await withClient((client) => client.updateProject(args))),
|
|
241
|
+
);
|
|
242
|
+
|
|
243
|
+
server.registerTool(
|
|
244
|
+
"deleteRailwayProject",
|
|
245
|
+
{
|
|
246
|
+
description:
|
|
247
|
+
"Delete a Railway project. Destructive. Requires an account or workspace token.",
|
|
248
|
+
inputSchema: {
|
|
249
|
+
projectId: z.string().min(1).optional(),
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
async ({ projectId } = {}) =>
|
|
253
|
+
createToolResult(await withClient((client) => client.deleteProject(projectId))),
|
|
254
|
+
);
|
|
255
|
+
|
|
256
|
+
server.registerTool(
|
|
257
|
+
"transferRailwayProject",
|
|
258
|
+
{
|
|
259
|
+
description:
|
|
260
|
+
"Transfer a Railway project to another workspace. Requires an account or workspace token.",
|
|
261
|
+
inputSchema: {
|
|
262
|
+
projectId: z.string().min(1).optional(),
|
|
263
|
+
workspaceId: z.string().min(1),
|
|
264
|
+
},
|
|
265
|
+
},
|
|
266
|
+
async (args) =>
|
|
267
|
+
createToolResult(await withClient((client) => client.transferProject(args))),
|
|
268
|
+
);
|
|
269
|
+
|
|
190
270
|
server.registerTool(
|
|
191
271
|
"listRailwayEnvironments",
|
|
192
272
|
{
|
|
@@ -218,6 +298,452 @@ const createServer = () => {
|
|
|
218
298
|
),
|
|
219
299
|
);
|
|
220
300
|
|
|
301
|
+
server.registerTool(
|
|
302
|
+
"createRailwayEnvironment",
|
|
303
|
+
{
|
|
304
|
+
description:
|
|
305
|
+
"Create a Railway environment inside a project.",
|
|
306
|
+
inputSchema: {
|
|
307
|
+
projectId: z.string().min(1),
|
|
308
|
+
name: z.string().min(1),
|
|
309
|
+
ephemeral: z.boolean().optional(),
|
|
310
|
+
sourceEnvironmentId: z.string().min(1).optional(),
|
|
311
|
+
skipInitialDeploys: z.boolean().optional(),
|
|
312
|
+
stageInitialChanges: z.boolean().optional(),
|
|
313
|
+
applyChangesInBackground: z.boolean().optional(),
|
|
314
|
+
},
|
|
315
|
+
},
|
|
316
|
+
async (args) =>
|
|
317
|
+
createToolResult(await withClient((client) => client.createEnvironment(args))),
|
|
318
|
+
);
|
|
319
|
+
|
|
320
|
+
server.registerTool(
|
|
321
|
+
"deleteRailwayEnvironment",
|
|
322
|
+
{
|
|
323
|
+
description:
|
|
324
|
+
"Delete a Railway environment. Destructive.",
|
|
325
|
+
inputSchema: {
|
|
326
|
+
environmentId: z.string().min(1),
|
|
327
|
+
},
|
|
328
|
+
},
|
|
329
|
+
async ({ environmentId }) =>
|
|
330
|
+
createToolResult(
|
|
331
|
+
await withClient((client) => client.deleteEnvironment(environmentId)),
|
|
332
|
+
),
|
|
333
|
+
);
|
|
334
|
+
|
|
335
|
+
server.registerTool(
|
|
336
|
+
"getRailwayService",
|
|
337
|
+
{
|
|
338
|
+
description: "Inspect one Railway service.",
|
|
339
|
+
inputSchema: {
|
|
340
|
+
serviceId: z.string().min(1),
|
|
341
|
+
},
|
|
342
|
+
},
|
|
343
|
+
async ({ serviceId }) =>
|
|
344
|
+
createToolResult(await withClient((client) => client.getService(serviceId))),
|
|
345
|
+
);
|
|
346
|
+
|
|
347
|
+
server.registerTool(
|
|
348
|
+
"getRailwayServiceInstance",
|
|
349
|
+
{
|
|
350
|
+
description:
|
|
351
|
+
"Inspect one Railway service instance in a specific environment.",
|
|
352
|
+
inputSchema: {
|
|
353
|
+
serviceId: z.string().min(1),
|
|
354
|
+
environmentId: z.string().min(1),
|
|
355
|
+
},
|
|
356
|
+
},
|
|
357
|
+
async (args) =>
|
|
358
|
+
createToolResult(
|
|
359
|
+
await withClient((client) => client.getServiceInstance(args)),
|
|
360
|
+
),
|
|
361
|
+
);
|
|
362
|
+
|
|
363
|
+
server.registerTool(
|
|
364
|
+
"getRailwayServiceInstanceLimits",
|
|
365
|
+
{
|
|
366
|
+
description:
|
|
367
|
+
"Get resource limits for a Railway service instance.",
|
|
368
|
+
inputSchema: {
|
|
369
|
+
serviceId: z.string().min(1),
|
|
370
|
+
environmentId: z.string().min(1),
|
|
371
|
+
},
|
|
372
|
+
},
|
|
373
|
+
async (args) =>
|
|
374
|
+
createToolResult(
|
|
375
|
+
await withClient((client) => client.getServiceInstanceLimits(args)),
|
|
376
|
+
),
|
|
377
|
+
);
|
|
378
|
+
|
|
379
|
+
server.registerTool(
|
|
380
|
+
"createRailwayService",
|
|
381
|
+
{
|
|
382
|
+
description:
|
|
383
|
+
"Create a Railway service from a repo, image, template, or as an empty service.",
|
|
384
|
+
inputSchema: {
|
|
385
|
+
projectId: z.string().min(1),
|
|
386
|
+
environmentId: z.string().min(1).optional(),
|
|
387
|
+
name: z.string().min(1).optional(),
|
|
388
|
+
icon: z.string().min(1).optional(),
|
|
389
|
+
branch: z.string().min(1).optional(),
|
|
390
|
+
templateId: z.string().min(1).optional(),
|
|
391
|
+
templateServiceId: z.string().min(1).optional(),
|
|
392
|
+
source: z.unknown().optional(),
|
|
393
|
+
registryCredentials: z.unknown().optional(),
|
|
394
|
+
variables: z.unknown().optional(),
|
|
395
|
+
},
|
|
396
|
+
},
|
|
397
|
+
async (args) =>
|
|
398
|
+
createToolResult(await withClient((client) => client.createService(args))),
|
|
399
|
+
);
|
|
400
|
+
|
|
401
|
+
server.registerTool(
|
|
402
|
+
"updateRailwayService",
|
|
403
|
+
{
|
|
404
|
+
description:
|
|
405
|
+
"Update a Railway service name or icon.",
|
|
406
|
+
inputSchema: {
|
|
407
|
+
serviceId: z.string().min(1),
|
|
408
|
+
name: z.string().min(1).optional(),
|
|
409
|
+
icon: z.string().min(1).optional(),
|
|
410
|
+
},
|
|
411
|
+
},
|
|
412
|
+
async (args) =>
|
|
413
|
+
createToolResult(await withClient((client) => client.updateService(args))),
|
|
414
|
+
);
|
|
415
|
+
|
|
416
|
+
server.registerTool(
|
|
417
|
+
"connectRailwayService",
|
|
418
|
+
{
|
|
419
|
+
description:
|
|
420
|
+
"Connect an existing Railway service to a repo or image source.",
|
|
421
|
+
inputSchema: {
|
|
422
|
+
serviceId: z.string().min(1),
|
|
423
|
+
repo: z.string().min(1).optional(),
|
|
424
|
+
image: z.string().min(1).optional(),
|
|
425
|
+
branch: z.string().min(1).optional(),
|
|
426
|
+
},
|
|
427
|
+
},
|
|
428
|
+
async (args) =>
|
|
429
|
+
createToolResult(await withClient((client) => client.connectService(args))),
|
|
430
|
+
);
|
|
431
|
+
|
|
432
|
+
server.registerTool(
|
|
433
|
+
"disconnectRailwayService",
|
|
434
|
+
{
|
|
435
|
+
description:
|
|
436
|
+
"Disconnect a Railway service from its current source.",
|
|
437
|
+
inputSchema: {
|
|
438
|
+
serviceId: z.string().min(1),
|
|
439
|
+
},
|
|
440
|
+
},
|
|
441
|
+
async ({ serviceId }) =>
|
|
442
|
+
createToolResult(
|
|
443
|
+
await withClient((client) => client.disconnectService(serviceId)),
|
|
444
|
+
),
|
|
445
|
+
);
|
|
446
|
+
|
|
447
|
+
server.registerTool(
|
|
448
|
+
"deleteRailwayService",
|
|
449
|
+
{
|
|
450
|
+
description:
|
|
451
|
+
"Delete a Railway service. Destructive.",
|
|
452
|
+
inputSchema: {
|
|
453
|
+
serviceId: z.string().min(1),
|
|
454
|
+
environmentId: z.string().min(1).optional(),
|
|
455
|
+
},
|
|
456
|
+
},
|
|
457
|
+
async (args) =>
|
|
458
|
+
createToolResult(await withClient((client) => client.deleteService(args))),
|
|
459
|
+
);
|
|
460
|
+
|
|
461
|
+
server.registerTool(
|
|
462
|
+
"updateRailwayServiceInstance",
|
|
463
|
+
{
|
|
464
|
+
description:
|
|
465
|
+
"Update build, deploy, region, healthcheck, cron, or source settings for a Railway service instance.",
|
|
466
|
+
inputSchema: {
|
|
467
|
+
serviceId: z.string().min(1),
|
|
468
|
+
environmentId: z.string().min(1).optional(),
|
|
469
|
+
buildCommand: z.string().optional(),
|
|
470
|
+
builder: z.string().min(1).optional(),
|
|
471
|
+
cronSchedule: z.string().optional(),
|
|
472
|
+
dockerfilePath: z.string().optional(),
|
|
473
|
+
drainingSeconds: z.number().int().min(0).optional(),
|
|
474
|
+
healthcheckPath: z.string().optional(),
|
|
475
|
+
healthcheckTimeout: z.number().int().min(0).optional(),
|
|
476
|
+
ipv6EgressEnabled: z.boolean().optional(),
|
|
477
|
+
multiRegionConfig: z.unknown().optional(),
|
|
478
|
+
nixpacksPlan: z.unknown().optional(),
|
|
479
|
+
numReplicas: z.number().int().min(0).optional(),
|
|
480
|
+
overlapSeconds: z.number().int().min(0).optional(),
|
|
481
|
+
preDeployCommand: z.array(z.string()).optional(),
|
|
482
|
+
railwayConfigFile: z.string().optional(),
|
|
483
|
+
region: z.string().optional(),
|
|
484
|
+
registryCredentials: z.unknown().optional(),
|
|
485
|
+
restartPolicyMaxRetries: z.number().int().min(0).optional(),
|
|
486
|
+
restartPolicyType: z.string().min(1).optional(),
|
|
487
|
+
rootDirectory: z.string().optional(),
|
|
488
|
+
sleepApplication: z.boolean().optional(),
|
|
489
|
+
source: z.unknown().optional(),
|
|
490
|
+
startCommand: z.string().optional(),
|
|
491
|
+
watchPatterns: z.array(z.string()).optional(),
|
|
492
|
+
},
|
|
493
|
+
},
|
|
494
|
+
async (args) =>
|
|
495
|
+
createToolResult(
|
|
496
|
+
await withClient((client) => client.updateServiceInstance(args)),
|
|
497
|
+
),
|
|
498
|
+
);
|
|
499
|
+
|
|
500
|
+
server.registerTool(
|
|
501
|
+
"deployRailwayService",
|
|
502
|
+
{
|
|
503
|
+
description:
|
|
504
|
+
"Trigger a Railway deployment for a service instance.",
|
|
505
|
+
inputSchema: {
|
|
506
|
+
serviceId: z.string().min(1),
|
|
507
|
+
environmentId: z.string().min(1),
|
|
508
|
+
commitSha: z.string().min(1).optional(),
|
|
509
|
+
latestCommit: z.boolean().optional(),
|
|
510
|
+
},
|
|
511
|
+
},
|
|
512
|
+
async (args) =>
|
|
513
|
+
createToolResult(await withClient((client) => client.deployService(args))),
|
|
514
|
+
);
|
|
515
|
+
|
|
516
|
+
server.registerTool(
|
|
517
|
+
"redeployRailwayService",
|
|
518
|
+
{
|
|
519
|
+
description:
|
|
520
|
+
"Redeploy the latest Railway deployment for a service instance.",
|
|
521
|
+
inputSchema: {
|
|
522
|
+
serviceId: z.string().min(1),
|
|
523
|
+
environmentId: z.string().min(1),
|
|
524
|
+
},
|
|
525
|
+
},
|
|
526
|
+
async (args) =>
|
|
527
|
+
createToolResult(await withClient((client) => client.redeployService(args))),
|
|
528
|
+
);
|
|
529
|
+
|
|
530
|
+
server.registerTool(
|
|
531
|
+
"updateRailwayServiceInstanceLimits",
|
|
532
|
+
{
|
|
533
|
+
description:
|
|
534
|
+
"Update vCPU or memory limits for a Railway service instance.",
|
|
535
|
+
inputSchema: {
|
|
536
|
+
serviceId: z.string().min(1),
|
|
537
|
+
environmentId: z.string().min(1),
|
|
538
|
+
memoryGB: z.number().positive().optional(),
|
|
539
|
+
vCPUs: z.number().positive().optional(),
|
|
540
|
+
},
|
|
541
|
+
},
|
|
542
|
+
async (args) =>
|
|
543
|
+
createToolResult(
|
|
544
|
+
await withClient((client) => client.updateServiceInstanceLimits(args)),
|
|
545
|
+
),
|
|
546
|
+
);
|
|
547
|
+
|
|
548
|
+
server.registerTool(
|
|
549
|
+
"getRailwayDeployment",
|
|
550
|
+
{
|
|
551
|
+
description: "Inspect one Railway deployment.",
|
|
552
|
+
inputSchema: {
|
|
553
|
+
deploymentId: z.string().min(1),
|
|
554
|
+
},
|
|
555
|
+
},
|
|
556
|
+
async ({ deploymentId }) =>
|
|
557
|
+
createToolResult(
|
|
558
|
+
await withClient((client) => client.getDeployment(deploymentId)),
|
|
559
|
+
),
|
|
560
|
+
);
|
|
561
|
+
|
|
562
|
+
server.registerTool(
|
|
563
|
+
"listRailwayDeployments",
|
|
564
|
+
{
|
|
565
|
+
description:
|
|
566
|
+
"List Railway deployments for a project, environment, or service.",
|
|
567
|
+
inputSchema: {
|
|
568
|
+
projectId: z.string().min(1).optional(),
|
|
569
|
+
environmentId: z.string().min(1).optional(),
|
|
570
|
+
serviceId: z.string().min(1).optional(),
|
|
571
|
+
first: z.number().int().min(1).max(100).optional(),
|
|
572
|
+
after: z.string().min(1).optional(),
|
|
573
|
+
before: z.string().min(1).optional(),
|
|
574
|
+
last: z.number().int().min(1).max(100).optional(),
|
|
575
|
+
},
|
|
576
|
+
},
|
|
577
|
+
async (args = {}) =>
|
|
578
|
+
createToolResult(await withClient((client) => client.listDeployments(args))),
|
|
579
|
+
);
|
|
580
|
+
|
|
581
|
+
server.registerTool(
|
|
582
|
+
"upsertRailwayVariable",
|
|
583
|
+
{
|
|
584
|
+
description:
|
|
585
|
+
"Create or update a Railway variable.",
|
|
586
|
+
inputSchema: {
|
|
587
|
+
projectId: z.string().min(1),
|
|
588
|
+
environmentId: z.string().min(1),
|
|
589
|
+
name: z.string().min(1),
|
|
590
|
+
value: z.string(),
|
|
591
|
+
serviceId: z.string().min(1).optional(),
|
|
592
|
+
skipDeploys: z.boolean().optional(),
|
|
593
|
+
},
|
|
594
|
+
},
|
|
595
|
+
async (args) =>
|
|
596
|
+
createToolResult(await withClient((client) => client.upsertVariable(args))),
|
|
597
|
+
);
|
|
598
|
+
|
|
599
|
+
server.registerTool(
|
|
600
|
+
"deleteRailwayVariable",
|
|
601
|
+
{
|
|
602
|
+
description:
|
|
603
|
+
"Delete a Railway variable.",
|
|
604
|
+
inputSchema: {
|
|
605
|
+
projectId: z.string().min(1),
|
|
606
|
+
environmentId: z.string().min(1),
|
|
607
|
+
name: z.string().min(1),
|
|
608
|
+
serviceId: z.string().min(1).optional(),
|
|
609
|
+
},
|
|
610
|
+
},
|
|
611
|
+
async (args) =>
|
|
612
|
+
createToolResult(await withClient((client) => client.deleteVariable(args))),
|
|
613
|
+
);
|
|
614
|
+
|
|
615
|
+
server.registerTool(
|
|
616
|
+
"createRailwayServiceDomain",
|
|
617
|
+
{
|
|
618
|
+
description:
|
|
619
|
+
"Create a Railway-managed service domain.",
|
|
620
|
+
inputSchema: {
|
|
621
|
+
serviceId: z.string().min(1),
|
|
622
|
+
environmentId: z.string().min(1),
|
|
623
|
+
targetPort: z.number().int().min(1).optional(),
|
|
624
|
+
},
|
|
625
|
+
},
|
|
626
|
+
async (args) =>
|
|
627
|
+
createToolResult(
|
|
628
|
+
await withClient((client) => client.createServiceDomain(args)),
|
|
629
|
+
),
|
|
630
|
+
);
|
|
631
|
+
|
|
632
|
+
server.registerTool(
|
|
633
|
+
"updateRailwayServiceDomain",
|
|
634
|
+
{
|
|
635
|
+
description:
|
|
636
|
+
"Update a Railway-managed service domain target port or domain binding.",
|
|
637
|
+
inputSchema: {
|
|
638
|
+
serviceDomainId: z.string().min(1),
|
|
639
|
+
serviceId: z.string().min(1),
|
|
640
|
+
environmentId: z.string().min(1),
|
|
641
|
+
domain: z.string().min(1),
|
|
642
|
+
targetPort: z.number().int().min(1).optional(),
|
|
643
|
+
},
|
|
644
|
+
},
|
|
645
|
+
async (args) =>
|
|
646
|
+
createToolResult(
|
|
647
|
+
await withClient((client) => client.updateServiceDomain(args)),
|
|
648
|
+
),
|
|
649
|
+
);
|
|
650
|
+
|
|
651
|
+
server.registerTool(
|
|
652
|
+
"deleteRailwayServiceDomain",
|
|
653
|
+
{
|
|
654
|
+
description:
|
|
655
|
+
"Delete a Railway-managed service domain.",
|
|
656
|
+
inputSchema: {
|
|
657
|
+
serviceDomainId: z.string().min(1),
|
|
658
|
+
},
|
|
659
|
+
},
|
|
660
|
+
async ({ serviceDomainId }) =>
|
|
661
|
+
createToolResult(
|
|
662
|
+
await withClient((client) => client.deleteServiceDomain(serviceDomainId)),
|
|
663
|
+
),
|
|
664
|
+
);
|
|
665
|
+
|
|
666
|
+
server.registerTool(
|
|
667
|
+
"createRailwayCustomDomain",
|
|
668
|
+
{
|
|
669
|
+
description:
|
|
670
|
+
"Add a custom domain to a Railway service.",
|
|
671
|
+
inputSchema: {
|
|
672
|
+
projectId: z.string().min(1),
|
|
673
|
+
environmentId: z.string().min(1),
|
|
674
|
+
serviceId: z.string().min(1),
|
|
675
|
+
domain: z.string().min(1),
|
|
676
|
+
targetPort: z.number().int().min(1).optional(),
|
|
677
|
+
},
|
|
678
|
+
},
|
|
679
|
+
async (args) =>
|
|
680
|
+
createToolResult(
|
|
681
|
+
await withClient((client) => client.createCustomDomain(args)),
|
|
682
|
+
),
|
|
683
|
+
);
|
|
684
|
+
|
|
685
|
+
server.registerTool(
|
|
686
|
+
"updateRailwayCustomDomain",
|
|
687
|
+
{
|
|
688
|
+
description:
|
|
689
|
+
"Update a custom Railway domain target port.",
|
|
690
|
+
inputSchema: {
|
|
691
|
+
customDomainId: z.string().min(1),
|
|
692
|
+
environmentId: z.string().min(1),
|
|
693
|
+
targetPort: z.number().int().min(1).optional(),
|
|
694
|
+
},
|
|
695
|
+
},
|
|
696
|
+
async (args) =>
|
|
697
|
+
createToolResult(
|
|
698
|
+
await withClient((client) => client.updateCustomDomain(args)),
|
|
699
|
+
),
|
|
700
|
+
);
|
|
701
|
+
|
|
702
|
+
server.registerTool(
|
|
703
|
+
"deleteRailwayCustomDomain",
|
|
704
|
+
{
|
|
705
|
+
description:
|
|
706
|
+
"Delete a custom Railway domain.",
|
|
707
|
+
inputSchema: {
|
|
708
|
+
customDomainId: z.string().min(1),
|
|
709
|
+
},
|
|
710
|
+
},
|
|
711
|
+
async ({ customDomainId }) =>
|
|
712
|
+
createToolResult(
|
|
713
|
+
await withClient((client) => client.deleteCustomDomain(customDomainId)),
|
|
714
|
+
),
|
|
715
|
+
);
|
|
716
|
+
|
|
717
|
+
server.registerTool(
|
|
718
|
+
"createRailwayVolume",
|
|
719
|
+
{
|
|
720
|
+
description:
|
|
721
|
+
"Create a Railway volume.",
|
|
722
|
+
inputSchema: {
|
|
723
|
+
projectId: z.string().min(1),
|
|
724
|
+
mountPath: z.string().min(1),
|
|
725
|
+
environmentId: z.string().min(1).optional(),
|
|
726
|
+
serviceId: z.string().min(1).optional(),
|
|
727
|
+
region: z.string().min(1).optional(),
|
|
728
|
+
},
|
|
729
|
+
},
|
|
730
|
+
async (args) =>
|
|
731
|
+
createToolResult(await withClient((client) => client.createVolume(args))),
|
|
732
|
+
);
|
|
733
|
+
|
|
734
|
+
server.registerTool(
|
|
735
|
+
"deleteRailwayVolume",
|
|
736
|
+
{
|
|
737
|
+
description:
|
|
738
|
+
"Delete a Railway volume. Destructive.",
|
|
739
|
+
inputSchema: {
|
|
740
|
+
volumeId: z.string().min(1),
|
|
741
|
+
},
|
|
742
|
+
},
|
|
743
|
+
async ({ volumeId }) =>
|
|
744
|
+
createToolResult(await withClient((client) => client.deleteVolume(volumeId))),
|
|
745
|
+
);
|
|
746
|
+
|
|
221
747
|
server.registerTool(
|
|
222
748
|
"doctorRailwayProject",
|
|
223
749
|
{
|
|
@@ -260,7 +786,7 @@ if (argv.includes("--test-connection")) {
|
|
|
260
786
|
const result =
|
|
261
787
|
client.auth.kind === "project"
|
|
262
788
|
? await client.getProjectTokenContext()
|
|
263
|
-
: await client.
|
|
789
|
+
: await client.validateAccountToken();
|
|
264
790
|
process.stdout.write(
|
|
265
791
|
`${JSON.stringify(
|
|
266
792
|
{
|