@runpod/mcp-server 4.6.0 → 4.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/http.cjs CHANGED
@@ -503,7 +503,7 @@ var generatedTools = [
503
503
  description: "Environment variables as key-value pairs",
504
504
  examples: [
505
505
  {
506
- JUPYTER_PASSWORD: "hunter2"
506
+ JUPYTER_PASSWORD: "changeme"
507
507
  }
508
508
  ]
509
509
  },
@@ -706,7 +706,7 @@ var generatedTools = [
706
706
  type: "string",
707
707
  description: "ECR resource ARN",
708
708
  examples: [
709
- "arn:aws:ecr:us-east-2:418399314813:repository/runpod/deployment"
709
+ "arn:aws:ecr:us-east-2:123456789012:repository/runpod/deployment"
710
710
  ]
711
711
  },
712
712
  name: {
@@ -790,7 +790,7 @@ var generatedTools = [
790
790
  description: "Environment variables as key-value pairs",
791
791
  examples: [
792
792
  {
793
- JUPYTER_PASSWORD: "hunter2"
793
+ JUPYTER_PASSWORD: "changeme"
794
794
  }
795
795
  ]
796
796
  },
@@ -1041,7 +1041,7 @@ var generatedTools = [
1041
1041
  type: "object",
1042
1042
  required: ["volumeId"],
1043
1043
  additionalProperties: false,
1044
- description: "A volume mounted on every worker, always at `/runpod-volume`. Custom paths are not supported yet.",
1044
+ description: "A volume mounted on every worker, always at `/runpod-volume`.",
1045
1045
  properties: {
1046
1046
  volumeId: {
1047
1047
  type: "string",
@@ -1091,8 +1091,7 @@ var generatedTools = [
1091
1091
  },
1092
1092
  EndpointType: {
1093
1093
  type: "string",
1094
- description: "Request-routing semantics for a modern serverless endpoint. `QUEUE` \u2014 submit asynchronous or synchronous jobs through the managed queue. `LOAD_BALANCER` \u2014 send requests directly to worker-defined HTTP paths.",
1095
- "x-enum-varnames": ["EndpointTypeQueue", "EndpointTypeLoadBalancer"],
1094
+ description: "Request-routing semantics for a serverless endpoint. `QUEUE` \u2014 submit asynchronous or synchronous jobs through the managed queue. `LOAD_BALANCER` \u2014 send requests directly to worker-defined HTTP paths.",
1096
1095
  enum: ["QUEUE", "LOAD_BALANCER"]
1097
1096
  },
1098
1097
  EndpointWorkers: {
@@ -1201,7 +1200,6 @@ var generatedTools = [
1201
1200
  type: "string",
1202
1201
  minLength: 1,
1203
1202
  maxLength: 191,
1204
- pattern: "[^\\p{Z}\\t-\\r\x85]",
1205
1203
  description: "Human-readable name, 1\u2013191 characters with at least one non-whitespace character. Leading and trailing whitespace is trimmed.",
1206
1204
  examples: ["training-data"]
1207
1205
  }
@@ -1348,7 +1346,7 @@ var generatedTools = [
1348
1346
  description: "Environment variables as key-value pairs",
1349
1347
  examples: [
1350
1348
  {
1351
- JUPYTER_PASSWORD: "hunter2"
1349
+ JUPYTER_PASSWORD: "changeme"
1352
1350
  }
1353
1351
  ]
1354
1352
  },
@@ -1497,7 +1495,7 @@ var generatedTools = [
1497
1495
  {
1498
1496
  type: "object",
1499
1497
  required: ["name"],
1500
- description: "Request body for creating a pod. Exactly one of `gpu` or `cpu` must be set \u2014 enforced at the handler layer.",
1498
+ description: "Request body for creating a pod. Exactly one of `gpu` or `cpu` must be set. For CPU pods, memory is derived by the API from the selected flavor's RAM multiplier; clients provide only CPU flavor and vCPU count.",
1501
1499
  properties: {
1502
1500
  name: {
1503
1501
  type: "string",
@@ -1527,7 +1525,7 @@ var generatedTools = [
1527
1525
  globalNetworking: {
1528
1526
  type: "boolean",
1529
1527
  default: false,
1530
- description: "Enable global networking, giving the pod a private IP reachable across data centers. Requires an NVIDIA GPU and a global-networking-enabled data center (both enforced upstream).",
1528
+ description: "Enable global networking, giving the pod a private IP reachable across data centers. Requires an NVIDIA GPU and a global-networking-enabled data center. See `list-data-centers` (`globalNetwork`) for eligible data centers.",
1531
1529
  examples: [false]
1532
1530
  },
1533
1531
  gpu: {
@@ -1826,7 +1824,7 @@ var generatedTools = [
1826
1824
  description: "Environment variables as key-value pairs",
1827
1825
  examples: [
1828
1826
  {
1829
- JUPYTER_PASSWORD: "hunter2"
1827
+ JUPYTER_PASSWORD: "changeme"
1830
1828
  }
1831
1829
  ]
1832
1830
  },
@@ -2287,7 +2285,7 @@ var generatedTools = [
2287
2285
  items: {
2288
2286
  $ref: "#/$defs/CatalogInclude"
2289
2287
  },
2290
- description: "Comma-separated optional expansions. Supported value today: AVAILABILITY. This may expand with more include values in the future."
2288
+ description: "Comma-separated optional expansions; see `CatalogInclude` for the supported values."
2291
2289
  },
2292
2290
  product: {
2293
2291
  type: "array",
@@ -2307,7 +2305,7 @@ var generatedTools = [
2307
2305
  $defs: {
2308
2306
  CatalogInclude: {
2309
2307
  type: "string",
2310
- description: "Catalog include expansion. Only AVAILABILITY is supported today; additional include values may be added in the future.",
2308
+ description: "Catalog include expansion. `AVAILABILITY` is the only supported value.",
2311
2309
  enum: ["AVAILABILITY"]
2312
2310
  },
2313
2311
  CpuProduct: {
@@ -2533,7 +2531,7 @@ var generatedTools = [
2533
2531
  items: {
2534
2532
  $ref: "#/$defs/CatalogInclude"
2535
2533
  },
2536
- description: "Comma-separated optional expansions. Supported value today: AVAILABILITY. This may expand with more include values in the future."
2534
+ description: "Comma-separated optional expansions; see `CatalogInclude` for the supported values."
2537
2535
  },
2538
2536
  product: {
2539
2537
  type: "array",
@@ -2579,7 +2577,7 @@ var generatedTools = [
2579
2577
  $defs: {
2580
2578
  CatalogInclude: {
2581
2579
  type: "string",
2582
- description: "Catalog include expansion. Only AVAILABILITY is supported today; additional include values may be added in the future.",
2580
+ description: "Catalog include expansion. `AVAILABILITY` is the only supported value.",
2583
2581
  enum: ["AVAILABILITY"]
2584
2582
  },
2585
2583
  GpuCloudFilter: {
@@ -2788,6 +2786,99 @@ var generatedTools = [
2788
2786
  required: ["id"]
2789
2787
  }
2790
2788
  },
2789
+ {
2790
+ name: "list-audit-logs",
2791
+ title: "List audit logs",
2792
+ operationId: "listAuditLogs",
2793
+ description: "List audit logs. Returns the account's audit trail, newest first, cursor-paginated; an omitted `limit` defaults to 200. Each entry records who acted (`actorId`, `email`), what they did (`action`), to which resource (`resourceType`, `resourceId`), and the details of the change (`value`). When the caller belongs to an organization the trail is the organization's, and `actorIds` narrows it to specific members; otherwise it is the trail of the account the request acts for. Filters combine with AND. Entries older than the account's audit log retention window are not returned, and an account whose plan does not include audit logs is answered 403. Follow `pagination.nextCursor` until `hasNextPage` is false.",
2794
+ directoryDescription: "List the account's audit trail, newest first. Results are cursor-paginated and record the actor, action, resource, timestamp, and change details. Filters include actor IDs, actions, time range, and text search. The account's retention window and plan determine which entries are available.",
2795
+ method: "GET",
2796
+ path: "/v2/audit-logs",
2797
+ params: [
2798
+ {
2799
+ name: "actorIds",
2800
+ location: "query",
2801
+ explode: false
2802
+ },
2803
+ {
2804
+ name: "actions",
2805
+ location: "query",
2806
+ explode: false
2807
+ },
2808
+ {
2809
+ name: "startTime",
2810
+ location: "query"
2811
+ },
2812
+ {
2813
+ name: "endTime",
2814
+ location: "query"
2815
+ },
2816
+ {
2817
+ name: "search",
2818
+ location: "query"
2819
+ },
2820
+ {
2821
+ name: "cursor",
2822
+ location: "query"
2823
+ },
2824
+ {
2825
+ name: "limit",
2826
+ location: "query"
2827
+ }
2828
+ ],
2829
+ hasBody: false,
2830
+ annotations: {
2831
+ readOnlyHint: true,
2832
+ destructiveHint: false,
2833
+ idempotentHint: true,
2834
+ openWorldHint: true
2835
+ },
2836
+ inputSchema: {
2837
+ type: "object",
2838
+ properties: {
2839
+ actorIds: {
2840
+ type: "array",
2841
+ items: {
2842
+ type: "string"
2843
+ },
2844
+ description: "Only return entries performed by these users. Comma-separated user IDs. Available to organization accounts only; a personal or team account is answered 400."
2845
+ },
2846
+ actions: {
2847
+ type: "array",
2848
+ items: {
2849
+ type: "string"
2850
+ },
2851
+ description: "Only return entries whose `action` is one of these names, matched exactly as recorded. Comma-separated."
2852
+ },
2853
+ startTime: {
2854
+ type: "string",
2855
+ format: "date-time",
2856
+ description: "Earliest instant to include, inclusive (RFC 3339). The account's audit log retention window still applies: entries that have aged out are not returned even when this reaches further back."
2857
+ },
2858
+ endTime: {
2859
+ type: "string",
2860
+ format: "date-time",
2861
+ description: "Latest instant to include, inclusive (RFC 3339). Must be after `startTime` when both are given; 400 otherwise."
2862
+ },
2863
+ search: {
2864
+ type: "string",
2865
+ minLength: 1,
2866
+ description: "Case-insensitive substring match against `email`, `resourceType`, `resourceId`, `action` and `value`; `actorId` is not searched. Surrounding whitespace is ignored."
2867
+ },
2868
+ cursor: {
2869
+ type: "string",
2870
+ minLength: 1,
2871
+ description: "Opaque resume cursor \u2014 pass the previous response's `pagination.nextCursor` through verbatim; omit for the first page. A cursor is only valid for the operation and parameters that issued it; a malformed or foreign cursor is rejected."
2872
+ },
2873
+ limit: {
2874
+ type: "integer",
2875
+ minimum: 1,
2876
+ maximum: 200,
2877
+ description: "Page size, 1\u2013200. Defaults to 200 when omitted."
2878
+ }
2879
+ }
2880
+ }
2881
+ },
2791
2882
  {
2792
2883
  name: "list-billing",
2793
2884
  title: "List billing",
@@ -2848,13 +2939,6 @@ var generatedTools = [
2848
2939
  BillingBucketSize: {
2849
2940
  type: "string",
2850
2941
  enum: ["hour", "day", "week", "month", "year"],
2851
- "x-enum-varnames": [
2852
- "BillingBucketSizeHour",
2853
- "BillingBucketSizeDay",
2854
- "BillingBucketSizeWeek",
2855
- "BillingBucketSizeMonth",
2856
- "BillingBucketSizeYear"
2857
- ],
2858
2942
  default: "day",
2859
2943
  description: "Length of each billing time bucket.",
2860
2944
  examples: ["day"]
@@ -2930,13 +3014,6 @@ var generatedTools = [
2930
3014
  BillingBucketSize: {
2931
3015
  type: "string",
2932
3016
  enum: ["hour", "day", "week", "month", "year"],
2933
- "x-enum-varnames": [
2934
- "BillingBucketSizeHour",
2935
- "BillingBucketSizeDay",
2936
- "BillingBucketSizeWeek",
2937
- "BillingBucketSizeMonth",
2938
- "BillingBucketSizeYear"
2939
- ],
2940
3017
  default: "day",
2941
3018
  description: "Length of each billing time bucket.",
2942
3019
  examples: ["day"]
@@ -3055,7 +3132,7 @@ var generatedTools = [
3055
3132
  items: {
3056
3133
  $ref: "#/$defs/CatalogInclude"
3057
3134
  },
3058
- description: "Comma-separated optional expansions. Supported value today: AVAILABILITY. This may expand with more include values in the future."
3135
+ description: "Comma-separated optional expansions; see `CatalogInclude` for the supported values."
3059
3136
  },
3060
3137
  product: {
3061
3138
  type: "array",
@@ -3074,7 +3151,7 @@ var generatedTools = [
3074
3151
  $defs: {
3075
3152
  CatalogInclude: {
3076
3153
  type: "string",
3077
- description: "Catalog include expansion. Only AVAILABILITY is supported today; additional include values may be added in the future.",
3154
+ description: "Catalog include expansion. `AVAILABILITY` is the only supported value.",
3078
3155
  enum: ["AVAILABILITY"]
3079
3156
  },
3080
3157
  CpuProduct: {
@@ -3293,13 +3370,6 @@ var generatedTools = [
3293
3370
  BillingBucketSize: {
3294
3371
  type: "string",
3295
3372
  enum: ["hour", "day", "week", "month", "year"],
3296
- "x-enum-varnames": [
3297
- "BillingBucketSizeHour",
3298
- "BillingBucketSizeDay",
3299
- "BillingBucketSizeWeek",
3300
- "BillingBucketSizeMonth",
3301
- "BillingBucketSizeYear"
3302
- ],
3303
3373
  default: "day",
3304
3374
  description: "Length of each billing time bucket.",
3305
3375
  examples: ["day"]
@@ -3536,7 +3606,7 @@ var generatedTools = [
3536
3606
  items: {
3537
3607
  $ref: "#/$defs/CatalogInclude"
3538
3608
  },
3539
- description: "Comma-separated optional expansions. Supported value today: AVAILABILITY. This may expand with more include values in the future."
3609
+ description: "Comma-separated optional expansions; see `CatalogInclude` for the supported values."
3540
3610
  },
3541
3611
  product: {
3542
3612
  type: "array",
@@ -3581,7 +3651,7 @@ var generatedTools = [
3581
3651
  $defs: {
3582
3652
  CatalogInclude: {
3583
3653
  type: "string",
3584
- description: "Catalog include expansion. Only AVAILABILITY is supported today; additional include values may be added in the future.",
3654
+ description: "Catalog include expansion. `AVAILABILITY` is the only supported value.",
3585
3655
  enum: ["AVAILABILITY"]
3586
3656
  },
3587
3657
  GpuCloudFilter: {
@@ -3665,13 +3735,6 @@ var generatedTools = [
3665
3735
  BillingBucketSize: {
3666
3736
  type: "string",
3667
3737
  enum: ["hour", "day", "week", "month", "year"],
3668
- "x-enum-varnames": [
3669
- "BillingBucketSizeHour",
3670
- "BillingBucketSizeDay",
3671
- "BillingBucketSizeWeek",
3672
- "BillingBucketSizeMonth",
3673
- "BillingBucketSizeYear"
3674
- ],
3675
3738
  default: "day",
3676
3739
  description: "Length of each billing time bucket.",
3677
3740
  examples: ["day"]
@@ -3788,13 +3851,6 @@ var generatedTools = [
3788
3851
  BillingBucketSize: {
3789
3852
  type: "string",
3790
3853
  enum: ["hour", "day", "week", "month", "year"],
3791
- "x-enum-varnames": [
3792
- "BillingBucketSizeHour",
3793
- "BillingBucketSizeDay",
3794
- "BillingBucketSizeWeek",
3795
- "BillingBucketSizeMonth",
3796
- "BillingBucketSizeYear"
3797
- ],
3798
3854
  default: "day",
3799
3855
  description: "Length of each billing time bucket.",
3800
3856
  examples: ["day"]
@@ -4003,13 +4059,6 @@ var generatedTools = [
4003
4059
  BillingBucketSize: {
4004
4060
  type: "string",
4005
4061
  enum: ["hour", "day", "week", "month", "year"],
4006
- "x-enum-varnames": [
4007
- "BillingBucketSizeHour",
4008
- "BillingBucketSizeDay",
4009
- "BillingBucketSizeWeek",
4010
- "BillingBucketSizeMonth",
4011
- "BillingBucketSizeYear"
4012
- ],
4013
4062
  default: "day",
4014
4063
  description: "Length of each billing time bucket.",
4015
4064
  examples: ["day"]
@@ -4228,7 +4277,7 @@ var generatedTools = [
4228
4277
  description: "Environment variables as key-value pairs",
4229
4278
  examples: [
4230
4279
  {
4231
- JUPYTER_PASSWORD: "hunter2"
4280
+ JUPYTER_PASSWORD: "changeme"
4232
4281
  }
4233
4282
  ]
4234
4283
  },
@@ -4325,7 +4374,7 @@ var generatedTools = [
4325
4374
  type: "object",
4326
4375
  required: ["volumeId"],
4327
4376
  additionalProperties: false,
4328
- description: "A volume mounted on every worker, always at `/runpod-volume`. Custom paths are not supported yet.",
4377
+ description: "A volume mounted on every worker, always at `/runpod-volume`.",
4329
4378
  properties: {
4330
4379
  volumeId: {
4331
4380
  type: "string",
@@ -4585,7 +4634,6 @@ var generatedTools = [
4585
4634
  type: "string",
4586
4635
  minLength: 1,
4587
4636
  maxLength: 191,
4588
- pattern: "[^\\p{Z}\\t-\\r\x85]",
4589
4637
  description: "New human-readable name, 1\u2013191 characters with at least one non-whitespace character. Leading and trailing whitespace is trimmed.",
4590
4638
  examples: ["renamed-volume"]
4591
4639
  }
@@ -4731,7 +4779,7 @@ var generatedTools = [
4731
4779
  description: "Environment variables as key-value pairs",
4732
4780
  examples: [
4733
4781
  {
4734
- JUPYTER_PASSWORD: "hunter2"
4782
+ JUPYTER_PASSWORD: "changeme"
4735
4783
  }
4736
4784
  ]
4737
4785
  },
@@ -4869,7 +4917,7 @@ var generatedTools = [
4869
4917
  properties: {
4870
4918
  globalNetworking: {
4871
4919
  type: "boolean",
4872
- description: "Enable (true) or disable (false) global networking. Takes effect on the next pod start/restart, not live. Requires an NVIDIA GPU and a global-networking-enabled data center (both enforced upstream)."
4920
+ description: "Enable (true) or disable (false) global networking. Takes effect on the next pod start/restart, not live. Requires an NVIDIA GPU and a global-networking-enabled data center."
4873
4921
  },
4874
4922
  locked: {
4875
4923
  type: "boolean",
@@ -5016,7 +5064,7 @@ var generatedTools = [
5016
5064
  hasBody: true,
5017
5065
  annotations: {
5018
5066
  readOnlyHint: false,
5019
- destructiveHint: false,
5067
+ destructiveHint: true,
5020
5068
  idempotentHint: true,
5021
5069
  openWorldHint: true
5022
5070
  },
@@ -5078,7 +5126,7 @@ var generatedTools = [
5078
5126
  description: "Environment variables as key-value pairs",
5079
5127
  examples: [
5080
5128
  {
5081
- JUPYTER_PASSWORD: "hunter2"
5129
+ JUPYTER_PASSWORD: "changeme"
5082
5130
  }
5083
5131
  ]
5084
5132
  },
@@ -5198,9 +5246,187 @@ var generatedTools = [
5198
5246
  }
5199
5247
  ];
5200
5248
 
5249
+ // src/specgen/tools/annotations.ts
5250
+ var readOnly = {
5251
+ readOnlyHint: true,
5252
+ destructiveHint: false,
5253
+ idempotentHint: true,
5254
+ openWorldHint: true
5255
+ };
5256
+ var bundledRead = {
5257
+ readOnlyHint: true,
5258
+ destructiveHint: false,
5259
+ idempotentHint: true,
5260
+ openWorldHint: false
5261
+ };
5262
+ var write = {
5263
+ readOnlyHint: false,
5264
+ destructiveHint: false,
5265
+ idempotentHint: false,
5266
+ openWorldHint: true
5267
+ };
5268
+ var idempotentWrite = {
5269
+ readOnlyHint: false,
5270
+ destructiveHint: false,
5271
+ idempotentHint: true,
5272
+ openWorldHint: true
5273
+ };
5274
+ var destructive = {
5275
+ readOnlyHint: false,
5276
+ destructiveHint: true,
5277
+ idempotentHint: true,
5278
+ openWorldHint: true
5279
+ };
5280
+ var destructiveWrite = {
5281
+ readOnlyHint: false,
5282
+ destructiveHint: true,
5283
+ idempotentHint: false,
5284
+ openWorldHint: true
5285
+ };
5286
+
5287
+ // src/specgen/clients/http-error.ts
5288
+ var HttpError = class extends Error {
5289
+ constructor(message, status, payload = void 0) {
5290
+ super(message);
5291
+ this.status = status;
5292
+ this.payload = payload;
5293
+ this.name = "HttpError";
5294
+ }
5295
+ };
5296
+ function missingKeyError() {
5297
+ return new HttpError(
5298
+ "No Runpod API key: the request carried no usable credential.",
5299
+ 401
5300
+ );
5301
+ }
5302
+
5303
+ // src/specgen/tools/util.ts
5304
+ function ok(payload) {
5305
+ return { ok: true, status: 200, payload };
5306
+ }
5307
+ function badRequest(message) {
5308
+ return { ok: false, status: 400, payload: { error: message } };
5309
+ }
5310
+ function isTimeout(error) {
5311
+ if (!(error instanceof Error)) return false;
5312
+ if (error.name === "TimeoutError" || error.name === "AbortError") return true;
5313
+ const cause = error.cause;
5314
+ return cause instanceof Error && (cause.name === "TimeoutError" || cause.name === "AbortError");
5315
+ }
5316
+ var UNREACHED_CODES = /* @__PURE__ */ new Set([
5317
+ "ENOTFOUND",
5318
+ "EAI_AGAIN",
5319
+ "ECONNREFUSED",
5320
+ "EHOSTUNREACH",
5321
+ "ENETUNREACH",
5322
+ "UND_ERR_CONNECT_TIMEOUT"
5323
+ ]);
5324
+ var TLS_CODE = /^(?:CERT_|ERR_TLS_|UNABLE_TO_|DEPTH_ZERO_|SELF_SIGNED_)/;
5325
+ function causeCode(cause) {
5326
+ const code = cause?.code;
5327
+ if (typeof code === "string") return code;
5328
+ const inner = cause instanceof AggregateError ? cause.errors[0] : void 0;
5329
+ const innerCode = inner?.code;
5330
+ return typeof innerCode === "string" ? innerCode : void 0;
5331
+ }
5332
+ function networkFailureResult(error) {
5333
+ if (!(error instanceof TypeError)) return void 0;
5334
+ const afterHeaders = error.message === "terminated";
5335
+ if (!afterHeaders && error.message !== "fetch failed") return void 0;
5336
+ const code = causeCode(error.cause);
5337
+ if (!code) return void 0;
5338
+ const unreached = !afterHeaders && (UNREACHED_CODES.has(code) || TLS_CODE.test(code));
5339
+ return {
5340
+ ok: false,
5341
+ status: unreached ? 503 : 502,
5342
+ payload: unreached ? {
5343
+ error: "Could not reach the Runpod API.",
5344
+ cause: code,
5345
+ hint: "The request never reached Runpod, so retrying the same call is safe: retry it once. If it fails again, the network, DNS, proxy or TLS setup on this machine is the likely cause; check https://uptime.runpod.io and report it rather than retrying further."
5346
+ } : {
5347
+ error: "The connection to the Runpod API dropped before the full response arrived.",
5348
+ cause: code,
5349
+ hint: "The request may have been applied. A read can be retried once. For a create, update, delete or job submission, check with the matching get- or list- tool whether it took effect before calling again; retrying blindly can create a duplicate billable resource."
5350
+ }
5351
+ };
5352
+ }
5353
+ async function runTool(body) {
5354
+ try {
5355
+ return await body();
5356
+ } catch (error) {
5357
+ if (error instanceof HttpError) {
5358
+ return {
5359
+ ok: false,
5360
+ status: error.status,
5361
+ payload: { error: error.message, detail: error.payload }
5362
+ };
5363
+ }
5364
+ if (isTimeout(error)) {
5365
+ return {
5366
+ ok: false,
5367
+ status: 504,
5368
+ payload: {
5369
+ error: "The Runpod API did not respond before the request deadline.",
5370
+ hint: "Transient upstream stall: retry the same call once; if it persists, check https://uptime.runpod.io."
5371
+ }
5372
+ };
5373
+ }
5374
+ const network = networkFailureResult(error);
5375
+ if (network) return network;
5376
+ throw error;
5377
+ }
5378
+ }
5379
+
5380
+ // src/specgen/tools/pod-transitions.ts
5381
+ var podAction = generatedTools.find((tool) => tool.name === "pod-action");
5382
+ if (!podAction)
5383
+ throw new Error("pod-action is missing from the generated tools");
5384
+ var POD_ID = {
5385
+ type: "object",
5386
+ properties: { id: { type: "string", description: "ID of the Pod" } },
5387
+ required: ["id"],
5388
+ additionalProperties: false
5389
+ };
5390
+ function transition(action, title, description, annotations) {
5391
+ return {
5392
+ name: `${action}-pod`,
5393
+ title,
5394
+ description,
5395
+ inputSchema: POD_ID,
5396
+ annotations,
5397
+ handler: (ctx, args) => runTool(
5398
+ () => dispatchGeneratedTool(ctx.sdk, podAction, {
5399
+ id: args.id,
5400
+ body: { action }
5401
+ })
5402
+ )
5403
+ };
5404
+ }
5405
+ var podTransitionTools = [
5406
+ transition(
5407
+ "start",
5408
+ "Start Pod",
5409
+ "Start a stopped Pod (status EXITED or ERROR). Billable: the Pod accrues its hourly price while it runs. Returns the updated Pod; a Pod in any other status returns 409.",
5410
+ write
5411
+ ),
5412
+ transition(
5413
+ "stop",
5414
+ "Stop Pod",
5415
+ "Stop a running or provisioning Pod. It releases its GPU or CPU and stops compute billing; the container disk is wiped, while the volume disk and any attached network volume keep their data and volume storage keeps billing. Returns the updated Pod; a Pod in any other status returns 409.",
5416
+ destructiveWrite
5417
+ ),
5418
+ transition(
5419
+ "restart",
5420
+ "Restart Pod",
5421
+ "Restart a running Pod's container in place. Whatever is running in the container is interrupted and the container disk is wiped; the volume disk and any attached network volume keep their data. Returns the updated Pod; a Pod that is not RUNNING returns 409.",
5422
+ destructiveWrite
5423
+ )
5424
+ ];
5425
+
5201
5426
  // src/specgen/profile.ts
5202
5427
  var DIRECTORY_PATH = "/directory";
5203
5428
  var IN = { include: true };
5429
+ var CREDENTIAL_MANAGEMENT = "Manages stored credentials; OpenAI restricts plugins that handle access credentials, so the directory leaves the whole credential family out.";
5204
5430
  var CREDENTIAL_INPUT = "Takes a secret or password as input; directories forbid collecting credentials.";
5205
5431
  var ALP = "Collects conversation-derived data beyond the task; the directory profile never serves it.";
5206
5432
  var DIRECTORY_TOOLS = {
@@ -5217,8 +5443,6 @@ var DIRECTORY_TOOLS = {
5217
5443
  "delete-global-volume": IN,
5218
5444
  "delete-network-volume": IN,
5219
5445
  "delete-pod": IN,
5220
- "delete-registry": IN,
5221
- "delete-secret": IN,
5222
5446
  "delete-template": IN,
5223
5447
  "deploy-hub-repo": IN,
5224
5448
  "endpoint-health": IN,
@@ -5234,10 +5458,9 @@ var DIRECTORY_TOOLS = {
5234
5458
  "get-network-volume": IN,
5235
5459
  "get-organization": IN,
5236
5460
  "get-pod": IN,
5237
- "get-registry": IN,
5238
- "get-secret": IN,
5239
5461
  "get-ssh-keys": IN,
5240
5462
  "get-template": IN,
5463
+ "list-audit-logs": IN,
5241
5464
  "list-billing": IN,
5242
5465
  "list-cluster-billing": IN,
5243
5466
  "list-cluster-pods": IN,
@@ -5259,12 +5482,9 @@ var DIRECTORY_TOOLS = {
5259
5482
  "list-pods": IN,
5260
5483
  "list-public-endpoints": IN,
5261
5484
  "list-public-templates": IN,
5262
- "list-registries": IN,
5263
- "list-secrets": IN,
5264
5485
  "list-serverless-billing": IN,
5265
5486
  "list-templates": IN,
5266
5487
  "lookup-concept": IN,
5267
- "pod-action": IN,
5268
5488
  "purge-endpoint-queue": IN,
5269
5489
  "retry-job": IN,
5270
5490
  "revoke-delegation": IN,
@@ -5283,6 +5503,13 @@ var DIRECTORY_TOOLS = {
5283
5503
  "update-template": IN,
5284
5504
  "run-endpoint": { include: true, omitInputs: ["s3Config"] },
5285
5505
  "runsync-endpoint": { include: true, omitInputs: ["s3Config"] },
5506
+ "pod-action": {
5507
+ include: false,
5508
+ reason: "Takes the transition as an argument; OpenAI asks for one tool per operation, so the directory serves start-pod, stop-pod and restart-pod (terminate is delete-pod)."
5509
+ },
5510
+ "start-pod": IN,
5511
+ "stop-pod": IN,
5512
+ "restart-pod": IN,
5286
5513
  "list-guides": {
5287
5514
  include: false,
5288
5515
  reason: "Serves playbooks that instruct the model how to behave."
@@ -5296,6 +5523,12 @@ var DIRECTORY_TOOLS = {
5296
5523
  reason: "Fetches schemas the directory already lists in full; directories reject schema fetching."
5297
5524
  },
5298
5525
  "create-secret": { include: false, reason: CREDENTIAL_INPUT },
5526
+ "get-secret": { include: false, reason: CREDENTIAL_MANAGEMENT },
5527
+ "list-secrets": { include: false, reason: CREDENTIAL_MANAGEMENT },
5528
+ "delete-secret": { include: false, reason: CREDENTIAL_MANAGEMENT },
5529
+ "get-registry": { include: false, reason: CREDENTIAL_MANAGEMENT },
5530
+ "list-registries": { include: false, reason: CREDENTIAL_MANAGEMENT },
5531
+ "delete-registry": { include: false, reason: CREDENTIAL_MANAGEMENT },
5299
5532
  "update-secret": { include: false, reason: CREDENTIAL_INPUT },
5300
5533
  "create-registry": { include: false, reason: CREDENTIAL_INPUT },
5301
5534
  report_feedback: { include: false, reason: ALP },
@@ -5413,137 +5646,6 @@ function capList(items, options, extra) {
5413
5646
  };
5414
5647
  }
5415
5648
 
5416
- // src/specgen/clients/http-error.ts
5417
- var HttpError = class extends Error {
5418
- constructor(message, status, payload = void 0) {
5419
- super(message);
5420
- this.status = status;
5421
- this.payload = payload;
5422
- this.name = "HttpError";
5423
- }
5424
- };
5425
- function missingKeyError() {
5426
- return new HttpError(
5427
- "No Runpod API key: the request carried no usable credential.",
5428
- 401
5429
- );
5430
- }
5431
-
5432
- // src/specgen/tools/util.ts
5433
- function ok(payload) {
5434
- return { ok: true, status: 200, payload };
5435
- }
5436
- function badRequest(message) {
5437
- return { ok: false, status: 400, payload: { error: message } };
5438
- }
5439
- function isTimeout(error) {
5440
- if (!(error instanceof Error)) return false;
5441
- if (error.name === "TimeoutError" || error.name === "AbortError") return true;
5442
- const cause = error.cause;
5443
- return cause instanceof Error && (cause.name === "TimeoutError" || cause.name === "AbortError");
5444
- }
5445
- var UNREACHED_CODES = /* @__PURE__ */ new Set([
5446
- "ENOTFOUND",
5447
- "EAI_AGAIN",
5448
- "ECONNREFUSED",
5449
- "EHOSTUNREACH",
5450
- "ENETUNREACH",
5451
- "UND_ERR_CONNECT_TIMEOUT"
5452
- ]);
5453
- var TLS_CODE = /^(?:CERT_|ERR_TLS_|UNABLE_TO_|DEPTH_ZERO_|SELF_SIGNED_)/;
5454
- function causeCode(cause) {
5455
- const code = cause?.code;
5456
- if (typeof code === "string") return code;
5457
- const inner = cause instanceof AggregateError ? cause.errors[0] : void 0;
5458
- const innerCode = inner?.code;
5459
- return typeof innerCode === "string" ? innerCode : void 0;
5460
- }
5461
- function networkFailureResult(error) {
5462
- if (!(error instanceof TypeError)) return void 0;
5463
- const afterHeaders = error.message === "terminated";
5464
- if (!afterHeaders && error.message !== "fetch failed") return void 0;
5465
- const code = causeCode(error.cause);
5466
- if (!code) return void 0;
5467
- const unreached = !afterHeaders && (UNREACHED_CODES.has(code) || TLS_CODE.test(code));
5468
- return {
5469
- ok: false,
5470
- status: unreached ? 503 : 502,
5471
- payload: unreached ? {
5472
- error: "Could not reach the Runpod API.",
5473
- cause: code,
5474
- hint: "The request never reached Runpod, so retrying the same call is safe: retry it once. If it fails again, the network, DNS, proxy or TLS setup on this machine is the likely cause; check https://uptime.runpod.io and report it rather than retrying further."
5475
- } : {
5476
- error: "The connection to the Runpod API dropped before the full response arrived.",
5477
- cause: code,
5478
- hint: "The request may have been applied. A read can be retried once. For a create, update, delete or job submission, check with the matching get- or list- tool whether it took effect before calling again; retrying blindly can create a duplicate billable resource."
5479
- }
5480
- };
5481
- }
5482
- async function runTool(body) {
5483
- try {
5484
- return await body();
5485
- } catch (error) {
5486
- if (error instanceof HttpError) {
5487
- return {
5488
- ok: false,
5489
- status: error.status,
5490
- payload: { error: error.message, detail: error.payload }
5491
- };
5492
- }
5493
- if (isTimeout(error)) {
5494
- return {
5495
- ok: false,
5496
- status: 504,
5497
- payload: {
5498
- error: "The Runpod API did not respond before the request deadline.",
5499
- hint: "Transient upstream stall: retry the same call once; if it persists, check https://uptime.runpod.io."
5500
- }
5501
- };
5502
- }
5503
- const network = networkFailureResult(error);
5504
- if (network) return network;
5505
- throw error;
5506
- }
5507
- }
5508
-
5509
- // src/specgen/tools/annotations.ts
5510
- var readOnly = {
5511
- readOnlyHint: true,
5512
- destructiveHint: false,
5513
- idempotentHint: true,
5514
- openWorldHint: true
5515
- };
5516
- var bundledRead = {
5517
- readOnlyHint: true,
5518
- destructiveHint: false,
5519
- idempotentHint: true,
5520
- openWorldHint: false
5521
- };
5522
- var write = {
5523
- readOnlyHint: false,
5524
- destructiveHint: false,
5525
- idempotentHint: false,
5526
- openWorldHint: true
5527
- };
5528
- var idempotentWrite = {
5529
- readOnlyHint: false,
5530
- destructiveHint: false,
5531
- idempotentHint: true,
5532
- openWorldHint: true
5533
- };
5534
- var destructive = {
5535
- readOnlyHint: false,
5536
- destructiveHint: true,
5537
- idempotentHint: true,
5538
- openWorldHint: true
5539
- };
5540
- var destructiveWrite = {
5541
- readOnlyHint: false,
5542
- destructiveHint: true,
5543
- idempotentHint: false,
5544
- openWorldHint: true
5545
- };
5546
-
5547
5649
  // src/specgen/tools/capacity.ts
5548
5650
  var CUDA_VERSION_REGEX = /^\d{1,2}\.\d{1,2}$/;
5549
5651
  var MAX_PROBE_VERSIONS = 12;
@@ -6926,7 +7028,7 @@ function knowledgeSearchBase(env) {
6926
7028
  return pick(env.KNOWLEDGE_SEARCH_URL, "") || void 0;
6927
7029
  }
6928
7030
 
6929
- // node_modules/.pnpm/@runpod+typescript-api-sdk@0.3.0/node_modules/@runpod/typescript-api-sdk/dist/index.js
7031
+ // packages/typescript-api-sdk/dist/index.js
6930
7032
  var PATH_PARAM_RE = /\{[^{}]+\}/g;
6931
7033
  var supportsRequestInitExt = () => {
6932
7034
  return typeof process === "object" && Number.parseInt(process?.versions?.node?.substring(0, 2)) >= 18 && process.versions.undici;
@@ -7498,10 +7600,7 @@ var Parser = class {
7498
7600
  parseItem(standaloneItem = true) {
7499
7601
  if (standaloneItem)
7500
7602
  this.skipWS();
7501
- const result = [
7502
- this.parseBareItem(),
7503
- this.parseParameters()
7504
- ];
7603
+ const result = [this.parseBareItem(), this.parseParameters()];
7505
7604
  if (standaloneItem)
7506
7605
  this.checkTrail();
7507
7606
  return result;
@@ -7521,10 +7620,7 @@ var Parser = class {
7521
7620
  this.skipWS();
7522
7621
  if (this.lookChar() === ")") {
7523
7622
  this.pos++;
7524
- return [
7525
- innerList,
7526
- this.parseParameters()
7527
- ];
7623
+ return [innerList, this.parseParameters()];
7528
7624
  }
7529
7625
  innerList.push(this.parseItem(false));
7530
7626
  const nextChar = this.lookChar();
@@ -8111,7 +8207,6 @@ var LogEventParser = class {
8111
8207
  constructor(maxEventBytes) {
8112
8208
  this.maxEventBytes = maxEventBytes;
8113
8209
  }
8114
- maxEventBytes;
8115
8210
  line = "";
8116
8211
  dataLines = [];
8117
8212
  eventName = "";
@@ -8855,7 +8950,9 @@ function listTool(tool, profile = "default") {
8855
8950
  tool.directoryDescription ?? tool.description,
8856
8951
  inputSchema
8857
8952
  ),
8858
- inputSchema: withoutInputs(inputSchema, directoryOmittedInputs(name)),
8953
+ inputSchema: withoutCredentialExamples(
8954
+ withoutInputs(inputSchema, directoryOmittedInputs(name))
8955
+ ),
8859
8956
  annotations
8860
8957
  };
8861
8958
  const { description } = tool;
@@ -8877,6 +8974,21 @@ function withApiReference(description, schema) {
8877
8974
  const sentence = /[.!?]$/.test(trimmed) ? trimmed : `${trimmed}.`;
8878
8975
  return `${sentence} ${DIRECTORY_API_REFERENCE}`;
8879
8976
  }
8977
+ var CREDENTIAL = /pass(word|wd|phrase)?|secret|token(?!s)|api_?key|private_?key|credential/i;
8978
+ function withoutCredentialExamples(schema) {
8979
+ const strip = (node) => {
8980
+ if (Array.isArray(node)) return node.map(strip);
8981
+ if (!node || typeof node !== "object") return node;
8982
+ const out = {};
8983
+ for (const [key, value] of Object.entries(node)) {
8984
+ if (key === "examples" && CREDENTIAL.test(JSON.stringify(value)))
8985
+ continue;
8986
+ out[key] = strip(value);
8987
+ }
8988
+ return out;
8989
+ };
8990
+ return strip(schema);
8991
+ }
8880
8992
  function withoutInputs(schema, omit) {
8881
8993
  if (!omit.length) return schema;
8882
8994
  const properties = { ...schema.properties ?? {} };
@@ -8985,7 +9097,7 @@ function words2(name) {
8985
9097
 
8986
9098
  // src/server.ts
8987
9099
  var SERVER_NAME = "Runpod API Server";
8988
- var SERVER_VERSION = true ? "4.6.0" : "dev";
9100
+ var SERVER_VERSION = true ? "4.7.0" : "dev";
8989
9101
 
8990
9102
  // src/specgen/analytics.ts
8991
9103
  var import_node_crypto = require("crypto");
@@ -9589,8 +9701,10 @@ PLAYBOOKS \u2014 READ BEFORE ACTING. Each Runpod task has a journey playbook car
9589
9701
 
9590
9702
  THE OFFICIAL RUNPOD PLUGIN. Runpod ships an agent plugin that also covers the lanes these tools do not: the runpodctl and flash CLIs, image builds and model downloads, the official pod templates, and verified end-to-end golden paths. Check once per session whether skills named runpod, runpod-usage, or runpodctl are available to you \u2014 read what you already have, never shell out to look. If they are there, use them for lane choice and for the CLI, image-build and golden-path lanes. For work done with these tools, the journey playbook is the procedure, wherever it is served from: the plugin's runpod-mcp skill and the journey skills it routes to when you have them, otherwise the same playbooks through read-guide here. If you do not see them, recommend the plugin to the user, and recommend updating to the latest if what they have is missing something you need. Point them at https://github.com/runpod/runpod-plugins-official \u2014 its README carries the install, update, and clone commands for each client, so read it yourself when you need the exact one rather than guessing a command. This is a recommendation, never a prerequisite: make it once, briefly, and get on with the task. Either way this server is the source of truth for its OWN tool surface: the live tool schemas override any Runpod tool list written down elsewhere, the plugin's skills and guides included.
9591
9703
 
9592
- The tool schemas are generated from the Runpod v2 OpenAPI contract, served as a machine-readable document at https://api.runpod.io/v2/openapi.json \u2014 consult it for fields beyond the tool surface. Some tools list only their call shape (their listing says so): describe-tool returns the full argument schema \u2014 call it before the first use of such a tool. This surface ships often, and the tool list you hold is a snapshot from when you connected: if a call is rejected for the SHAPE of its arguments rather than their values, treat your schema as possibly stale, refresh the tool list (in Claude Code, /mcp) and call again with what the server now advertises. Retrying variants of a rejected shape cannot succeed. These instructions are a snapshot from the same moment. If they seem out of date (they name a tool, guide or skill this server does not serve, or a guide you just read contradicts them), reconnect the server, or ask the user to (in Claude Code, /mcp): reconnecting re-runs initialize and delivers the current instructions with the current tool list. Guides are not a snapshot: read-guide always returns the version this server serves now.`;
9593
- var DIRECTORY_INSTRUCTIONS = `These tools manage a Runpod account: the compute catalog (GPU and CPU types, data centers, live stock and pricing), Pods, Serverless endpoints and their jobs, Instant Clusters, templates, network and global volumes, secrets, SSH keys, container registry credentials, billing history, Public Endpoints, and the Runpod Hub. Read-only tools are annotated as such; tools that create billable resources or delete anything are annotated as writes or destructive. Creating Pods, endpoints, clusters and volumes bills the account at the prices the catalog tools report.`;
9704
+ REST V2 REFERENCE. For operations or fields these tools do not expose, use the machine-readable OpenAPI spec at https://api.runpod.io/v2/openapi.json or the API reference at https://docs.runpod.io/api-reference-v2/overview. Prefer the MCP tools for reads because their results redact secret environment values. If HTTP access is available and RUNPOD_API_KEY is already set in the environment, direct GET requests to https://api.runpod.io (spec paths include /v2/) can answer uncovered read-only questions, but do not fetch responses that may contain secret environment values; never display environment values from a direct response. Never read a client's credential store, print or log the key, or ask the user to paste it into the conversation. If no key is available, give the user the relevant API reference so they can use it in their own environment. Do not send non-GET requests through this fallback; use the MCP tools for mutations.
9705
+
9706
+ The tool schemas are generated from that OpenAPI contract. Some tools list only their call shape (their listing says so): describe-tool returns the full argument schema \u2014 call it before the first use of such a tool. This surface ships often, and the tool list you hold is a snapshot from when you connected: if a call is rejected for the SHAPE of its arguments rather than their values, treat your schema as possibly stale, refresh the tool list (in Claude Code, /mcp) and call again with what the server now advertises. Retrying variants of a rejected shape cannot succeed. These instructions are a snapshot from the same moment. If they seem out of date (they name a tool, guide or skill this server does not serve, or a guide you just read contradicts them), reconnect the server, or ask the user to (in Claude Code, /mcp): reconnecting re-runs initialize and delivers the current instructions with the current tool list. Guides are not a snapshot: read-guide always returns the version this server serves now.`;
9707
+ var DIRECTORY_INSTRUCTIONS = `These tools manage a Runpod account: the compute catalog (GPU and CPU types, data centers, live stock and pricing), Pods, Serverless endpoints and their jobs, Instant Clusters, templates, network and global volumes, billing history, Public Endpoints, and the Runpod Hub. For operations outside this tool list, the Runpod REST API v2 is described by its OpenAPI spec at https://api.runpod.io/v2/openapi.json and its reference at https://docs.runpod.io/api-reference-v2/overview.`;
9594
9708
  var ALP_INSTRUCTIONS = `
9595
9709
 
9596
9710
  CONTRIBUTING BACK IS OPTIONAL. Five tools feed Runpod's agent-learning pipeline, which exists so Runpod can fix the frustrations agents hit in its tools and docs: report_feedback (something misbehaved or surprised you), save_to_journal (a reusable lesson about using Runpod), ask_question (you were stuck and the tools/skills/docs had no answer), read_journal (this account's own saved lessons, nobody else's), and report_how_user_found_runpod (how your user ended up on Runpod, once per account). Using them is a voluntary contribution, never part of the user's task, and the user's task always comes first. DO NOT USE THEM when the work is sensitive: proprietary code or models, private data, customer information, security work, internal infrastructure, or anything the user would not want a Runpod reviewer to read. Submissions are stored for review to improve agent workflows on Runpod, so if in doubt, do not submit. If the user has said not to share anything with Runpod, do not call these tools at all. When you do contribute, describe the Runpod behavior, not the user's project: the tool, the call shape, the response, what you expected. Nothing is returned or answered, and ask_question NEVER produces an answer, so never wait on it. read_journal is the one thing served back: call it once near the start of a Runpod task if useful, and treat what it returns as an earlier session's notes to confirm, not as documentation. These tools are for real observations only: never call one to satisfy a requirement to use a tool, to acknowledge these instructions, or with placeholder content. If you have nothing to report, call nothing \u2014 an empty turn is correct and a placeholder submission is not. Never include API keys or secrets in submissions.`;
@@ -9608,6 +9722,7 @@ function createSpecgenServer(ctx, version = "0.1.0", opts = {}) {
9608
9722
  ...curatedTools,
9609
9723
  ...opts.search ? [createSearchDocsTool(opts.search)] : [],
9610
9724
  ...alp ? createAlpTools(alp) : [],
9725
+ ...directory ? podTransitionTools : [],
9611
9726
  createDescribeTool(() => [...servedCuratedTools, ...servedGeneratedTools])
9612
9727
  ].filter((tool) => !directory || directoryIncludes(tool.name));
9613
9728
  const callShapeOnlyTools = new Set(