@runpod/mcp-server 4.5.0 → 4.6.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/CHANGELOG.md +17 -0
- package/README.md +4 -4
- package/dist/http.cjs +322 -62
- package/dist/http.cjs.map +1 -1
- package/dist/http.d.cts +6 -1
- package/dist/http.d.ts +6 -1
- package/dist/http.mjs +321 -62
- package/dist/http.mjs.map +1 -1
- package/dist/stdio.cjs +305 -57
- package/dist/stdio.cjs.map +1 -1
- package/dist/stdio.mjs +305 -57
- package/dist/stdio.mjs.map +1 -1
- package/package.json +2 -1
package/dist/http.mjs
CHANGED
|
@@ -414,6 +414,7 @@ var generatedTools = [
|
|
|
414
414
|
title: "Create cluster",
|
|
415
415
|
operationId: "createCluster",
|
|
416
416
|
description: "Create an instant cluster (multiple pods with high-speed interconnect). BILLABLE from creation for every pod in the cluster: it rents compute.podCount identical pods at once, each with compute.gpuCountPerPod GPUs of compute.gpuTypeId \u2014 state the hourly price for the total GPU count (podCount * gpuCountPerPod, priced from the catalog tools) and create only after the user's explicit go on that quoted shape and total hourly price. Verify GPU stock first via the catalog tools. The compute shape and type are fixed at creation; only the name can be changed later. The container configuration applies to every pod, and templateId is the only private-image path \u2014 a bare registry property is rejected. Delete with delete-cluster when finished.",
|
|
417
|
+
directoryDescription: "Create an Instant Cluster: compute.podCount identical Pods joined by a high-speed interconnect, each with compute.gpuCountPerPod GPUs of compute.gpuTypeId. Billable from creation for every Pod in the cluster, at the GPU type's hourly price times the total GPU count. The compute shape and type are fixed at creation; only the name can change later. The container configuration applies to every Pod, and templateId is the only way to use a private image; a bare registry property is rejected.",
|
|
417
418
|
method: "POST",
|
|
418
419
|
path: "/v2/clusters",
|
|
419
420
|
params: [],
|
|
@@ -429,7 +430,8 @@ var generatedTools = [
|
|
|
429
430
|
type: "object",
|
|
430
431
|
properties: {
|
|
431
432
|
body: {
|
|
432
|
-
$ref: "#/$defs/CreateClusterRequest"
|
|
433
|
+
$ref: "#/$defs/CreateClusterRequest",
|
|
434
|
+
type: "object"
|
|
433
435
|
}
|
|
434
436
|
},
|
|
435
437
|
required: ["body"],
|
|
@@ -666,7 +668,8 @@ var generatedTools = [
|
|
|
666
668
|
type: "object",
|
|
667
669
|
properties: {
|
|
668
670
|
body: {
|
|
669
|
-
$ref: "#/$defs/CreateDelegationRequest"
|
|
671
|
+
$ref: "#/$defs/CreateDelegationRequest",
|
|
672
|
+
type: "object"
|
|
670
673
|
}
|
|
671
674
|
},
|
|
672
675
|
required: ["body"],
|
|
@@ -698,6 +701,7 @@ var generatedTools = [
|
|
|
698
701
|
title: "Create endpoint",
|
|
699
702
|
operationId: "createEndpoint",
|
|
700
703
|
description: "Create a serverless endpoint. BILLABLE: state the worker's hourly price (from the catalog tools) before creating. Worker hardware is one of two choices: the gpu object (gpu.pools takes serverless pool ids from the catalog, e.g. ADA_24, never display names; gpu.count sets GPUs per worker) or the cpu array of CPU flavor configurations for a CPU endpoint. type and scaling are required and fix the request-routing model. Workers cold-start on the first job: expect minutes, poll with get-job-status wait.",
|
|
704
|
+
directoryDescription: "Create a Serverless endpoint. Billable while its workers run, at the worker's hourly price. Worker hardware is either the gpu object (gpu.pools takes Serverless pool ids such as ADA_24, and gpu.count sets GPUs per worker) or the cpu array of CPU flavor configurations. type and scaling are required and set the request-routing model. Workers cold-start on their first job, which commonly takes minutes.",
|
|
701
705
|
method: "POST",
|
|
702
706
|
path: "/v2/serverless",
|
|
703
707
|
params: [],
|
|
@@ -713,7 +717,8 @@ var generatedTools = [
|
|
|
713
717
|
type: "object",
|
|
714
718
|
properties: {
|
|
715
719
|
body: {
|
|
716
|
-
$ref: "#/$defs/CreateEndpointRequest"
|
|
720
|
+
$ref: "#/$defs/CreateEndpointRequest",
|
|
721
|
+
type: "object"
|
|
717
722
|
}
|
|
718
723
|
},
|
|
719
724
|
required: ["body"],
|
|
@@ -1158,7 +1163,8 @@ var generatedTools = [
|
|
|
1158
1163
|
type: "object",
|
|
1159
1164
|
properties: {
|
|
1160
1165
|
body: {
|
|
1161
|
-
$ref: "#/$defs/CreateGlobalVolumeRequest"
|
|
1166
|
+
$ref: "#/$defs/CreateGlobalVolumeRequest",
|
|
1167
|
+
type: "object"
|
|
1162
1168
|
}
|
|
1163
1169
|
},
|
|
1164
1170
|
required: ["body"],
|
|
@@ -1200,7 +1206,8 @@ var generatedTools = [
|
|
|
1200
1206
|
type: "object",
|
|
1201
1207
|
properties: {
|
|
1202
1208
|
body: {
|
|
1203
|
-
$ref: "#/$defs/CreateNetworkVolumeRequest"
|
|
1209
|
+
$ref: "#/$defs/CreateNetworkVolumeRequest",
|
|
1210
|
+
type: "object"
|
|
1204
1211
|
}
|
|
1205
1212
|
},
|
|
1206
1213
|
required: ["body"],
|
|
@@ -1252,6 +1259,7 @@ var generatedTools = [
|
|
|
1252
1259
|
title: "Create Pod",
|
|
1253
1260
|
operationId: "createPod",
|
|
1254
1261
|
description: 'Rent a GPU/CPU pod. BILLABLE from creation until stop/terminate: state the hourly price before creating. GPU selection is the gpu object: gpu.id takes a catalog GPU type id (e.g. "NVIDIA GeForce RTX 4090"), verified via list-gpu-types, and gpu.count sets the GPU count; cloud/data-center choice constrains stock.',
|
|
1262
|
+
directoryDescription: 'Create a GPU or CPU Pod. Billable from creation until it is stopped or terminated. GPU selection is the gpu object: gpu.id takes a GPU type id such as "NVIDIA GeForce RTX 4090", and gpu.count sets the number of GPUs. Cloud tier and data center choices limit which machines can host it.',
|
|
1255
1263
|
method: "POST",
|
|
1256
1264
|
path: "/v2/pods",
|
|
1257
1265
|
params: [],
|
|
@@ -1267,7 +1275,8 @@ var generatedTools = [
|
|
|
1267
1275
|
type: "object",
|
|
1268
1276
|
properties: {
|
|
1269
1277
|
body: {
|
|
1270
|
-
$ref: "#/$defs/CreatePodRequest"
|
|
1278
|
+
$ref: "#/$defs/CreatePodRequest",
|
|
1279
|
+
type: "object"
|
|
1271
1280
|
}
|
|
1272
1281
|
},
|
|
1273
1282
|
required: ["body"],
|
|
@@ -1634,7 +1643,8 @@ var generatedTools = [
|
|
|
1634
1643
|
type: "object",
|
|
1635
1644
|
properties: {
|
|
1636
1645
|
body: {
|
|
1637
|
-
$ref: "#/$defs/CreateRegistryRequest"
|
|
1646
|
+
$ref: "#/$defs/CreateRegistryRequest",
|
|
1647
|
+
type: "object"
|
|
1638
1648
|
}
|
|
1639
1649
|
},
|
|
1640
1650
|
required: ["body"],
|
|
@@ -1679,7 +1689,7 @@ var generatedTools = [
|
|
|
1679
1689
|
annotations: {
|
|
1680
1690
|
readOnlyHint: false,
|
|
1681
1691
|
destructiveHint: false,
|
|
1682
|
-
idempotentHint:
|
|
1692
|
+
idempotentHint: true,
|
|
1683
1693
|
openWorldHint: true
|
|
1684
1694
|
},
|
|
1685
1695
|
schemaOnDemand: true,
|
|
@@ -1687,7 +1697,8 @@ var generatedTools = [
|
|
|
1687
1697
|
type: "object",
|
|
1688
1698
|
properties: {
|
|
1689
1699
|
body: {
|
|
1690
|
-
$ref: "#/$defs/CreateSecretRequest"
|
|
1700
|
+
$ref: "#/$defs/CreateSecretRequest",
|
|
1701
|
+
type: "object"
|
|
1691
1702
|
}
|
|
1692
1703
|
},
|
|
1693
1704
|
required: ["body"],
|
|
@@ -1742,7 +1753,8 @@ var generatedTools = [
|
|
|
1742
1753
|
type: "object",
|
|
1743
1754
|
properties: {
|
|
1744
1755
|
body: {
|
|
1745
|
-
$ref: "#/$defs/CreateTemplateRequest"
|
|
1756
|
+
$ref: "#/$defs/CreateTemplateRequest",
|
|
1757
|
+
type: "object"
|
|
1746
1758
|
}
|
|
1747
1759
|
},
|
|
1748
1760
|
required: ["body"],
|
|
@@ -1929,6 +1941,7 @@ var generatedTools = [
|
|
|
1929
1941
|
title: "Delete cluster",
|
|
1930
1942
|
operationId: "deleteCluster",
|
|
1931
1943
|
description: "Delete a cluster permanently: it terminates every member pod. Verify the id with get-cluster, and list-cluster-pods for what the delete takes down, before deleting; delete only clusters your own tool calls created in this conversation, or the one the user asked you to delete by id \u2014 a name found by listing is not attribution.",
|
|
1944
|
+
directoryDescription: "Delete an Instant Cluster permanently. Every member Pod is terminated and its container disk is lost.",
|
|
1932
1945
|
method: "DELETE",
|
|
1933
1946
|
path: "/v2/clusters/{id}",
|
|
1934
1947
|
params: [
|
|
@@ -1960,6 +1973,7 @@ var generatedTools = [
|
|
|
1960
1973
|
title: "Delete endpoint",
|
|
1961
1974
|
operationId: "deleteEndpoint",
|
|
1962
1975
|
description: "Delete a serverless endpoint permanently and immediately. Verify the id belongs to the intended endpoint (get-endpoint) before deleting; delete only endpoints your own tool calls created in this conversation, or the one the user asked you to delete by id \u2014 a name found by listing is not attribution.",
|
|
1976
|
+
directoryDescription: "Delete a Serverless endpoint permanently and immediately.",
|
|
1963
1977
|
method: "DELETE",
|
|
1964
1978
|
path: "/v2/serverless/{id}",
|
|
1965
1979
|
params: [
|
|
@@ -2053,6 +2067,7 @@ var generatedTools = [
|
|
|
2053
2067
|
title: "Delete Pod",
|
|
2054
2068
|
operationId: "deletePod",
|
|
2055
2069
|
description: "Terminate a pod permanently \u2014 its container disk is lost. Distinguish from stopping (pod-action stop) which releases the GPU but keeps volume data. Verify the id with get-pod first; terminate only pods your own tool calls created in this conversation, or the one the user asked you to terminate by id \u2014 a name found by listing is not attribution.",
|
|
2070
|
+
directoryDescription: "Terminate a Pod permanently. Its container disk is lost; data on an attached network volume is kept. Stopping a Pod instead releases its compute but keeps its disk.",
|
|
2056
2071
|
method: "DELETE",
|
|
2057
2072
|
path: "/v2/pods/{id}",
|
|
2058
2073
|
params: [
|
|
@@ -2114,6 +2129,7 @@ var generatedTools = [
|
|
|
2114
2129
|
title: "Delete secret",
|
|
2115
2130
|
operationId: "deleteSecret",
|
|
2116
2131
|
description: "Delete a secret permanently. Environment variables referencing its name ({{ RUNPOD_SECRET_<name> }}) stop resolving at the next pod or worker boot; running instances keep the value they started with. Verify the id with get-secret first; delete only secrets your own tool calls created in this conversation, or the one the user asked you to delete by id \u2014 a name found by listing is not attribution.",
|
|
2132
|
+
directoryDescription: "Delete a secret permanently. Environment variables that reference it ({{ RUNPOD_SECRET_<name> }}) stop resolving at the next Pod or worker boot; running instances keep the value they started with.",
|
|
2117
2133
|
method: "DELETE",
|
|
2118
2134
|
path: "/v2/account/secrets/{id}",
|
|
2119
2135
|
params: [
|
|
@@ -2145,6 +2161,7 @@ var generatedTools = [
|
|
|
2145
2161
|
title: "Delete template",
|
|
2146
2162
|
operationId: "deleteTemplate",
|
|
2147
2163
|
description: "Delete a template permanently. Verify with get-template first; a template referenced by a live endpoint should not be deleted.",
|
|
2164
|
+
directoryDescription: "Delete a template permanently. An endpoint that references the template can stop working once it is deleted.",
|
|
2148
2165
|
method: "DELETE",
|
|
2149
2166
|
path: "/v2/templates/{id}",
|
|
2150
2167
|
params: [
|
|
@@ -2510,7 +2527,8 @@ var generatedTools = [
|
|
|
2510
2527
|
},
|
|
2511
2528
|
cloud: {
|
|
2512
2529
|
$ref: "#/$defs/GpuCloudFilter",
|
|
2513
|
-
description: "Cloud type for availability and lowest-price calculations. Valid only with include=AVAILABILITY. Supported values: SECURE, COMMUNITY. Upstream default when omitted: SECURE."
|
|
2530
|
+
description: "Cloud type for availability and lowest-price calculations. Valid only with include=AVAILABILITY. Supported values: SECURE, COMMUNITY. Upstream default when omitted: SECURE.",
|
|
2531
|
+
type: "string"
|
|
2514
2532
|
},
|
|
2515
2533
|
countryCodes: {
|
|
2516
2534
|
type: "array",
|
|
@@ -2794,7 +2812,8 @@ var generatedTools = [
|
|
|
2794
2812
|
},
|
|
2795
2813
|
bucketSize: {
|
|
2796
2814
|
$ref: "#/$defs/BillingBucketSize",
|
|
2797
|
-
description: "Length of each billing time bucket. Defaults to day."
|
|
2815
|
+
description: "Length of each billing time bucket. Defaults to day.",
|
|
2816
|
+
type: "string"
|
|
2798
2817
|
},
|
|
2799
2818
|
lastN: {
|
|
2800
2819
|
type: "integer",
|
|
@@ -2871,7 +2890,8 @@ var generatedTools = [
|
|
|
2871
2890
|
},
|
|
2872
2891
|
bucketSize: {
|
|
2873
2892
|
$ref: "#/$defs/BillingBucketSize",
|
|
2874
|
-
description: "Length of each billing time bucket. Defaults to day."
|
|
2893
|
+
description: "Length of each billing time bucket. Defaults to day.",
|
|
2894
|
+
type: "string"
|
|
2875
2895
|
},
|
|
2876
2896
|
lastN: {
|
|
2877
2897
|
type: "integer",
|
|
@@ -3237,7 +3257,8 @@ var generatedTools = [
|
|
|
3237
3257
|
},
|
|
3238
3258
|
bucketSize: {
|
|
3239
3259
|
$ref: "#/$defs/BillingBucketSize",
|
|
3240
|
-
description: "Length of each billing time bucket. Defaults to day."
|
|
3260
|
+
description: "Length of each billing time bucket. Defaults to day.",
|
|
3261
|
+
type: "string"
|
|
3241
3262
|
},
|
|
3242
3263
|
lastN: {
|
|
3243
3264
|
type: "integer",
|
|
@@ -3509,7 +3530,8 @@ var generatedTools = [
|
|
|
3509
3530
|
},
|
|
3510
3531
|
cloud: {
|
|
3511
3532
|
$ref: "#/$defs/GpuCloudFilter",
|
|
3512
|
-
description: "Cloud type for availability and lowest-price calculations. Valid only with include=AVAILABILITY. Supported values: SECURE, COMMUNITY. Upstream default when omitted: SECURE."
|
|
3533
|
+
description: "Cloud type for availability and lowest-price calculations. Valid only with include=AVAILABILITY. Supported values: SECURE, COMMUNITY. Upstream default when omitted: SECURE.",
|
|
3534
|
+
type: "string"
|
|
3513
3535
|
},
|
|
3514
3536
|
countryCodes: {
|
|
3515
3537
|
type: "array",
|
|
@@ -3603,7 +3625,8 @@ var generatedTools = [
|
|
|
3603
3625
|
},
|
|
3604
3626
|
bucketSize: {
|
|
3605
3627
|
$ref: "#/$defs/BillingBucketSize",
|
|
3606
|
-
description: "Length of each billing time bucket. Defaults to day."
|
|
3628
|
+
description: "Length of each billing time bucket. Defaults to day.",
|
|
3629
|
+
type: "string"
|
|
3607
3630
|
},
|
|
3608
3631
|
lastN: {
|
|
3609
3632
|
type: "integer",
|
|
@@ -3725,7 +3748,8 @@ var generatedTools = [
|
|
|
3725
3748
|
},
|
|
3726
3749
|
bucketSize: {
|
|
3727
3750
|
$ref: "#/$defs/BillingBucketSize",
|
|
3728
|
-
description: "Length of each billing time bucket. Defaults to day."
|
|
3751
|
+
description: "Length of each billing time bucket. Defaults to day.",
|
|
3752
|
+
type: "string"
|
|
3729
3753
|
},
|
|
3730
3754
|
lastN: {
|
|
3731
3755
|
type: "integer",
|
|
@@ -3892,6 +3916,7 @@ var generatedTools = [
|
|
|
3892
3916
|
title: "List Serverless billing",
|
|
3893
3917
|
operationId: "listServerlessBilling",
|
|
3894
3918
|
description: "Get serverless billing history, split into time buckets. SIZE WARNING: with defaults this emits one record per endpoint PER BUCKET \u2014 on an account with many endpoints the response overflows the tool-result limit and becomes unusable. Always pass lastN: 1 (or a bucketSize spanning the whole window) for one record per endpoint, and serverlessId when you need one endpoint. Distinct from pod billing, which covers standalone pods.",
|
|
3919
|
+
directoryDescription: "Get Serverless billing history, split into time buckets. By default the response has one record per endpoint per bucket, which can be very large on accounts with many endpoints; lastN: 1 (or one bucket spanning the whole window) returns one record per endpoint, and serverlessId narrows it to a single endpoint. Pod billing is reported separately.",
|
|
3895
3920
|
method: "GET",
|
|
3896
3921
|
path: "/v2/billing/serverless",
|
|
3897
3922
|
params: [
|
|
@@ -3938,7 +3963,8 @@ var generatedTools = [
|
|
|
3938
3963
|
},
|
|
3939
3964
|
bucketSize: {
|
|
3940
3965
|
$ref: "#/$defs/BillingBucketSize",
|
|
3941
|
-
description: "Length of each billing time bucket. Defaults to day."
|
|
3966
|
+
description: "Length of each billing time bucket. Defaults to day.",
|
|
3967
|
+
type: "string"
|
|
3942
3968
|
},
|
|
3943
3969
|
lastN: {
|
|
3944
3970
|
type: "integer",
|
|
@@ -3995,7 +4021,8 @@ var generatedTools = [
|
|
|
3995
4021
|
type: "string"
|
|
3996
4022
|
},
|
|
3997
4023
|
body: {
|
|
3998
|
-
$ref: "#/$defs/PodActionRequest"
|
|
4024
|
+
$ref: "#/$defs/PodActionRequest",
|
|
4025
|
+
type: "object"
|
|
3999
4026
|
}
|
|
4000
4027
|
},
|
|
4001
4028
|
required: ["id", "body"],
|
|
@@ -4065,7 +4092,7 @@ var generatedTools = [
|
|
|
4065
4092
|
annotations: {
|
|
4066
4093
|
readOnlyHint: false,
|
|
4067
4094
|
destructiveHint: false,
|
|
4068
|
-
idempotentHint:
|
|
4095
|
+
idempotentHint: true,
|
|
4069
4096
|
openWorldHint: true
|
|
4070
4097
|
},
|
|
4071
4098
|
inputSchema: {
|
|
@@ -4076,7 +4103,8 @@ var generatedTools = [
|
|
|
4076
4103
|
description: "Cluster identifier"
|
|
4077
4104
|
},
|
|
4078
4105
|
body: {
|
|
4079
|
-
$ref: "#/$defs/UpdateClusterRequest"
|
|
4106
|
+
$ref: "#/$defs/UpdateClusterRequest",
|
|
4107
|
+
type: "object"
|
|
4080
4108
|
}
|
|
4081
4109
|
},
|
|
4082
4110
|
required: ["id", "body"],
|
|
@@ -4102,6 +4130,7 @@ var generatedTools = [
|
|
|
4102
4130
|
title: "Update endpoint",
|
|
4103
4131
|
operationId: "updateEndpoint",
|
|
4104
4132
|
description: "Partially update a serverless endpoint (PATCH): only fields present in the body change, omitted ones are untouched, with one exception. DESTRUCTIVE GOTCHA: gpu.pools and gpu.excludedTypes are a single selection, so sending pools without excludedTypes clears any exclusions pinned elsewhere (the console or set-endpoint-gpus) \u2014 read the endpoint first with get-endpoint and resend excludedTypes if you still want them. An exclusion naming a type outside pools returns 400. A CUDA-only or count-only change does not need pools at all, so omit it unless you mean to replace the selection. Mutable fields: name, gpu, cpu, workers (min/max/idleTimeout), scaling (type plus queueDelay or requestCount), dataCenterIds, networkVolumes, timeout, flashboot, and the container settings (image, args, disk, ports, env, registry). cpu completely replaces a CPU endpoint's flavor selection. Compute family is immutable: gpu on a CPU endpoint, cpu on a GPU one, or both, returns 400. Effect timing differs by field \u2014 workers/scaling/timeout reach the autoscaler promptly, while container changes (image, env) cut a new release that rolls out as workers cycle, so in-flight workers keep the previous version. Track rollout with list-endpoint-releases.",
|
|
4133
|
+
directoryDescription: "Partially update a Serverless endpoint (PATCH): only fields present in the body change. gpu.pools and gpu.excludedTypes are one selection, so sending pools without excludedTypes clears existing exclusions; an exclusion naming a type outside pools returns 400, and a CUDA-only or count-only change does not need pools. Mutable fields: name, gpu, cpu, workers (min/max/idleTimeout), scaling (type plus queueDelay or requestCount), dataCenterIds, networkVolumes, timeout, flashboot, and the container settings (image, args, disk, ports, env, registry). cpu replaces a CPU endpoint's whole flavor selection. The compute family is fixed: gpu on a CPU endpoint, cpu on a GPU one, or both returns 400. Worker, scaling and timeout changes apply promptly; container changes (image, env) create a new release that rolls out as workers cycle, so in-flight workers keep the previous version.",
|
|
4105
4134
|
method: "PATCH",
|
|
4106
4135
|
path: "/v2/serverless/{id}",
|
|
4107
4136
|
params: [
|
|
@@ -4113,7 +4142,7 @@ var generatedTools = [
|
|
|
4113
4142
|
hasBody: true,
|
|
4114
4143
|
annotations: {
|
|
4115
4144
|
readOnlyHint: false,
|
|
4116
|
-
destructiveHint:
|
|
4145
|
+
destructiveHint: true,
|
|
4117
4146
|
idempotentHint: false,
|
|
4118
4147
|
openWorldHint: true
|
|
4119
4148
|
},
|
|
@@ -4126,7 +4155,8 @@ var generatedTools = [
|
|
|
4126
4155
|
description: "Serverless endpoint identifier"
|
|
4127
4156
|
},
|
|
4128
4157
|
body: {
|
|
4129
|
-
$ref: "#/$defs/UpdateEndpointRequest"
|
|
4158
|
+
$ref: "#/$defs/UpdateEndpointRequest",
|
|
4159
|
+
type: "object"
|
|
4130
4160
|
}
|
|
4131
4161
|
},
|
|
4132
4162
|
required: ["id", "body"],
|
|
@@ -4505,7 +4535,7 @@ var generatedTools = [
|
|
|
4505
4535
|
annotations: {
|
|
4506
4536
|
readOnlyHint: false,
|
|
4507
4537
|
destructiveHint: false,
|
|
4508
|
-
idempotentHint:
|
|
4538
|
+
idempotentHint: true,
|
|
4509
4539
|
openWorldHint: true
|
|
4510
4540
|
},
|
|
4511
4541
|
inputSchema: {
|
|
@@ -4516,7 +4546,8 @@ var generatedTools = [
|
|
|
4516
4546
|
description: "Global volume identifier"
|
|
4517
4547
|
},
|
|
4518
4548
|
body: {
|
|
4519
|
-
$ref: "#/$defs/UpdateGlobalVolumeRequest"
|
|
4549
|
+
$ref: "#/$defs/UpdateGlobalVolumeRequest",
|
|
4550
|
+
type: "object"
|
|
4520
4551
|
}
|
|
4521
4552
|
},
|
|
4522
4553
|
required: ["id", "body"],
|
|
@@ -4557,7 +4588,7 @@ var generatedTools = [
|
|
|
4557
4588
|
annotations: {
|
|
4558
4589
|
readOnlyHint: false,
|
|
4559
4590
|
destructiveHint: false,
|
|
4560
|
-
idempotentHint:
|
|
4591
|
+
idempotentHint: true,
|
|
4561
4592
|
openWorldHint: true
|
|
4562
4593
|
},
|
|
4563
4594
|
inputSchema: {
|
|
@@ -4568,7 +4599,8 @@ var generatedTools = [
|
|
|
4568
4599
|
description: "Network volume identifier"
|
|
4569
4600
|
},
|
|
4570
4601
|
body: {
|
|
4571
|
-
$ref: "#/$defs/UpdateNetworkVolumeRequest"
|
|
4602
|
+
$ref: "#/$defs/UpdateNetworkVolumeRequest",
|
|
4603
|
+
type: "object"
|
|
4572
4604
|
}
|
|
4573
4605
|
},
|
|
4574
4606
|
required: ["id", "body"],
|
|
@@ -4613,7 +4645,7 @@ var generatedTools = [
|
|
|
4613
4645
|
hasBody: true,
|
|
4614
4646
|
annotations: {
|
|
4615
4647
|
readOnlyHint: false,
|
|
4616
|
-
destructiveHint:
|
|
4648
|
+
destructiveHint: true,
|
|
4617
4649
|
idempotentHint: false,
|
|
4618
4650
|
openWorldHint: true
|
|
4619
4651
|
},
|
|
@@ -4626,7 +4658,8 @@ var generatedTools = [
|
|
|
4626
4658
|
description: "Pod identifier"
|
|
4627
4659
|
},
|
|
4628
4660
|
body: {
|
|
4629
|
-
$ref: "#/$defs/UpdatePodRequest"
|
|
4661
|
+
$ref: "#/$defs/UpdatePodRequest",
|
|
4662
|
+
type: "object"
|
|
4630
4663
|
}
|
|
4631
4664
|
},
|
|
4632
4665
|
required: ["id", "body"],
|
|
@@ -4855,7 +4888,7 @@ var generatedTools = [
|
|
|
4855
4888
|
hasBody: true,
|
|
4856
4889
|
annotations: {
|
|
4857
4890
|
readOnlyHint: false,
|
|
4858
|
-
destructiveHint:
|
|
4891
|
+
destructiveHint: true,
|
|
4859
4892
|
idempotentHint: false,
|
|
4860
4893
|
openWorldHint: true
|
|
4861
4894
|
},
|
|
@@ -4868,7 +4901,8 @@ var generatedTools = [
|
|
|
4868
4901
|
description: "Secret identifier"
|
|
4869
4902
|
},
|
|
4870
4903
|
body: {
|
|
4871
|
-
$ref: "#/$defs/UpdateSecretRequest"
|
|
4904
|
+
$ref: "#/$defs/UpdateSecretRequest",
|
|
4905
|
+
type: "object"
|
|
4872
4906
|
}
|
|
4873
4907
|
},
|
|
4874
4908
|
required: ["id", "body"],
|
|
@@ -4914,7 +4948,8 @@ var generatedTools = [
|
|
|
4914
4948
|
type: "object",
|
|
4915
4949
|
properties: {
|
|
4916
4950
|
body: {
|
|
4917
|
-
$ref: "#/$defs/UpdateSshKeysRequest"
|
|
4951
|
+
$ref: "#/$defs/UpdateSshKeysRequest",
|
|
4952
|
+
type: "object"
|
|
4918
4953
|
}
|
|
4919
4954
|
},
|
|
4920
4955
|
required: ["body"],
|
|
@@ -4959,7 +4994,7 @@ var generatedTools = [
|
|
|
4959
4994
|
annotations: {
|
|
4960
4995
|
readOnlyHint: false,
|
|
4961
4996
|
destructiveHint: false,
|
|
4962
|
-
idempotentHint:
|
|
4997
|
+
idempotentHint: true,
|
|
4963
4998
|
openWorldHint: true
|
|
4964
4999
|
},
|
|
4965
5000
|
schemaOnDemand: true,
|
|
@@ -4970,7 +5005,8 @@ var generatedTools = [
|
|
|
4970
5005
|
type: "string"
|
|
4971
5006
|
},
|
|
4972
5007
|
body: {
|
|
4973
|
-
$ref: "#/$defs/UpdateTemplateRequest"
|
|
5008
|
+
$ref: "#/$defs/UpdateTemplateRequest",
|
|
5009
|
+
type: "object"
|
|
4974
5010
|
}
|
|
4975
5011
|
},
|
|
4976
5012
|
required: ["id", "body"],
|
|
@@ -5139,6 +5175,146 @@ var generatedTools = [
|
|
|
5139
5175
|
}
|
|
5140
5176
|
];
|
|
5141
5177
|
|
|
5178
|
+
// src/specgen/profile.ts
|
|
5179
|
+
var DIRECTORY_PATH = "/directory";
|
|
5180
|
+
var IN = { include: true };
|
|
5181
|
+
var CREDENTIAL_INPUT = "Takes a secret or password as input; directories forbid collecting credentials.";
|
|
5182
|
+
var ALP = "Collects conversation-derived data beyond the task; the directory profile never serves it.";
|
|
5183
|
+
var DIRECTORY_TOOLS = {
|
|
5184
|
+
"cancel-job": IN,
|
|
5185
|
+
"create-cluster": IN,
|
|
5186
|
+
"create-delegation": IN,
|
|
5187
|
+
"create-endpoint": IN,
|
|
5188
|
+
"create-global-volume": IN,
|
|
5189
|
+
"create-network-volume": IN,
|
|
5190
|
+
"create-pod": IN,
|
|
5191
|
+
"create-template": IN,
|
|
5192
|
+
"delete-cluster": IN,
|
|
5193
|
+
"delete-endpoint": IN,
|
|
5194
|
+
"delete-global-volume": IN,
|
|
5195
|
+
"delete-network-volume": IN,
|
|
5196
|
+
"delete-pod": IN,
|
|
5197
|
+
"delete-registry": IN,
|
|
5198
|
+
"delete-secret": IN,
|
|
5199
|
+
"delete-template": IN,
|
|
5200
|
+
"deploy-hub-repo": IN,
|
|
5201
|
+
"endpoint-health": IN,
|
|
5202
|
+
"get-capacity": IN,
|
|
5203
|
+
"get-cluster": IN,
|
|
5204
|
+
"get-cpu-type": IN,
|
|
5205
|
+
"get-data-center": IN,
|
|
5206
|
+
"get-endpoint": IN,
|
|
5207
|
+
"get-endpoint-build": IN,
|
|
5208
|
+
"get-global-volume": IN,
|
|
5209
|
+
"get-gpu-type": IN,
|
|
5210
|
+
"get-job-status": IN,
|
|
5211
|
+
"get-network-volume": IN,
|
|
5212
|
+
"get-organization": IN,
|
|
5213
|
+
"get-pod": IN,
|
|
5214
|
+
"get-registry": IN,
|
|
5215
|
+
"get-secret": IN,
|
|
5216
|
+
"get-ssh-keys": IN,
|
|
5217
|
+
"get-template": IN,
|
|
5218
|
+
"list-billing": IN,
|
|
5219
|
+
"list-cluster-billing": IN,
|
|
5220
|
+
"list-cluster-pods": IN,
|
|
5221
|
+
"list-clusters": IN,
|
|
5222
|
+
"list-cpu-types": IN,
|
|
5223
|
+
"list-data-centers": IN,
|
|
5224
|
+
"list-delegations": IN,
|
|
5225
|
+
"list-endpoint-billing": IN,
|
|
5226
|
+
"list-endpoint-builds": IN,
|
|
5227
|
+
"list-endpoint-releases": IN,
|
|
5228
|
+
"list-endpoint-workers": IN,
|
|
5229
|
+
"list-endpoints": IN,
|
|
5230
|
+
"list-global-volumes": IN,
|
|
5231
|
+
"list-gpu-types": IN,
|
|
5232
|
+
"list-hub-repos": IN,
|
|
5233
|
+
"list-network-volume-billing": IN,
|
|
5234
|
+
"list-network-volumes": IN,
|
|
5235
|
+
"list-pod-billing": IN,
|
|
5236
|
+
"list-pods": IN,
|
|
5237
|
+
"list-public-endpoints": IN,
|
|
5238
|
+
"list-public-templates": IN,
|
|
5239
|
+
"list-registries": IN,
|
|
5240
|
+
"list-secrets": IN,
|
|
5241
|
+
"list-serverless-billing": IN,
|
|
5242
|
+
"list-templates": IN,
|
|
5243
|
+
"lookup-concept": IN,
|
|
5244
|
+
"pod-action": IN,
|
|
5245
|
+
"purge-endpoint-queue": IN,
|
|
5246
|
+
"retry-job": IN,
|
|
5247
|
+
"revoke-delegation": IN,
|
|
5248
|
+
"search-concepts": IN,
|
|
5249
|
+
"search-docs": IN,
|
|
5250
|
+
"set-endpoint-gpus": IN,
|
|
5251
|
+
"stream-job": IN,
|
|
5252
|
+
"stream-pod-logs": IN,
|
|
5253
|
+
"stream-worker-logs": IN,
|
|
5254
|
+
"update-cluster": IN,
|
|
5255
|
+
"update-endpoint": IN,
|
|
5256
|
+
"update-global-volume": IN,
|
|
5257
|
+
"update-network-volume": IN,
|
|
5258
|
+
"update-pod": IN,
|
|
5259
|
+
"update-ssh-keys": IN,
|
|
5260
|
+
"update-template": IN,
|
|
5261
|
+
"run-endpoint": { include: true, omitInputs: ["s3Config"] },
|
|
5262
|
+
"runsync-endpoint": { include: true, omitInputs: ["s3Config"] },
|
|
5263
|
+
"list-guides": {
|
|
5264
|
+
include: false,
|
|
5265
|
+
reason: "Serves playbooks that instruct the model how to behave."
|
|
5266
|
+
},
|
|
5267
|
+
"read-guide": {
|
|
5268
|
+
include: false,
|
|
5269
|
+
reason: "Serves playbooks that instruct the model how to behave."
|
|
5270
|
+
},
|
|
5271
|
+
"describe-tool": {
|
|
5272
|
+
include: false,
|
|
5273
|
+
reason: "Fetches schemas the directory already lists in full; directories reject schema fetching."
|
|
5274
|
+
},
|
|
5275
|
+
"create-secret": { include: false, reason: CREDENTIAL_INPUT },
|
|
5276
|
+
"update-secret": { include: false, reason: CREDENTIAL_INPUT },
|
|
5277
|
+
"create-registry": { include: false, reason: CREDENTIAL_INPUT },
|
|
5278
|
+
report_feedback: { include: false, reason: ALP },
|
|
5279
|
+
report_how_user_found_runpod: { include: false, reason: ALP },
|
|
5280
|
+
save_to_journal: { include: false, reason: ALP },
|
|
5281
|
+
read_journal: { include: false, reason: ALP },
|
|
5282
|
+
ask_question: { include: false, reason: ALP }
|
|
5283
|
+
};
|
|
5284
|
+
function directoryIncludes(name) {
|
|
5285
|
+
return DIRECTORY_TOOLS[name]?.include === true;
|
|
5286
|
+
}
|
|
5287
|
+
function directoryOmittedInputs(name) {
|
|
5288
|
+
const decision = DIRECTORY_TOOLS[name];
|
|
5289
|
+
return decision?.include ? decision.omitInputs ?? [] : [];
|
|
5290
|
+
}
|
|
5291
|
+
function profileForPath(pathname) {
|
|
5292
|
+
return pathname.replace(/\/+$/, "") === DIRECTORY_PATH ? "directory" : "default";
|
|
5293
|
+
}
|
|
5294
|
+
|
|
5295
|
+
// src/specgen/redact.ts
|
|
5296
|
+
var REDACTED = "[redacted]";
|
|
5297
|
+
var SECRET_KEY = /pass(word|wd)?|secret|token|api_?key|private_?key|credential|auth/i;
|
|
5298
|
+
var SECRET_REFERENCE = /^\s*\{\{\s*RUNPOD_SECRET_[^}]+\}\}\s*$/;
|
|
5299
|
+
function redactEnv(env) {
|
|
5300
|
+
return Object.fromEntries(
|
|
5301
|
+
Object.entries(env).map(([key, value]) => [
|
|
5302
|
+
key,
|
|
5303
|
+
typeof value === "string" && value !== "" && SECRET_KEY.test(key) && !SECRET_REFERENCE.test(value) ? REDACTED : value
|
|
5304
|
+
])
|
|
5305
|
+
);
|
|
5306
|
+
}
|
|
5307
|
+
function redactSecretEnv(payload) {
|
|
5308
|
+
if (Array.isArray(payload)) return payload.map(redactSecretEnv);
|
|
5309
|
+
if (!payload || typeof payload !== "object") return payload;
|
|
5310
|
+
return Object.fromEntries(
|
|
5311
|
+
Object.entries(payload).map(([key, value]) => [
|
|
5312
|
+
key,
|
|
5313
|
+
key === "env" && value && typeof value === "object" && !Array.isArray(value) ? redactEnv(value) : redactSecretEnv(value)
|
|
5314
|
+
])
|
|
5315
|
+
);
|
|
5316
|
+
}
|
|
5317
|
+
|
|
5142
5318
|
// src/specgen/pagination.ts
|
|
5143
5319
|
var DEFAULT_LIST_LIMIT = 20;
|
|
5144
5320
|
var MAX_LIST_LIMIT = 100;
|
|
@@ -5338,6 +5514,12 @@ var destructive = {
|
|
|
5338
5514
|
idempotentHint: true,
|
|
5339
5515
|
openWorldHint: true
|
|
5340
5516
|
};
|
|
5517
|
+
var destructiveWrite = {
|
|
5518
|
+
readOnlyHint: false,
|
|
5519
|
+
destructiveHint: true,
|
|
5520
|
+
idempotentHint: false,
|
|
5521
|
+
openWorldHint: true
|
|
5522
|
+
};
|
|
5341
5523
|
|
|
5342
5524
|
// src/specgen/tools/capacity.ts
|
|
5343
5525
|
var CUDA_VERSION_REGEX = /^\d{1,2}\.\d{1,2}$/;
|
|
@@ -5374,6 +5556,7 @@ function rankByStock(rows, stats, includeUnavailable) {
|
|
|
5374
5556
|
var getCapacity = {
|
|
5375
5557
|
name: "get-capacity",
|
|
5376
5558
|
title: "Get GPU capacity by CUDA version",
|
|
5559
|
+
directoryDescription: "GPU capacity across host CUDA versions, as a matrix. By default one call returns, for each GPU type, overall stock plus AVAILABLE or UNAVAILABLE per host CUDA version. With cudaVersions it checks each listed version and returns graded stock (High, Medium, Low, Out) and the lowest on-demand price per version; a check that fails transiently reports an error for that version only. Out-of-stock GPUs are included unless includeUnavailable is false. Live public catalog data, so page cursors can shift between calls.",
|
|
5377
5560
|
annotations: readOnly,
|
|
5378
5561
|
description: "GPU capacity across host CUDA versions, as a matrix. Use this to choose an endpoint's allowedCudaVersions/minCudaVersion (or diagnose/widen a capacity-starved one) and to distinguish capacity problems from compatibility problems. Default mode is one call returning, per GPU type, overall stock plus AVAILABLE/UNAVAILABLE per host-reported CUDA version. Pass cudaVersions to deep-probe instead: one stock lookup per listed version, returning graded stock (High/Medium/Low/Out) and the lowest on-demand price per version; a probe that fails transiently reports a per-version error instead of failing the call. Nothing is hidden by default \u2014 set includeUnavailable:false to drop GPUs with no stock on any listed version. Credential-free public catalog data. Stock is live, so page cursors can shift between calls.",
|
|
5379
5562
|
inputSchema: {
|
|
@@ -5576,7 +5759,9 @@ function formatGpuIds(gpu) {
|
|
|
5576
5759
|
var setEndpointGpus = {
|
|
5577
5760
|
name: "set-endpoint-gpus",
|
|
5578
5761
|
title: "Set endpoint GPUs",
|
|
5579
|
-
|
|
5762
|
+
directoryDescription: "Set which GPUs a Serverless endpoint's workers run on, including pinning specific GPU types. Takes either a raw gpuIds string, or pools plus optional excludeGpuTypeIds, from which the exclusion string is built: a pool allows every GPU type in it, and excluding all but one pins that type. Changes only GPU settings and keeps the endpoint's other settings.",
|
|
5763
|
+
// Replaces the whole GPU selection: exclusions not resent are cleared.
|
|
5764
|
+
annotations: destructive,
|
|
5580
5765
|
description: "Set which GPUs a Serverless endpoint's workers run on \u2014 including pinning specific GPU SKUs. Provide either a raw gpuIds string, or pools plus optional excludeGpuTypeIds (GPU type ids from list-gpu-types) and the exclusion string is built for you: a pool allows every SKU in it, and excluding all but one SKU pins that SKU exactly. Updates only GPU settings through REST v2, preserving other endpoint settings. create-endpoint/update-endpoint also support gpu.excludedTypes.",
|
|
5581
5766
|
inputSchema: {
|
|
5582
5767
|
type: "object",
|
|
@@ -5771,6 +5956,7 @@ function randomSuffix() {
|
|
|
5771
5956
|
var listHubRepos = {
|
|
5772
5957
|
name: "list-hub-repos",
|
|
5773
5958
|
title: "List Hub repos",
|
|
5959
|
+
directoryDescription: "List repos published to the Runpod Hub (prebuilt Serverless workers and Pod templates, such as vLLM and ComfyUI), sorted by deploy count. Public catalog; no sign-in needed. Each result includes the listed release with its hubReleaseId and image name. includeConfig: true adds each release's config (hardware requirements and environment-variable schema), which is large; repoOwner and searchTerm narrow the list.",
|
|
5774
5960
|
annotations: readOnly,
|
|
5775
5961
|
description: "List repos published to the Runpod Hub (prebuilt Serverless workers and Pod templates, e.g. vLLM, ComfyUI). Public catalog \u2014 no auth required. Each result includes the currently listed release with its hubReleaseId and prebuilt image name. Results are sorted by deploy count (most popular first). Set includeConfig:true to also return the release config (hardware requirements and environment-variable schema) \u2014 it is large, so prefer requesting it for a single repo via the repoOwner/searchTerm filters.",
|
|
5776
5962
|
inputSchema: {
|
|
@@ -5874,6 +6060,7 @@ var listHubRepos = {
|
|
|
5874
6060
|
var deployHubRepo = {
|
|
5875
6061
|
name: "deploy-hub-repo",
|
|
5876
6062
|
title: "Deploy Hub repo",
|
|
6063
|
+
directoryDescription: `Deploy a Runpod Hub repo's listed release as a new Serverless endpoint, the same as clicking Deploy on the Hub. Identifies the repo by repo ("owner/name") or hubReleaseId. The release supplies the image, container disk, CUDA constraints and environment-variable defaults; env overrides or fills in values, and keys the release requires without a default have to be supplied. GPUs come from the release config when it sets them, otherwise from gpuIds (pool names such as 'ADA_24'). Billable while the endpoint's workers run.`,
|
|
5877
6064
|
// Two sequential upstream calls: together they can outlast a client's request timeout.
|
|
5878
6065
|
holdsResponse: true,
|
|
5879
6066
|
annotations: write,
|
|
@@ -6335,6 +6522,7 @@ function validateWait(wait) {
|
|
|
6335
6522
|
var runEndpoint = {
|
|
6336
6523
|
name: "run-endpoint",
|
|
6337
6524
|
title: "Submit Serverless job",
|
|
6525
|
+
directoryDescription: "Submit an asynchronous job to a Serverless endpoint. Returns a job ID immediately; the result stays available for 30 minutes after the job completes.",
|
|
6338
6526
|
annotations: write,
|
|
6339
6527
|
description: "Submit an asynchronous job to a Serverless endpoint. Returns a job ID immediately \u2014 use get-job-status to poll for results (pass its `wait` to block through a cold start instead of tight-looping). Async results are available for 30 minutes after completion.",
|
|
6340
6528
|
inputSchema: {
|
|
@@ -6366,6 +6554,7 @@ var runEndpoint = {
|
|
|
6366
6554
|
var runsyncEndpoint = {
|
|
6367
6555
|
name: "runsync-endpoint",
|
|
6368
6556
|
title: "Run Serverless job and wait",
|
|
6557
|
+
directoryDescription: `Submit a synchronous job to a Serverless endpoint and wait up to ${HTTP_LONG_POLL_BUDGET_MS} ms for the result. If the job outlives the wait, the response carries the job ID and its current status (IN_QUEUE or IN_PROGRESS). Maximum payload 20 MB; results expire 1 minute after completion.`,
|
|
6369
6558
|
holdsResponse: true,
|
|
6370
6559
|
annotations: write,
|
|
6371
6560
|
description: "Submit a synchronous job to a Serverless endpoint and wait for the result. Best for fast tasks: if the job outlives the wait, the response returns a job ID and a non-terminal status (IN_QUEUE or IN_PROGRESS) to poll with get-job-status. Max payload 20 MB; results expire after 1 minute. The wait parameter extends the server-side wait" + (HOSTED ? ` \u2014 this server runs behind a 60-second gateway deadline, so waits clamp to ${HTTP_LONG_POLL_BUDGET_MS} ms, which is also the effective default. For longer jobs use run-endpoint + get-job-status.` : " to up to 5 minutes (300000 ms); it defaults to 90000 (90 seconds)."),
|
|
@@ -6412,6 +6601,7 @@ var runsyncEndpoint = {
|
|
|
6412
6601
|
var getJobStatus = {
|
|
6413
6602
|
name: "get-job-status",
|
|
6414
6603
|
title: "Get job status",
|
|
6604
|
+
directoryDescription: `Get the status of a Serverless job, and its output once it completes. Statuses: IN_QUEUE, IN_PROGRESS, COMPLETED, FAILED, CANCELLED, TIMED_OUT. With wait (milliseconds, up to ${HTTP_LONG_POLL_BUDGET_MS}) the server polls until the job reaches a final status or the wait runs out, in which case it returns the latest status with pollingTimedOut: true; without wait it returns the current status at once. An IN_QUEUE result includes a workerHealth summary of the endpoint's workers.`,
|
|
6415
6605
|
holdsResponse: true,
|
|
6416
6606
|
annotations: readOnly,
|
|
6417
6607
|
description: "Check the status of a Serverless job. Returns the current status and output when complete. Job statuses: IN_QUEUE, IN_PROGRESS, COMPLETED, FAILED, CANCELLED, TIMED_OUT. Pass `wait` (milliseconds, up to " + STATUS_WAIT_MAX_MS + ") to BLOCK server-side, polling until the job reaches a terminal status or the budget expires \u2014 use it to ride out a cold start (a first job on a fresh worker pulls the image and loads the model, commonly 1\u20135+ minutes) in a single call instead of returning on the first IN_QUEUE and tight-looping the tool. Without `wait` it returns the current status immediately (a single check). If the budget expires before a terminal status, it returns the latest non-terminal status with pollingTimedOut:true \u2014 call again (with `wait`) to keep blocking. IMPORTANT: a job stuck IN_QUEUE does not necessarily mean a capacity shortage \u2014 a worker may have spun up and crash-looped. When the job is IN_QUEUE this tool attaches a workerHealth summary and a hint. To dig deeper call list-endpoint-workers, then read stream-worker-logs regardless of the status a worker reports: a container failing to start loops while its worker still shows RUNNING or THROTTLED and unhealthy stays 0, so UNHEALTHY is one symptom of a crash loop and not a test for it. The logs are the authority.",
|
|
@@ -6462,8 +6652,11 @@ var getJobStatus = {
|
|
|
6462
6652
|
var streamJob = {
|
|
6463
6653
|
name: "stream-job",
|
|
6464
6654
|
title: "Stream job output",
|
|
6655
|
+
directoryDescription: `Collect streaming output from a Serverless job whose worker streams its output. Polls the job's stream until it reaches COMPLETED, FAILED, CANCELLED or TIMED_OUT, for up to ${formatBudget(HTTP_LONG_POLL_BUDGET_MS)}; if time runs out first, it returns the chunks collected so far with pollingTimedOut: true, and a later call resumes where it left off.`,
|
|
6465
6656
|
holdsResponse: true,
|
|
6466
|
-
|
|
6657
|
+
// Not a read: /stream hands out each chunk once, so a chunk collected by a
|
|
6658
|
+
// call whose response is lost cannot be fetched again.
|
|
6659
|
+
annotations: destructiveWrite,
|
|
6467
6660
|
description: `Retrieve streaming output from a Serverless job. The worker must support streaming output. Polls /stream/{jobId} and collects chunks until the status is COMPLETED, FAILED, CANCELLED, or TIMED_OUT, for up to ${formatBudget(STREAM_BUDGET_MS)}. If the budget expires first, returns the chunks collected so far with pollingTimedOut: true \u2014 call stream-job again to resume where it left off, or get-job-status to check without streaming.`,
|
|
6468
6661
|
inputSchema: {
|
|
6469
6662
|
type: "object",
|
|
@@ -6521,7 +6714,8 @@ var cancelJob = {
|
|
|
6521
6714
|
var retryJob = {
|
|
6522
6715
|
name: "retry-job",
|
|
6523
6716
|
title: "Retry job",
|
|
6524
|
-
|
|
6717
|
+
// Removes the previous output before requeueing.
|
|
6718
|
+
annotations: destructiveWrite,
|
|
6525
6719
|
description: "Retry a failed or timed-out Serverless job. Only works for jobs with FAILED or TIMED_OUT status. The previous output is removed and the job is requeued.",
|
|
6526
6720
|
inputSchema: {
|
|
6527
6721
|
type: "object",
|
|
@@ -6547,6 +6741,7 @@ var retryJob = {
|
|
|
6547
6741
|
var endpointHealth = {
|
|
6548
6742
|
name: "endpoint-health",
|
|
6549
6743
|
title: "Get endpoint health",
|
|
6744
|
+
directoryDescription: "Get the health rollup for a Serverless endpoint: worker counts by state and job queue statistics. The rollup can lag the per-worker state, and a worker whose container keeps failing to start can still report RUNNING or THROTTLED here. Zero workers means the endpoint is waiting for GPU capacity.",
|
|
6550
6745
|
annotations: readOnly,
|
|
6551
6746
|
description: "Get the endpoint-level health rollup for a Serverless endpoint: worker counts by state plus job queue statistics. This is the runtime plane's own /health view and it can lag or disagree with the per-worker truth \u2014 when a job is stuck IN_QUEUE, prefer list-endpoint-workers over this rollup for per-worker state \u2014 but treat neither as the authority on crash loops, because a container failing to start loops while its worker reports RUNNING or THROTTLED and unhealthy stays 0; stream-worker-logs is what settles it, and note that get-job-status already attaches that worker summary and a hint on every IN_QUEUE result. Zero workers here means the endpoint is waiting for GPU capacity.",
|
|
6552
6747
|
inputSchema: {
|
|
@@ -6568,6 +6763,7 @@ var endpointHealth = {
|
|
|
6568
6763
|
var purgeEndpointQueue = {
|
|
6569
6764
|
name: "purge-endpoint-queue",
|
|
6570
6765
|
title: "Purge endpoint queue",
|
|
6766
|
+
directoryDescription: "Remove all queued jobs from a Serverless endpoint. Jobs already in progress keep running.",
|
|
6571
6767
|
annotations: destructive,
|
|
6572
6768
|
description: "Remove all pending jobs from a Serverless endpoint queue. Only affects queued jobs \u2014 in-progress jobs continue running. Use this for error recovery or clearing outdated requests.",
|
|
6573
6769
|
inputSchema: {
|
|
@@ -6605,6 +6801,7 @@ var jobTools = [
|
|
|
6605
6801
|
var listEndpoints = {
|
|
6606
6802
|
name: "list-endpoints",
|
|
6607
6803
|
title: "List endpoints",
|
|
6804
|
+
directoryDescription: "List the Serverless endpoints the account owns, trimmed to id, name, image, compute config, worker counts, scaling and data centers; environment variables and request URLs are left out. Returns one page at a time; cursor=nextCursor returns the next page.",
|
|
6608
6805
|
annotations: readOnly,
|
|
6609
6806
|
description: "List serverless endpoints owned by the account (trimmed: id, name, image, compute config, worker counts, scaling, data centers per endpoint \u2014 env vars and request URLs are omitted; use get-endpoint for the full object). Returns a page; pass cursor=nextCursor for more.",
|
|
6610
6807
|
inputSchema: {
|
|
@@ -6651,6 +6848,7 @@ var listEndpoints = {
|
|
|
6651
6848
|
var listTemplates = {
|
|
6652
6849
|
name: "list-templates",
|
|
6653
6850
|
title: "List templates",
|
|
6851
|
+
directoryDescription: "List the templates visible to the account, with id, name, image and Serverless flag for each. Returns 20 templates per page by default; pagination.nextCursor returns the next page, and a template missing from one page can be on a later one.",
|
|
6654
6852
|
annotations: readOnly,
|
|
6655
6853
|
description: "List templates visible to the account. Returns id, name, image, and serverless flag per template; use get-template for full detail. Returns 20 templates per page by default. To find a template, follow `pagination.nextCursor` until `hasNextPage` is false: a name missing from one page may be on a later one.",
|
|
6656
6854
|
inputSchema: {
|
|
@@ -8134,6 +8332,7 @@ var streamPodLogs = {
|
|
|
8134
8332
|
var streamWorkerLogs = {
|
|
8135
8333
|
name: "stream-worker-logs",
|
|
8136
8334
|
title: "Stream worker logs",
|
|
8335
|
+
directoryDescription: "Read a bounded snapshot of a Serverless worker's logs (container, system, or both). Holds the live stream open for maxWaitMs and returns the parsed log lines; truncated: true means the byte cap cut the output. A worker whose container keeps failing to start can report RUNNING or THROTTLED while its logs show the failure.",
|
|
8137
8336
|
holdsResponse: true,
|
|
8138
8337
|
annotations: readOnly,
|
|
8139
8338
|
description: "Read a bounded snapshot of a Serverless worker's logs (container and/or system source). Holds the live stream open for maxWaitMs and returns the parsed log lines; `truncated: true` means the byte cap cut the output. Get worker IDs from list-endpoint-workers. Use this whenever a job stays IN_QUEUE while workers exist, whatever status they report \u2014 a crash-looping container often still shows RUNNING or THROTTLED with unhealthy 0, so these logs, not the worker status, are what identify a crash loop.",
|
|
@@ -8177,6 +8376,7 @@ function parseMetadata(metadata) {
|
|
|
8177
8376
|
var listPublicEndpoints = {
|
|
8178
8377
|
name: "list-public-endpoints",
|
|
8179
8378
|
title: "List public endpoints",
|
|
8379
|
+
directoryDescription: "List Runpod Public Endpoints: managed, pay-per-use model APIs (text, image, video, audio) that need no deployment. Public catalog; no sign-in needed. Each result includes its endpointId, model name, modality, owner and pricing. Only live endpoints are listed unless includeOffline is true.",
|
|
8180
8380
|
annotations: readOnly,
|
|
8181
8381
|
description: "List Runpod Public Endpoints \u2014 managed, pay-per-use model APIs (text, image, video, audio) that require no deployment. Public catalog, no auth required. Each result includes the endpointId to call with run-endpoint/runsync-endpoint (or via https://api.runpod.ai/v2/{endpointId}), the model name, modality, owner, and pricing. Only live endpoints are returned by default; set includeOffline:true to also list ones that are not currently live.",
|
|
8182
8382
|
inputSchema: {
|
|
@@ -8477,6 +8677,7 @@ var readGuide = {
|
|
|
8477
8677
|
var lookupConcept = {
|
|
8478
8678
|
name: "lookup-concept",
|
|
8479
8679
|
title: "Look up a concept",
|
|
8680
|
+
directoryDescription: "Look up one Runpod concept (Pod, network volume, machine, worker, template and so on) by id, name or alias; case, plurals and small typos are tolerated, and matched_as shows the key used when the match was not exact. Returns its summary, fields, states, relations and rules, each rule with its public source, plus the concepts that point at it. Answers exact questions such as whether a volume disk is tied to one machine.",
|
|
8480
8681
|
annotations: bundledRead,
|
|
8481
8682
|
recordedArguments: ["concept"],
|
|
8482
8683
|
description: 'Look up one Runpod concept (pod, network volume, machine, worker, template, \u2026) by id, name or alias; case, plurals and small typos are tolerated, and `matched_as` shows the key used when the match was not exact. Returns its summary, fields, states, relations and rules, each rule with the public source it comes from, the concepts that point at it, and the linked guides: examples (golden paths that use it, with their mcp level) and docs (skills and reference docs that explain it). Use it for exact facts, for example "is a volume disk tied to one machine" or "what happens to a stopped pod\'s GPU".',
|
|
@@ -8531,6 +8732,7 @@ var lookupConcept = {
|
|
|
8531
8732
|
var searchConcepts = {
|
|
8532
8733
|
name: "search-concepts",
|
|
8533
8734
|
title: "Search concepts",
|
|
8735
|
+
directoryDescription: 'Search the rules of the Runpod concept graph by words, for example "restart stopped pod no gpu" or "network volume data center". Returns the best-matching rules with their concept and public evidence.',
|
|
8534
8736
|
annotations: bundledRead,
|
|
8535
8737
|
recordedArguments: ["query", "limit"],
|
|
8536
8738
|
description: 'Search the rules of the Runpod concept graph by words, for example "restart stopped pod no gpu" or "network volume data center". Returns the best-matching rules with their concept and public evidence. Follow up with lookup-concept for the full concept.',
|
|
@@ -8621,9 +8823,21 @@ function listedAnnotations(annotations) {
|
|
|
8621
8823
|
const { idempotentHint, ...listed } = annotations;
|
|
8622
8824
|
return idempotentHint ? annotations : listed;
|
|
8623
8825
|
}
|
|
8624
|
-
function listTool(tool) {
|
|
8625
|
-
const { name, title,
|
|
8626
|
-
const annotations = listedAnnotations(tool.annotations);
|
|
8826
|
+
function listTool(tool, profile = "default") {
|
|
8827
|
+
const { name, title, inputSchema } = tool;
|
|
8828
|
+
const annotations = { title, ...listedAnnotations(tool.annotations) };
|
|
8829
|
+
if (profile === "directory")
|
|
8830
|
+
return {
|
|
8831
|
+
name,
|
|
8832
|
+
title,
|
|
8833
|
+
description: withApiReference(
|
|
8834
|
+
tool.directoryDescription ?? tool.description,
|
|
8835
|
+
inputSchema
|
|
8836
|
+
),
|
|
8837
|
+
inputSchema: withoutInputs(inputSchema, directoryOmittedInputs(name)),
|
|
8838
|
+
annotations
|
|
8839
|
+
};
|
|
8840
|
+
const { description } = tool;
|
|
8627
8841
|
if (!tool.schemaOnDemand)
|
|
8628
8842
|
return { name, title, description, inputSchema, annotations };
|
|
8629
8843
|
return {
|
|
@@ -8634,6 +8848,21 @@ function listTool(tool) {
|
|
|
8634
8848
|
annotations
|
|
8635
8849
|
};
|
|
8636
8850
|
}
|
|
8851
|
+
var DIRECTORY_API_REFERENCE = "Calls the Runpod REST API v2: https://docs.runpod.io/api-reference-v2/overview";
|
|
8852
|
+
function withApiReference(description, schema) {
|
|
8853
|
+
const properties = schema.properties ?? {};
|
|
8854
|
+
if (!("body" in properties)) return description;
|
|
8855
|
+
const trimmed = description.replace(/\s*$/, "");
|
|
8856
|
+
const sentence = /[.!?]$/.test(trimmed) ? trimmed : `${trimmed}.`;
|
|
8857
|
+
return `${sentence} ${DIRECTORY_API_REFERENCE}`;
|
|
8858
|
+
}
|
|
8859
|
+
function withoutInputs(schema, omit) {
|
|
8860
|
+
if (!omit.length) return schema;
|
|
8861
|
+
const properties = { ...schema.properties ?? {} };
|
|
8862
|
+
for (const key of omit) delete properties[key];
|
|
8863
|
+
const required = Array.isArray(schema.required) ? schema.required.filter((key) => !omit.includes(key)) : schema.required;
|
|
8864
|
+
return { ...schema, properties, ...required ? { required } : {} };
|
|
8865
|
+
}
|
|
8637
8866
|
function callShape(schema) {
|
|
8638
8867
|
const defs = schema.$defs ?? {};
|
|
8639
8868
|
const resolve = (node) => {
|
|
@@ -8735,7 +8964,7 @@ function words2(name) {
|
|
|
8735
8964
|
|
|
8736
8965
|
// src/server.ts
|
|
8737
8966
|
var SERVER_NAME = "Runpod API Server";
|
|
8738
|
-
var SERVER_VERSION = true ? "4.
|
|
8967
|
+
var SERVER_VERSION = true ? "4.6.0" : "dev";
|
|
8739
8968
|
|
|
8740
8969
|
// src/specgen/analytics.ts
|
|
8741
8970
|
import { createHmac } from "crypto";
|
|
@@ -9255,6 +9484,7 @@ function createSearchDocsTool(search) {
|
|
|
9255
9484
|
return {
|
|
9256
9485
|
name: "search-docs",
|
|
9257
9486
|
title: "Search docs",
|
|
9487
|
+
directoryDescription: 'Search Runpod documentation, curated support answers, the Runpod blog and runpod.io for passages that answer a question, for example "how do I attach a network volume to a Serverless endpoint". Returns ranked passages with their source URLs. Covers how-to and product questions, not account or resource state.',
|
|
9258
9488
|
annotations: readOnly,
|
|
9259
9489
|
recordedArguments: ["limit"],
|
|
9260
9490
|
description: 'Search Runpod documentation, curated support knowledge, the Runpod blog and runpod.io for passages that answer a question, for example "how do I attach a network volume to a Serverless endpoint". Returns ranked passages with their source URLs. Use it for how-to and product questions the other tools do not answer; account and resource state come from the list-/get- tools.',
|
|
@@ -9339,6 +9569,7 @@ PLAYBOOKS \u2014 READ BEFORE ACTING. Each Runpod task has a journey playbook car
|
|
|
9339
9569
|
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.
|
|
9340
9570
|
|
|
9341
9571
|
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.`;
|
|
9572
|
+
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.`;
|
|
9342
9573
|
var ALP_INSTRUCTIONS = `
|
|
9343
9574
|
|
|
9344
9575
|
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.`;
|
|
@@ -9348,43 +9579,50 @@ ONE QUESTION FOR YOU, ONCE PER ACCOUNT. If you already know how your user came t
|
|
|
9348
9579
|
function createSpecgenServer(ctx, version = "0.1.0", opts = {}) {
|
|
9349
9580
|
const rateLimiter = opts.rateLimiter ?? noopRateLimiter;
|
|
9350
9581
|
const caller = callerId(ctx.apiKey);
|
|
9582
|
+
const profile = opts.profile ?? "default";
|
|
9583
|
+
const directory = profile === "directory";
|
|
9584
|
+
const alp = directory ? void 0 : opts.alp;
|
|
9585
|
+
const servedGeneratedTools = directory ? generatedTools.filter((tool) => directoryIncludes(tool.name)) : generatedTools;
|
|
9351
9586
|
const servedCuratedTools = [
|
|
9352
9587
|
...curatedTools,
|
|
9353
9588
|
...opts.search ? [createSearchDocsTool(opts.search)] : [],
|
|
9354
|
-
...
|
|
9355
|
-
createDescribeTool(() => [...servedCuratedTools, ...
|
|
9356
|
-
];
|
|
9589
|
+
...alp ? createAlpTools(alp) : [],
|
|
9590
|
+
createDescribeTool(() => [...servedCuratedTools, ...servedGeneratedTools])
|
|
9591
|
+
].filter((tool) => !directory || directoryIncludes(tool.name));
|
|
9357
9592
|
const callShapeOnlyTools = new Set(
|
|
9358
|
-
[...servedCuratedTools, ...
|
|
9593
|
+
directory ? [] : [...servedCuratedTools, ...servedGeneratedTools].filter((tool) => tool.schemaOnDemand).map((tool) => tool.name)
|
|
9359
9594
|
);
|
|
9360
9595
|
const server = new Server(
|
|
9361
9596
|
{ name: SERVER_NAME, version: `${version} [specgen]` },
|
|
9362
9597
|
{
|
|
9363
9598
|
capabilities: { tools: {}, resources: {} },
|
|
9364
|
-
instructions:
|
|
9599
|
+
instructions: directory ? DIRECTORY_INSTRUCTIONS : alp ? SERVER_INSTRUCTIONS + ALP_INSTRUCTIONS + (opts.promptReferral === false ? "" : REFERRAL_INSTRUCTIONS) : SERVER_INSTRUCTIONS
|
|
9365
9600
|
}
|
|
9366
9601
|
);
|
|
9367
9602
|
server.oninitialized = () => {
|
|
9368
9603
|
const clientInfo = server.getClientVersion();
|
|
9369
9604
|
if (clientInfo?.name) {
|
|
9370
9605
|
ctx.setClientInfo?.(clientInfo.name, clientInfo.version);
|
|
9371
|
-
if (
|
|
9372
|
-
|
|
9373
|
-
|
|
9606
|
+
if (alp) {
|
|
9607
|
+
alp.harness = clientInfo.version ? `${clientInfo.name}/${clientInfo.version}` : clientInfo.name;
|
|
9608
|
+
alp.harnessSource = "client_info";
|
|
9374
9609
|
}
|
|
9375
9610
|
}
|
|
9376
9611
|
};
|
|
9377
9612
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
9378
|
-
tools: [...servedCuratedTools, ...
|
|
9613
|
+
tools: [...servedCuratedTools, ...servedGeneratedTools].map(
|
|
9614
|
+
(tool) => listTool(tool, profile)
|
|
9615
|
+
)
|
|
9379
9616
|
}));
|
|
9617
|
+
const servedGuides = directory ? [] : guideResources;
|
|
9380
9618
|
server.setRequestHandler(ListResourcesRequestSchema, async () => ({
|
|
9381
|
-
resources:
|
|
9619
|
+
resources: servedGuides.map(({ text: _text, ...resource }) => resource)
|
|
9382
9620
|
}));
|
|
9383
9621
|
server.setRequestHandler(ListResourceTemplatesRequestSchema, async () => ({
|
|
9384
9622
|
resourceTemplates: []
|
|
9385
9623
|
}));
|
|
9386
9624
|
server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
|
|
9387
|
-
const guide =
|
|
9625
|
+
const guide = servedGuides.find(
|
|
9388
9626
|
(candidate) => candidate.uri === request.params.uri
|
|
9389
9627
|
);
|
|
9390
9628
|
if (opts.analytics) {
|
|
@@ -9444,7 +9682,14 @@ function createSpecgenServer(ctx, version = "0.1.0", opts = {}) {
|
|
|
9444
9682
|
const curated = servedCuratedTools.find(
|
|
9445
9683
|
(tool) => tool.name === request.params.name
|
|
9446
9684
|
);
|
|
9447
|
-
const
|
|
9685
|
+
const omitted = directory ? directoryOmittedInputs(request.params.name).filter((key) => key in args) : [];
|
|
9686
|
+
const rejected = omitted.length ? {
|
|
9687
|
+
ok: false,
|
|
9688
|
+
status: 400,
|
|
9689
|
+
payload: {
|
|
9690
|
+
error: `Not accepted on this server: ${omitted.join(", ")}.`
|
|
9691
|
+
}
|
|
9692
|
+
} : curated && !curated.lenientArguments ? validateArguments(
|
|
9448
9693
|
curated.inputSchema,
|
|
9449
9694
|
args
|
|
9450
9695
|
) : null;
|
|
@@ -9464,21 +9709,28 @@ function createSpecgenServer(ctx, version = "0.1.0", opts = {}) {
|
|
|
9464
9709
|
ok: result.ok,
|
|
9465
9710
|
status: result.status,
|
|
9466
9711
|
durationMs: Date.now() - startedAt,
|
|
9467
|
-
|
|
9468
|
-
|
|
9712
|
+
// The directory profile records which tool ran, never what was asked.
|
|
9713
|
+
...directory ? {} : {
|
|
9714
|
+
args: recordedArgumentValues(curated?.recordedArguments, args),
|
|
9715
|
+
guideKind: curated?.recordedGuideKind?.(args)
|
|
9716
|
+
},
|
|
9469
9717
|
...opts.analytics
|
|
9470
9718
|
});
|
|
9471
9719
|
}
|
|
9472
9720
|
opts.onToolResult?.(request.params.name, result.status);
|
|
9473
9721
|
if (!result.ok && result.status === 401) opts.onUnauthorized?.();
|
|
9474
|
-
const payload =
|
|
9722
|
+
const payload = redactSecretEnv(
|
|
9723
|
+
result.ok ? result.payload : withRecoveryHint(result, callShapeOnlyTools.has(request.params.name))
|
|
9724
|
+
);
|
|
9475
9725
|
return {
|
|
9476
9726
|
content: [{ type: "text", text: JSON.stringify(payload, null, 2) }],
|
|
9477
9727
|
isError: !result.ok
|
|
9478
9728
|
};
|
|
9479
9729
|
});
|
|
9480
9730
|
async function dispatchTool(name, args) {
|
|
9481
|
-
const tool =
|
|
9731
|
+
const tool = servedGeneratedTools.find(
|
|
9732
|
+
(candidate) => candidate.name === name
|
|
9733
|
+
);
|
|
9482
9734
|
if (!tool)
|
|
9483
9735
|
return {
|
|
9484
9736
|
ok: false,
|
|
@@ -9905,6 +10157,9 @@ function getBaseUrl(req) {
|
|
|
9905
10157
|
}
|
|
9906
10158
|
return `${proto}://${host}`;
|
|
9907
10159
|
}
|
|
10160
|
+
function requestProfile(req) {
|
|
10161
|
+
return profileForPath(new URL(req.url ?? "/", "http://localhost").pathname);
|
|
10162
|
+
}
|
|
9908
10163
|
function writeUnauthorized(req, res, error, invalidToken = false) {
|
|
9909
10164
|
const challenge = [
|
|
9910
10165
|
'Bearer realm="mcp"',
|
|
@@ -9912,9 +10167,9 @@ function writeUnauthorized(req, res, error, invalidToken = false) {
|
|
|
9912
10167
|
'error="invalid_token"',
|
|
9913
10168
|
'error_description="The credential was rejected; re-authenticate."'
|
|
9914
10169
|
] : [],
|
|
9915
|
-
|
|
9916
|
-
|
|
9917
|
-
)}/.well-known/oauth-protected-resource"`
|
|
10170
|
+
// RFC 9728: a resource served under a path advertises its metadata at the
|
|
10171
|
+
// well-known URI with that path appended.
|
|
10172
|
+
`resource_metadata="${getBaseUrl(req)}/.well-known/oauth-protected-resource${requestProfile(req) === "directory" ? DIRECTORY_PATH : ""}"`
|
|
9918
10173
|
].join(", ");
|
|
9919
10174
|
res.writeHead(401, {
|
|
9920
10175
|
"Content-Type": "application/json",
|
|
@@ -10151,8 +10406,10 @@ async function handleMcpRequest(req, res, opts = {}) {
|
|
|
10151
10406
|
const alpConfigured = Boolean(
|
|
10152
10407
|
process.env.ALP_SINK_URL && process.env.ALP_SINK_SECRET
|
|
10153
10408
|
);
|
|
10409
|
+
const profile = requestProfile(req);
|
|
10410
|
+
const alpServed = alpConfigured && profile === "default";
|
|
10154
10411
|
let promptReferral = true;
|
|
10155
|
-
if (
|
|
10412
|
+
if (alpServed && accountId && messages.some(isInitialize)) {
|
|
10156
10413
|
const answered = await (opts.hasAnswered ?? hasAnswered)(
|
|
10157
10414
|
accountId,
|
|
10158
10415
|
"referral"
|
|
@@ -10189,7 +10446,8 @@ async function handleMcpRequest(req, res, opts = {}) {
|
|
|
10189
10446
|
// store submissions (the sink is configured). The ingest endpoint is
|
|
10190
10447
|
// this deployment's own /api/alp/submit — one write path, both
|
|
10191
10448
|
// transports (docs/agent-learning-protocol.md).
|
|
10192
|
-
|
|
10449
|
+
profile,
|
|
10450
|
+
...alpServed ? {
|
|
10193
10451
|
alp: {
|
|
10194
10452
|
ingestUrl: `${getBaseUrl(req)}/api/alp/submit`,
|
|
10195
10453
|
transport: "http",
|
|
@@ -10237,6 +10495,7 @@ export {
|
|
|
10237
10495
|
parseMcpMessages,
|
|
10238
10496
|
prefersJsonResponse,
|
|
10239
10497
|
requestLogSampleRate,
|
|
10498
|
+
requestProfile,
|
|
10240
10499
|
summarizeRpc
|
|
10241
10500
|
};
|
|
10242
10501
|
//# sourceMappingURL=http.mjs.map
|