portkey-admin-mcp 0.11.1 → 0.11.3
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/build/index.js +732 -668
- package/build/server.js +732 -668
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -124,6 +124,9 @@ async function parseErrorResponse(response) {
|
|
|
124
124
|
// src/services/base.service.ts
|
|
125
125
|
var DEFAULT_BASE_URL = "https://api.portkey.ai/v1";
|
|
126
126
|
var DEFAULT_PUBLIC_BASE_URL = "https://api.portkey.ai";
|
|
127
|
+
function toV2BaseUrl(baseUrl) {
|
|
128
|
+
return baseUrl.replace(/\/v1$/, "/v2");
|
|
129
|
+
}
|
|
127
130
|
var MISSING_API_KEY_PLACEHOLDER = "__PORTKEY_API_KEY_NOT_CONFIGURED__";
|
|
128
131
|
var PRIVATE_BASE_URL_OVERRIDE_HINT = "Set PORTKEY_ALLOW_PRIVATE_BASE_URL=true to allow self-hosted gateways on loopback or private networks.";
|
|
129
132
|
var INSECURE_HTTP_OVERRIDE_HINT = "Set PORTKEY_ALLOW_INSECURE_HTTP=true only for a trusted self-hosted gateway when TLS is unavailable.";
|
|
@@ -248,6 +251,7 @@ function isNoContent(value) {
|
|
|
248
251
|
var BaseService = class {
|
|
249
252
|
apiKey;
|
|
250
253
|
baseUrl;
|
|
254
|
+
v2BaseUrl;
|
|
251
255
|
timeout = 3e4;
|
|
252
256
|
constructor(apiKeyOverride, baseUrlOverride) {
|
|
253
257
|
const apiKey = apiKeyOverride ?? process.env.PORTKEY_API_KEY;
|
|
@@ -258,6 +262,7 @@ var BaseService = class {
|
|
|
258
262
|
const baseUrl = baseUrlOverride ?? process.env.PORTKEY_BASE_URL ?? DEFAULT_BASE_URL;
|
|
259
263
|
validateUrl(baseUrl);
|
|
260
264
|
this.baseUrl = baseUrl.replace(/\/+$/, "");
|
|
265
|
+
this.v2BaseUrl = toV2BaseUrl(this.baseUrl);
|
|
261
266
|
}
|
|
262
267
|
encodePathSegment(value) {
|
|
263
268
|
return encodeURIComponent(value);
|
|
@@ -368,11 +373,38 @@ var BaseService = class {
|
|
|
368
373
|
})
|
|
369
374
|
);
|
|
370
375
|
}
|
|
376
|
+
/** Read a `/v2`-only admin endpoint. See {@link toV2BaseUrl}. */
|
|
377
|
+
async getV2(path, params) {
|
|
378
|
+
return this.rejectNoContent(
|
|
379
|
+
await this.executeRequest("GET", path, {
|
|
380
|
+
params,
|
|
381
|
+
baseUrl: this.v2BaseUrl
|
|
382
|
+
})
|
|
383
|
+
);
|
|
384
|
+
}
|
|
371
385
|
async post(path, body) {
|
|
372
386
|
return this.rejectNoContent(
|
|
373
387
|
await this.executeRequest("POST", path, { body })
|
|
374
388
|
);
|
|
375
389
|
}
|
|
390
|
+
/** Write to a `/v2`-only admin endpoint. See {@link toV2BaseUrl}. */
|
|
391
|
+
async postV2(path, body) {
|
|
392
|
+
return this.rejectNoContent(
|
|
393
|
+
await this.executeRequest("POST", path, {
|
|
394
|
+
body,
|
|
395
|
+
baseUrl: this.v2BaseUrl
|
|
396
|
+
})
|
|
397
|
+
);
|
|
398
|
+
}
|
|
399
|
+
/** Update a `/v2`-only admin endpoint. See {@link toV2BaseUrl}. */
|
|
400
|
+
async putV2(path, body) {
|
|
401
|
+
return this.rejectNoContent(
|
|
402
|
+
await this.executeRequest("PUT", path, {
|
|
403
|
+
body,
|
|
404
|
+
baseUrl: this.v2BaseUrl
|
|
405
|
+
})
|
|
406
|
+
);
|
|
407
|
+
}
|
|
376
408
|
async put(path, body) {
|
|
377
409
|
return this.rejectNoContent(
|
|
378
410
|
await this.executeRequest("PUT", path, { body })
|
|
@@ -389,6 +421,14 @@ var BaseService = class {
|
|
|
389
421
|
allowNoContent: true
|
|
390
422
|
});
|
|
391
423
|
}
|
|
424
|
+
/** Delete on a `/v2`-only admin endpoint. See {@link toV2BaseUrl}. */
|
|
425
|
+
async deleteV2(path, params) {
|
|
426
|
+
return this.executeRequest("DELETE", path, {
|
|
427
|
+
params,
|
|
428
|
+
allowNoContent: true,
|
|
429
|
+
baseUrl: this.v2BaseUrl
|
|
430
|
+
});
|
|
431
|
+
}
|
|
392
432
|
};
|
|
393
433
|
|
|
394
434
|
// src/services/analytics.service.ts
|
|
@@ -682,28 +722,28 @@ var ConfigsService = class extends BaseService {
|
|
|
682
722
|
// src/services/deployments.service.ts
|
|
683
723
|
var DeploymentsService = class extends BaseService {
|
|
684
724
|
async listDeployments(params) {
|
|
685
|
-
return this.
|
|
725
|
+
return this.getV2("/deployments", params);
|
|
686
726
|
}
|
|
687
727
|
async registerDeployment(data) {
|
|
688
|
-
return this.
|
|
728
|
+
return this.postV2("/deployments", data);
|
|
689
729
|
}
|
|
690
730
|
async getDeployment(id, organisation_id) {
|
|
691
731
|
if (!id.trim()) throw new Error("Deployment ID is required");
|
|
692
|
-
return this.
|
|
732
|
+
return this.getV2(
|
|
693
733
|
`/deployments/${this.encodePathSegment(id)}`,
|
|
694
734
|
{ organisation_id }
|
|
695
735
|
);
|
|
696
736
|
}
|
|
697
737
|
async updateDeployment(id, data) {
|
|
698
738
|
if (!id.trim()) throw new Error("Deployment ID is required");
|
|
699
|
-
return this.
|
|
739
|
+
return this.putV2(
|
|
700
740
|
`/deployments/${this.encodePathSegment(id)}`,
|
|
701
741
|
data
|
|
702
742
|
);
|
|
703
743
|
}
|
|
704
744
|
async archiveDeployment(id) {
|
|
705
745
|
if (!id.trim()) throw new Error("Deployment ID is required");
|
|
706
|
-
const result = await this.
|
|
746
|
+
const result = await this.deleteV2(
|
|
707
747
|
`/deployments/${this.encodePathSegment(id)}`
|
|
708
748
|
);
|
|
709
749
|
return isNoContent(result) ? {} : result;
|
|
@@ -714,13 +754,13 @@ var DeploymentsService = class extends BaseService {
|
|
|
714
754
|
var GuardrailsService = class extends BaseService {
|
|
715
755
|
/** Get the organisation-wide input and output guardrail defaults. */
|
|
716
756
|
async getOrganisationDefaults() {
|
|
717
|
-
return this.
|
|
757
|
+
return this.getV2(
|
|
718
758
|
"/admin/organisation/defaults"
|
|
719
759
|
);
|
|
720
760
|
}
|
|
721
761
|
/** Replace either or both organisation-wide guardrail default lists. */
|
|
722
762
|
async updateOrganisationDefaults(data) {
|
|
723
|
-
return this.
|
|
763
|
+
return this.putV2(
|
|
724
764
|
"/admin/organisation/defaults",
|
|
725
765
|
data
|
|
726
766
|
);
|
|
@@ -1467,7 +1507,7 @@ var PromptsService = class extends BaseService {
|
|
|
1467
1507
|
}
|
|
1468
1508
|
async findPromptByExactName(name, collectionId) {
|
|
1469
1509
|
const pageSize = 100;
|
|
1470
|
-
let currentPage =
|
|
1510
|
+
let currentPage = 0;
|
|
1471
1511
|
while (true) {
|
|
1472
1512
|
const page = await this.listPrompts({
|
|
1473
1513
|
collection_id: collectionId,
|
|
@@ -1481,7 +1521,7 @@ var PromptsService = class extends BaseService {
|
|
|
1481
1521
|
if (exact) {
|
|
1482
1522
|
return exact;
|
|
1483
1523
|
}
|
|
1484
|
-
if (page.data.length === 0 || currentPage * pageSize >= page.total) {
|
|
1524
|
+
if (page.data.length === 0 || (currentPage + 1) * pageSize >= page.total) {
|
|
1485
1525
|
return void 0;
|
|
1486
1526
|
}
|
|
1487
1527
|
currentPage += 1;
|
|
@@ -1900,7 +1940,7 @@ var WorkspacesService = class extends BaseService {
|
|
|
1900
1940
|
return { success: true };
|
|
1901
1941
|
}
|
|
1902
1942
|
async listScimGroups(params) {
|
|
1903
|
-
return this.
|
|
1943
|
+
return this.getV2("/scim/groups", params);
|
|
1904
1944
|
}
|
|
1905
1945
|
async listWorkspaces(params) {
|
|
1906
1946
|
return this.get("/admin/workspaces", params);
|
|
@@ -2105,7 +2145,81 @@ var CreateSecretReferenceResponseSchema = z.object({
|
|
|
2105
2145
|
});
|
|
2106
2146
|
|
|
2107
2147
|
// src/tools/analytics.tools.ts
|
|
2148
|
+
import { z as z3 } from "zod";
|
|
2149
|
+
|
|
2150
|
+
// src/lib/schemas.ts
|
|
2108
2151
|
import { z as z2 } from "zod";
|
|
2152
|
+
var PromptFunctionSchema = z2.object({
|
|
2153
|
+
name: z2.string().describe("Function name"),
|
|
2154
|
+
description: z2.string().optional().describe("Function description"),
|
|
2155
|
+
parameters: z2.record(z2.string(), z2.unknown()).optional().describe("Function parameters schema")
|
|
2156
|
+
});
|
|
2157
|
+
var PromptToolSchema = z2.object({
|
|
2158
|
+
type: z2.literal("function").describe("Tool type"),
|
|
2159
|
+
function: PromptFunctionSchema.describe("Function definition")
|
|
2160
|
+
});
|
|
2161
|
+
var HyperparametersSchema = z2.object({
|
|
2162
|
+
max_tokens: z2.coerce.number().positive().optional().describe("Maximum tokens to generate"),
|
|
2163
|
+
temperature: z2.coerce.number().min(0).max(2).optional().describe("Sampling temperature (0-2)"),
|
|
2164
|
+
top_p: z2.coerce.number().min(0).max(1).optional().describe("Top-p sampling (0-1)"),
|
|
2165
|
+
top_k: z2.coerce.number().positive().optional().describe("Top-k sampling"),
|
|
2166
|
+
presence_penalty: z2.coerce.number().min(-2).max(2).optional().describe("Presence penalty (-2 to 2)"),
|
|
2167
|
+
frequency_penalty: z2.coerce.number().min(-2).max(2).optional().describe("Frequency penalty (-2 to 2)"),
|
|
2168
|
+
stop: z2.array(z2.string()).optional().describe("Stop sequences")
|
|
2169
|
+
});
|
|
2170
|
+
var PromptAppIdentifierSchema = z2.string().min(1).describe(
|
|
2171
|
+
"App identifier (REQUIRED). Use your deployed app name, for example 'hourlink' or 'support-console'."
|
|
2172
|
+
);
|
|
2173
|
+
var PromptEnvironmentIdentifierSchema = z2.string().min(1).describe(
|
|
2174
|
+
"Environment identifier (REQUIRED). Use your environment name, for example 'dev', 'staging', 'prod', or 'qa'."
|
|
2175
|
+
);
|
|
2176
|
+
var BillingMetadataSchema = z2.object({
|
|
2177
|
+
client_id: z2.string().describe("Client ID for billing attribution (REQUIRED)"),
|
|
2178
|
+
app: PromptAppIdentifierSchema,
|
|
2179
|
+
env: PromptEnvironmentIdentifierSchema,
|
|
2180
|
+
project_id: z2.string().optional().describe("Project ID for granular billing"),
|
|
2181
|
+
feature: z2.string().optional().describe("Feature name for tracking")
|
|
2182
|
+
});
|
|
2183
|
+
var ToolChoiceSchema = z2.object({
|
|
2184
|
+
mode: z2.enum(["auto", "none", "function"]).describe(
|
|
2185
|
+
"Tool choice mode: auto lets the model decide, none disables tool use, function forces one function by name"
|
|
2186
|
+
),
|
|
2187
|
+
function_name: z2.string().optional().describe("Required when mode is 'function'; ignored otherwise")
|
|
2188
|
+
}).superRefine((value, ctx) => {
|
|
2189
|
+
if (value.mode === "function" && !value.function_name) {
|
|
2190
|
+
ctx.addIssue({
|
|
2191
|
+
code: z2.ZodIssueCode.custom,
|
|
2192
|
+
path: ["function_name"],
|
|
2193
|
+
message: "function_name is required when mode is 'function'"
|
|
2194
|
+
});
|
|
2195
|
+
}
|
|
2196
|
+
if (value.mode !== "function" && value.function_name !== void 0) {
|
|
2197
|
+
ctx.addIssue({
|
|
2198
|
+
code: z2.ZodIssueCode.custom,
|
|
2199
|
+
path: ["function_name"],
|
|
2200
|
+
message: "function_name is only allowed when mode is 'function'"
|
|
2201
|
+
});
|
|
2202
|
+
}
|
|
2203
|
+
});
|
|
2204
|
+
function toPromptToolChoice(toolChoice) {
|
|
2205
|
+
if (!toolChoice) {
|
|
2206
|
+
return void 0;
|
|
2207
|
+
}
|
|
2208
|
+
if (toolChoice.mode === "function") {
|
|
2209
|
+
return {
|
|
2210
|
+
type: "function",
|
|
2211
|
+
function: {
|
|
2212
|
+
name: toolChoice.function_name
|
|
2213
|
+
}
|
|
2214
|
+
};
|
|
2215
|
+
}
|
|
2216
|
+
return toolChoice.mode;
|
|
2217
|
+
}
|
|
2218
|
+
var CurrentPageSchema = z2.coerce.number().int().nonnegative().optional().describe("Zero-based page number; the first page is 0");
|
|
2219
|
+
function pageSizeSchema(max = 100) {
|
|
2220
|
+
return z2.coerce.number().int().positive().max(max).optional().describe(`Results per page (max ${max})`);
|
|
2221
|
+
}
|
|
2222
|
+
var PageSizeSchema = pageSizeSchema();
|
|
2109
2223
|
|
|
2110
2224
|
// src/tools/utils.ts
|
|
2111
2225
|
function formatFullName(firstName, lastName) {
|
|
@@ -2121,42 +2235,42 @@ function jsonResult(data) {
|
|
|
2121
2235
|
|
|
2122
2236
|
// src/tools/analytics.tools.ts
|
|
2123
2237
|
var baseAnalyticsSchema = {
|
|
2124
|
-
time_of_generation_min:
|
|
2238
|
+
time_of_generation_min: z3.string().describe(
|
|
2125
2239
|
"Start time for the analytics period (ISO8601 format, e.g., '2024-01-01T00:00:00Z')"
|
|
2126
2240
|
),
|
|
2127
|
-
time_of_generation_max:
|
|
2241
|
+
time_of_generation_max: z3.string().describe(
|
|
2128
2242
|
"End time for the analytics period (ISO8601 format, e.g., '2024-02-01T00:00:00Z')"
|
|
2129
2243
|
),
|
|
2130
|
-
total_units_min:
|
|
2131
|
-
total_units_max:
|
|
2132
|
-
cost_min:
|
|
2133
|
-
cost_max:
|
|
2134
|
-
prompt_token_min:
|
|
2135
|
-
prompt_token_max:
|
|
2136
|
-
completion_token_min:
|
|
2137
|
-
completion_token_max:
|
|
2138
|
-
status_code:
|
|
2244
|
+
total_units_min: z3.coerce.number().nonnegative().optional().describe("Minimum number of total tokens to filter by"),
|
|
2245
|
+
total_units_max: z3.coerce.number().nonnegative().optional().describe("Maximum number of total tokens to filter by"),
|
|
2246
|
+
cost_min: z3.coerce.number().nonnegative().optional().describe("Minimum cost in cents to filter by"),
|
|
2247
|
+
cost_max: z3.coerce.number().nonnegative().optional().describe("Maximum cost in cents to filter by"),
|
|
2248
|
+
prompt_token_min: z3.coerce.number().nonnegative().optional().describe("Minimum number of prompt tokens"),
|
|
2249
|
+
prompt_token_max: z3.coerce.number().nonnegative().optional().describe("Maximum number of prompt tokens"),
|
|
2250
|
+
completion_token_min: z3.coerce.number().nonnegative().optional().describe("Minimum number of completion tokens"),
|
|
2251
|
+
completion_token_max: z3.coerce.number().nonnegative().optional().describe("Maximum number of completion tokens"),
|
|
2252
|
+
status_code: z3.string().optional().describe(
|
|
2139
2253
|
"Legacy Portkey query param for HTTP status codes. Comma-separated string; prefer status_codes for structured inputs."
|
|
2140
2254
|
),
|
|
2141
|
-
weighted_feedback_min:
|
|
2142
|
-
weighted_feedback_max:
|
|
2143
|
-
virtual_keys:
|
|
2255
|
+
weighted_feedback_min: z3.coerce.number().min(-10).max(10).optional().describe("Minimum weighted feedback score (-10 to 10)"),
|
|
2256
|
+
weighted_feedback_max: z3.coerce.number().min(-10).max(10).optional().describe("Maximum weighted feedback score (-10 to 10)"),
|
|
2257
|
+
virtual_keys: z3.string().optional().describe(
|
|
2144
2258
|
"Legacy Portkey query param for virtual key slugs. Comma-separated string; prefer virtual_key_slugs for structured inputs."
|
|
2145
2259
|
),
|
|
2146
|
-
configs:
|
|
2260
|
+
configs: z3.string().optional().describe(
|
|
2147
2261
|
"Legacy Portkey query param for config slugs. Comma-separated string; prefer config_slugs for structured inputs."
|
|
2148
2262
|
),
|
|
2149
|
-
status_codes:
|
|
2263
|
+
status_codes: z3.array(z3.string()).optional().describe(
|
|
2150
2264
|
"Structured alias for status_code. Use an array of HTTP status codes; normalized to the legacy comma-separated Portkey query param."
|
|
2151
2265
|
),
|
|
2152
|
-
virtual_key_slugs:
|
|
2266
|
+
virtual_key_slugs: z3.array(z3.string()).optional().describe(
|
|
2153
2267
|
"Structured alias for virtual_keys. Use an array of virtual key slugs; normalized to the legacy comma-separated Portkey query param."
|
|
2154
2268
|
),
|
|
2155
|
-
config_slugs:
|
|
2269
|
+
config_slugs: z3.array(z3.string()).optional().describe(
|
|
2156
2270
|
"Structured alias for configs. Use an array of config slugs; normalized to the legacy comma-separated Portkey query param."
|
|
2157
2271
|
),
|
|
2158
|
-
workspace_slug:
|
|
2159
|
-
api_key_ids:
|
|
2272
|
+
workspace_slug: z3.string().optional().describe("Filter by specific workspace"),
|
|
2273
|
+
api_key_ids: z3.preprocess((value) => {
|
|
2160
2274
|
if (value == null) {
|
|
2161
2275
|
return value;
|
|
2162
2276
|
}
|
|
@@ -2164,45 +2278,45 @@ var baseAnalyticsSchema = {
|
|
|
2164
2278
|
return value.map((item) => String(item)).join(",");
|
|
2165
2279
|
}
|
|
2166
2280
|
return value;
|
|
2167
|
-
},
|
|
2281
|
+
}, z3.string().optional()).describe(
|
|
2168
2282
|
"Legacy Portkey query param for API key UUIDs. Comma-separated string; request_analytics also accepts an array and normalizes it to this form."
|
|
2169
2283
|
),
|
|
2170
|
-
metadata:
|
|
2284
|
+
metadata: z3.string().optional().describe(
|
|
2171
2285
|
`Legacy Portkey query param for metadata filtering. Stringified JSON object, e.g. '{"env":"prod","app":"myapp"}'; prefer metadata_filter for structured inputs.`
|
|
2172
2286
|
),
|
|
2173
|
-
ai_org_model:
|
|
2287
|
+
ai_org_model: z3.string().optional().describe(
|
|
2174
2288
|
"Legacy Portkey query param for provider/model pairs. Format: 'provider__model' with double underscore, e.g. 'openai__gpt-4' or 'anthropic__claude-3-opus'. Comma-separated string; prefer provider_models for structured inputs."
|
|
2175
2289
|
),
|
|
2176
|
-
provider_models:
|
|
2290
|
+
provider_models: z3.array(z3.string()).optional().describe(
|
|
2177
2291
|
"Structured alias for ai_org_model. Use provider__model strings in an array; normalized to the legacy comma-separated Portkey query param."
|
|
2178
2292
|
),
|
|
2179
|
-
trace_id:
|
|
2293
|
+
trace_id: z3.string().optional().describe(
|
|
2180
2294
|
"Legacy Portkey query param for trace IDs. Comma-separated string; prefer trace_ids for structured inputs."
|
|
2181
2295
|
),
|
|
2182
|
-
trace_ids:
|
|
2296
|
+
trace_ids: z3.array(z3.string()).optional().describe(
|
|
2183
2297
|
"Structured alias for trace_id. Use an array of trace IDs; normalized to the legacy comma-separated Portkey query param."
|
|
2184
2298
|
),
|
|
2185
|
-
span_id:
|
|
2299
|
+
span_id: z3.string().optional().describe(
|
|
2186
2300
|
"Legacy Portkey query param for span IDs. Comma-separated string; prefer span_ids for structured inputs."
|
|
2187
2301
|
),
|
|
2188
|
-
span_ids:
|
|
2302
|
+
span_ids: z3.array(z3.string()).optional().describe(
|
|
2189
2303
|
"Structured alias for span_id. Use an array of span IDs; normalized to the legacy comma-separated Portkey query param."
|
|
2190
2304
|
),
|
|
2191
|
-
metadata_filter:
|
|
2305
|
+
metadata_filter: z3.record(z3.string(), z3.unknown()).optional().describe(
|
|
2192
2306
|
"Structured alias for metadata. Use an object such as { env: 'prod' }; normalized to a JSON string before the request is sent."
|
|
2193
2307
|
),
|
|
2194
|
-
prompt_slug:
|
|
2308
|
+
prompt_slug: z3.string().optional().describe("Filter by prompt slug")
|
|
2195
2309
|
};
|
|
2196
2310
|
var paginatedAnalyticsSchema = {
|
|
2197
2311
|
...baseAnalyticsSchema,
|
|
2198
|
-
current_page:
|
|
2199
|
-
page_size:
|
|
2312
|
+
current_page: CurrentPageSchema,
|
|
2313
|
+
page_size: PageSizeSchema
|
|
2200
2314
|
};
|
|
2201
2315
|
var cacheSummarySchema = {
|
|
2202
2316
|
...baseAnalyticsSchema,
|
|
2203
|
-
workspace_slug:
|
|
2317
|
+
workspace_slug: z3.string().min(1).describe("Workspace slug to analyze")
|
|
2204
2318
|
};
|
|
2205
|
-
var providerMetricSchema =
|
|
2319
|
+
var providerMetricSchema = z3.enum([
|
|
2206
2320
|
"requests",
|
|
2207
2321
|
"cost",
|
|
2208
2322
|
"total_tokens",
|
|
@@ -2220,16 +2334,16 @@ var providerMetricSchema = z2.enum([
|
|
|
2220
2334
|
]);
|
|
2221
2335
|
var providerGroupAnalyticsSchema = {
|
|
2222
2336
|
...cacheSummarySchema,
|
|
2223
|
-
current_page:
|
|
2224
|
-
page_size:
|
|
2225
|
-
order_by:
|
|
2226
|
-
order_by_type:
|
|
2227
|
-
columns:
|
|
2228
|
-
include_total:
|
|
2337
|
+
current_page: CurrentPageSchema.describe("Zero-based result page"),
|
|
2338
|
+
page_size: PageSizeSchema.describe("Number of provider groups per page"),
|
|
2339
|
+
order_by: z3.string().optional().describe("Metric or field used to order groups"),
|
|
2340
|
+
order_by_type: z3.string().optional().describe("Sort direction accepted by Portkey, such as asc or desc"),
|
|
2341
|
+
columns: z3.array(providerMetricSchema).optional().describe("Provider metrics to include in each grouped row"),
|
|
2342
|
+
include_total: z3.boolean().optional().describe("Request the total provider-group count")
|
|
2229
2343
|
};
|
|
2230
2344
|
var analyticsGroupMetadataSchema = {
|
|
2231
2345
|
...paginatedAnalyticsSchema,
|
|
2232
|
-
metadata_key:
|
|
2346
|
+
metadata_key: z3.string().describe("The metadata key to group by (e.g., 'env', 'app', 'client_id')")
|
|
2233
2347
|
};
|
|
2234
2348
|
function formatGraphAnalytics(summary, dataPoints) {
|
|
2235
2349
|
return {
|
|
@@ -2665,26 +2779,26 @@ function registerAnalyticsTools(server, service) {
|
|
|
2665
2779
|
}
|
|
2666
2780
|
|
|
2667
2781
|
// src/tools/audit.tools.ts
|
|
2668
|
-
import { z as
|
|
2782
|
+
import { z as z4 } from "zod";
|
|
2669
2783
|
var AUDIT_TOOL_SCHEMAS = {
|
|
2670
2784
|
listAuditLogs: {
|
|
2671
|
-
workspace_id:
|
|
2672
|
-
actor_id:
|
|
2673
|
-
action:
|
|
2785
|
+
workspace_id: z4.string().optional().describe("Filter audit logs by workspace ID"),
|
|
2786
|
+
actor_id: z4.string().optional().describe("Filter by the user ID who performed the action"),
|
|
2787
|
+
action: z4.string().optional().describe(
|
|
2674
2788
|
"Filter by action type (e.g., 'create', 'update', 'delete', 'login')"
|
|
2675
2789
|
),
|
|
2676
|
-
resource_type:
|
|
2790
|
+
resource_type: z4.string().optional().describe(
|
|
2677
2791
|
"Filter by resource type (e.g., 'user', 'workspace', 'config', 'virtual_key')"
|
|
2678
2792
|
),
|
|
2679
|
-
resource_id:
|
|
2680
|
-
start_time:
|
|
2793
|
+
resource_id: z4.string().optional().describe("Filter by specific resource ID"),
|
|
2794
|
+
start_time: z4.string().optional().describe(
|
|
2681
2795
|
"Start of time range filter (ISO 8601 format, e.g., '2024-01-01T00:00:00Z')"
|
|
2682
2796
|
),
|
|
2683
|
-
end_time:
|
|
2797
|
+
end_time: z4.string().optional().describe(
|
|
2684
2798
|
"End of time range filter (ISO 8601 format, e.g., '2024-01-31T23:59:59Z')"
|
|
2685
2799
|
),
|
|
2686
|
-
current_page:
|
|
2687
|
-
page_size:
|
|
2800
|
+
current_page: CurrentPageSchema,
|
|
2801
|
+
page_size: PageSizeSchema.describe("Number of results per page (max 100)")
|
|
2688
2802
|
}
|
|
2689
2803
|
};
|
|
2690
2804
|
function registerAuditTools(server, service) {
|
|
@@ -2730,30 +2844,30 @@ function registerAuditTools(server, service) {
|
|
|
2730
2844
|
}
|
|
2731
2845
|
|
|
2732
2846
|
// src/tools/collections.tools.ts
|
|
2733
|
-
import { z as
|
|
2847
|
+
import { z as z5 } from "zod";
|
|
2734
2848
|
var COLLECTIONS_TOOL_SCHEMAS = {
|
|
2735
2849
|
listCollections: {
|
|
2736
|
-
workspace_id:
|
|
2737
|
-
search:
|
|
2738
|
-
current_page:
|
|
2739
|
-
page_size:
|
|
2850
|
+
workspace_id: z5.string().optional().describe("Filter by workspace ID"),
|
|
2851
|
+
search: z5.string().optional().describe("Search collections by name"),
|
|
2852
|
+
current_page: CurrentPageSchema,
|
|
2853
|
+
page_size: PageSizeSchema
|
|
2740
2854
|
},
|
|
2741
2855
|
createCollection: {
|
|
2742
|
-
name:
|
|
2856
|
+
name: z5.string().describe(
|
|
2743
2857
|
"Collection name (e.g., 'hourlink', 'apizone', 'research-pilot')"
|
|
2744
2858
|
),
|
|
2745
|
-
workspace_id:
|
|
2859
|
+
workspace_id: z5.string().optional().describe("Workspace ID to create collection in")
|
|
2746
2860
|
},
|
|
2747
2861
|
getCollection: {
|
|
2748
|
-
collection_id:
|
|
2862
|
+
collection_id: z5.string().describe("Collection ID or slug to retrieve")
|
|
2749
2863
|
},
|
|
2750
2864
|
updateCollection: {
|
|
2751
|
-
collection_id:
|
|
2752
|
-
name:
|
|
2753
|
-
description:
|
|
2865
|
+
collection_id: z5.string().describe("Collection ID to update"),
|
|
2866
|
+
name: z5.string().optional().describe("New name for the collection"),
|
|
2867
|
+
description: z5.string().optional().describe("New description for the collection")
|
|
2754
2868
|
},
|
|
2755
2869
|
deleteCollection: {
|
|
2756
|
-
collection_id:
|
|
2870
|
+
collection_id: z5.string().describe("Collection ID to delete")
|
|
2757
2871
|
}
|
|
2758
2872
|
};
|
|
2759
2873
|
function registerCollectionsTools(server, service) {
|
|
@@ -2839,58 +2953,58 @@ function registerCollectionsTools(server, service) {
|
|
|
2839
2953
|
}
|
|
2840
2954
|
|
|
2841
2955
|
// src/tools/configs.tools.ts
|
|
2842
|
-
import { z as
|
|
2843
|
-
var configTargetSchema =
|
|
2844
|
-
provider:
|
|
2845
|
-
virtual_key:
|
|
2956
|
+
import { z as z6 } from "zod";
|
|
2957
|
+
var configTargetSchema = z6.object({
|
|
2958
|
+
provider: z6.string().optional().describe("Provider slug to route requests to"),
|
|
2959
|
+
virtual_key: z6.string().optional().describe("Virtual key slug to use for this routing target")
|
|
2846
2960
|
}).refine((target) => target.provider || target.virtual_key, {
|
|
2847
2961
|
message: "Each target must have at least provider or virtual_key"
|
|
2848
2962
|
});
|
|
2849
2963
|
var CONFIGS_TOOL_SCHEMAS = {
|
|
2850
2964
|
listConfigs: {
|
|
2851
|
-
current_page:
|
|
2852
|
-
page_size:
|
|
2965
|
+
current_page: CurrentPageSchema,
|
|
2966
|
+
page_size: PageSizeSchema.describe("Number of results per page (max 100)")
|
|
2853
2967
|
},
|
|
2854
2968
|
getConfig: {
|
|
2855
|
-
slug:
|
|
2969
|
+
slug: z6.string().describe(
|
|
2856
2970
|
"The unique identifier (slug) of the configuration to retrieve. This can be found in the configuration's URL or from the list_configs tool response"
|
|
2857
2971
|
)
|
|
2858
2972
|
},
|
|
2859
2973
|
createConfig: {
|
|
2860
|
-
name:
|
|
2861
|
-
workspace_id:
|
|
2862
|
-
cache_mode:
|
|
2863
|
-
cache_max_age:
|
|
2864
|
-
retry_attempts:
|
|
2865
|
-
retry_on_status_codes:
|
|
2866
|
-
strategy_mode:
|
|
2867
|
-
targets:
|
|
2974
|
+
name: z6.string().describe("Name for the new configuration"),
|
|
2975
|
+
workspace_id: z6.string().optional().describe("Workspace ID to create config in"),
|
|
2976
|
+
cache_mode: z6.enum(["simple", "semantic"]).optional().describe("Cache mode: 'simple' or 'semantic'"),
|
|
2977
|
+
cache_max_age: z6.coerce.number().positive().optional().describe("Cache max age in seconds"),
|
|
2978
|
+
retry_attempts: z6.coerce.number().positive().max(5).optional().describe("Number of retry attempts (1-5)"),
|
|
2979
|
+
retry_on_status_codes: z6.array(z6.coerce.number()).optional().describe("HTTP status codes to retry on (e.g., [429, 500, 502, 503])"),
|
|
2980
|
+
strategy_mode: z6.enum(["loadbalance", "fallback"]).optional().describe("Routing strategy: 'loadbalance' or 'fallback'"),
|
|
2981
|
+
targets: z6.array(configTargetSchema).optional().describe("Array of target providers with virtual keys")
|
|
2868
2982
|
},
|
|
2869
2983
|
updateConfig: {
|
|
2870
|
-
slug:
|
|
2871
|
-
name:
|
|
2872
|
-
status:
|
|
2873
|
-
cache_mode:
|
|
2874
|
-
cache_max_age:
|
|
2875
|
-
retry_attempts:
|
|
2876
|
-
retry_on_status_codes:
|
|
2877
|
-
strategy_mode:
|
|
2878
|
-
targets:
|
|
2984
|
+
slug: z6.string().describe("Configuration slug to update"),
|
|
2985
|
+
name: z6.string().optional().describe("New name for the configuration"),
|
|
2986
|
+
status: z6.enum(["active", "inactive"]).optional().describe("Configuration status"),
|
|
2987
|
+
cache_mode: z6.enum(["simple", "semantic"]).optional().describe("Cache mode: 'simple' or 'semantic'"),
|
|
2988
|
+
cache_max_age: z6.coerce.number().positive().optional().describe("Cache max age in seconds"),
|
|
2989
|
+
retry_attempts: z6.coerce.number().positive().max(5).optional().describe("Number of retry attempts (1-5)"),
|
|
2990
|
+
retry_on_status_codes: z6.array(z6.coerce.number()).optional().describe("HTTP status codes to retry on"),
|
|
2991
|
+
strategy_mode: z6.enum(["loadbalance", "fallback"]).optional().describe("Routing strategy"),
|
|
2992
|
+
targets: z6.array(configTargetSchema).optional().describe("Array of target providers")
|
|
2879
2993
|
},
|
|
2880
2994
|
deleteConfig: {
|
|
2881
|
-
slug:
|
|
2995
|
+
slug: z6.string().describe("Configuration slug to delete")
|
|
2882
2996
|
},
|
|
2883
2997
|
listConfigVersions: {
|
|
2884
|
-
slug:
|
|
2998
|
+
slug: z6.string().describe("Configuration slug to list versions for")
|
|
2885
2999
|
}
|
|
2886
3000
|
};
|
|
2887
|
-
var configPayloadSchema =
|
|
2888
|
-
cache_mode:
|
|
2889
|
-
cache_max_age:
|
|
2890
|
-
retry_attempts:
|
|
2891
|
-
retry_on_status_codes:
|
|
2892
|
-
strategy_mode:
|
|
2893
|
-
targets:
|
|
3001
|
+
var configPayloadSchema = z6.object({
|
|
3002
|
+
cache_mode: z6.enum(["simple", "semantic"]).optional(),
|
|
3003
|
+
cache_max_age: z6.coerce.number().positive().optional(),
|
|
3004
|
+
retry_attempts: z6.coerce.number().positive().max(5).optional(),
|
|
3005
|
+
retry_on_status_codes: z6.array(z6.coerce.number()).optional(),
|
|
3006
|
+
strategy_mode: z6.enum(["loadbalance", "fallback"]).optional(),
|
|
3007
|
+
targets: z6.array(configTargetSchema).optional()
|
|
2894
3008
|
});
|
|
2895
3009
|
function buildConfigPayload(params) {
|
|
2896
3010
|
const cache = params.cache_mode !== void 0 || params.cache_max_age !== void 0 ? {
|
|
@@ -2911,10 +3025,10 @@ function buildConfigPayload(params) {
|
|
|
2911
3025
|
function hasConfigSettings(config) {
|
|
2912
3026
|
return config.cache !== void 0 || config.retry !== void 0 || config.strategy !== void 0 || config.targets !== void 0;
|
|
2913
3027
|
}
|
|
2914
|
-
var createConfigSchema =
|
|
3028
|
+
var createConfigSchema = z6.object(CONFIGS_TOOL_SCHEMAS.createConfig).superRefine((value, ctx) => {
|
|
2915
3029
|
if (!hasConfigSettings(buildConfigPayload(value))) {
|
|
2916
3030
|
ctx.addIssue({
|
|
2917
|
-
code:
|
|
3031
|
+
code: z6.ZodIssueCode.custom,
|
|
2918
3032
|
message: "At least one config setting (cache_mode, retry_attempts, strategy_mode, or targets) must be provided"
|
|
2919
3033
|
});
|
|
2920
3034
|
}
|
|
@@ -3059,56 +3173,56 @@ function registerConfigsTools(server, service) {
|
|
|
3059
3173
|
}
|
|
3060
3174
|
|
|
3061
3175
|
// src/tools/deployments.tools.ts
|
|
3062
|
-
import { z as
|
|
3063
|
-
var binaryFlagSchema =
|
|
3064
|
-
var deploymentTypeSchema =
|
|
3065
|
-
var deploymentStatusSchema =
|
|
3176
|
+
import { z as z7 } from "zod";
|
|
3177
|
+
var binaryFlagSchema = z7.union([z7.literal(0), z7.literal(1)]);
|
|
3178
|
+
var deploymentTypeSchema = z7.enum(["production", "non_production"]);
|
|
3179
|
+
var deploymentStatusSchema = z7.enum(["active", "archived"]);
|
|
3066
3180
|
var authSettingsSchema = {
|
|
3067
|
-
gateway_base_url:
|
|
3068
|
-
mcp_gateway_base_url:
|
|
3181
|
+
gateway_base_url: z7.url().optional().describe("Self-hosted Gateway base URL"),
|
|
3182
|
+
mcp_gateway_base_url: z7.url().optional().describe("MCP Gateway base URL"),
|
|
3069
3183
|
is_dataservice_hosted: binaryFlagSchema.optional().describe("Whether the deployment hosts its own data service"),
|
|
3070
3184
|
is_playground_proxy_allowed: binaryFlagSchema.optional().describe("Whether Playground proxy traffic is allowed"),
|
|
3071
|
-
workspaces_allowed:
|
|
3072
|
-
jwt_subs_allowed:
|
|
3073
|
-
jwt_sub_workspace_mapping:
|
|
3185
|
+
workspaces_allowed: z7.array(z7.string()).optional().describe("Workspace slugs this deployment may serve; empty allows all"),
|
|
3186
|
+
jwt_subs_allowed: z7.array(z7.string()).optional().describe("JWT subject values allowed to use the deployment"),
|
|
3187
|
+
jwt_sub_workspace_mapping: z7.record(z7.string(), z7.string()).optional().describe("JWT subject to workspace-slug mapping")
|
|
3074
3188
|
};
|
|
3075
3189
|
var DEPLOYMENTS_TOOL_SCHEMAS = {
|
|
3076
3190
|
listDeployments: {
|
|
3077
|
-
organisation_id:
|
|
3191
|
+
organisation_id: z7.string().optional().describe("Filter by organisation UUID"),
|
|
3078
3192
|
status: deploymentStatusSchema.optional().describe("Filter by deployment status"),
|
|
3079
3193
|
type: deploymentTypeSchema.optional().describe("Filter by deployment type"),
|
|
3080
|
-
workspace_slug:
|
|
3081
|
-
search:
|
|
3194
|
+
workspace_slug: z7.array(z7.string()).optional().describe("Filter by one or more workspace slugs"),
|
|
3195
|
+
search: z7.string().optional().describe("Search deployment names")
|
|
3082
3196
|
},
|
|
3083
3197
|
registerDeployment: {
|
|
3084
|
-
name:
|
|
3085
|
-
organisation_id:
|
|
3086
|
-
slug:
|
|
3198
|
+
name: z7.string().min(1).describe("Deployment display name"),
|
|
3199
|
+
organisation_id: z7.string().optional().describe("Owning organisation UUID"),
|
|
3200
|
+
slug: z7.string().min(1).max(50).optional().describe("Optional deployment slug"),
|
|
3087
3201
|
type: deploymentTypeSchema.optional().describe("Production or non-production deployment type"),
|
|
3088
|
-
deployment_config:
|
|
3089
|
-
is_default:
|
|
3202
|
+
deployment_config: z7.record(z7.string(), z7.unknown()).optional().describe("Gateway deployment configuration"),
|
|
3203
|
+
is_default: z7.boolean().optional().describe("Make this the default deployment"),
|
|
3090
3204
|
...authSettingsSchema
|
|
3091
3205
|
},
|
|
3092
3206
|
getDeployment: {
|
|
3093
|
-
id:
|
|
3094
|
-
organisation_id:
|
|
3207
|
+
id: z7.string().min(1).describe("Deployment UUID or self"),
|
|
3208
|
+
organisation_id: z7.string().optional().describe("Organisation UUID scope")
|
|
3095
3209
|
},
|
|
3096
3210
|
updateDeployment: {
|
|
3097
|
-
id:
|
|
3098
|
-
name:
|
|
3211
|
+
id: z7.string().min(1).describe("Deployment UUID"),
|
|
3212
|
+
name: z7.string().optional().describe("Replacement display name"),
|
|
3099
3213
|
type: deploymentTypeSchema.optional().describe("Replacement deployment type"),
|
|
3100
3214
|
status: deploymentStatusSchema.optional().describe("Replacement deployment status"),
|
|
3101
|
-
deployment_config:
|
|
3102
|
-
is_default:
|
|
3103
|
-
rotate_auth:
|
|
3104
|
-
override_existing:
|
|
3215
|
+
deployment_config: z7.record(z7.string(), z7.unknown()).nullable().optional().describe("Replacement Gateway configuration, or null to clear it"),
|
|
3216
|
+
is_default: z7.boolean().optional().describe("Whether this is the default deployment"),
|
|
3217
|
+
rotate_auth: z7.boolean().optional().describe("Rotate the one-time deployment authentication secret"),
|
|
3218
|
+
override_existing: z7.boolean().optional().describe("Allow replacement of existing deployment settings"),
|
|
3105
3219
|
...authSettingsSchema,
|
|
3106
|
-
allow_all_workspaces:
|
|
3107
|
-
remove_workspaces_allowed:
|
|
3108
|
-
remove_subs_allowed:
|
|
3220
|
+
allow_all_workspaces: z7.boolean().optional().describe("Clear workspace restrictions and allow every workspace"),
|
|
3221
|
+
remove_workspaces_allowed: z7.array(z7.string()).optional().describe("Workspace slugs to remove from the allowlist"),
|
|
3222
|
+
remove_subs_allowed: z7.array(z7.string()).optional().describe("JWT subject values to remove from the allowlist")
|
|
3109
3223
|
},
|
|
3110
3224
|
archiveDeployment: {
|
|
3111
|
-
id:
|
|
3225
|
+
id: z7.string().min(1).describe("Deployment UUID to archive")
|
|
3112
3226
|
}
|
|
3113
3227
|
};
|
|
3114
3228
|
function compact(value) {
|
|
@@ -3216,72 +3330,74 @@ function registerDeploymentsTools(server, service) {
|
|
|
3216
3330
|
}
|
|
3217
3331
|
|
|
3218
3332
|
// src/tools/guardrails.tools.ts
|
|
3219
|
-
import { z as
|
|
3220
|
-
var guardrailCheckSchema =
|
|
3221
|
-
id:
|
|
3222
|
-
name:
|
|
3223
|
-
is_enabled:
|
|
3224
|
-
parameters:
|
|
3333
|
+
import { z as z8 } from "zod";
|
|
3334
|
+
var guardrailCheckSchema = z8.object({
|
|
3335
|
+
id: z8.string().describe("Check identifier (e.g., 'default.jwt', 'default.pii')"),
|
|
3336
|
+
name: z8.string().optional().describe("Display name for the check"),
|
|
3337
|
+
is_enabled: z8.boolean().optional().describe("Whether the check is enabled"),
|
|
3338
|
+
parameters: z8.record(z8.string(), z8.unknown()).optional().describe(
|
|
3225
3339
|
"Check-specific configuration. Supported examples include requestParametersCheck and parameters.forwardHeaders; forwarded headers can expose sensitive values, so allow only the minimum required names."
|
|
3226
3340
|
)
|
|
3227
3341
|
});
|
|
3228
|
-
var guardrailFeedbackSchema =
|
|
3229
|
-
value:
|
|
3230
|
-
weight:
|
|
3231
|
-
metadata:
|
|
3342
|
+
var guardrailFeedbackSchema = z8.object({
|
|
3343
|
+
value: z8.coerce.number().optional().describe("Feedback value"),
|
|
3344
|
+
weight: z8.coerce.number().optional().describe("Feedback weight"),
|
|
3345
|
+
metadata: z8.record(z8.string(), z8.unknown()).optional().describe("Additional metadata")
|
|
3232
3346
|
});
|
|
3233
|
-
var guardrailActionSchema =
|
|
3234
|
-
deny:
|
|
3235
|
-
async:
|
|
3347
|
+
var guardrailActionSchema = z8.object({
|
|
3348
|
+
deny: z8.boolean().optional().describe("Whether to deny the request on check failure"),
|
|
3349
|
+
async: z8.boolean().optional().describe("Whether to run checks asynchronously"),
|
|
3236
3350
|
on_success: guardrailFeedbackSchema.optional().describe("Feedback configuration for successful checks"),
|
|
3237
3351
|
on_fail: guardrailFeedbackSchema.optional().describe("Feedback configuration for failed checks"),
|
|
3238
|
-
on_fail_action:
|
|
3239
|
-
message:
|
|
3352
|
+
on_fail_action: z8.string().optional().describe("Simple action on failure (e.g., 'block')"),
|
|
3353
|
+
message: z8.string().optional().describe("Message to return when guardrail triggers")
|
|
3240
3354
|
});
|
|
3241
|
-
var workspaceGuardrailExclusionSchema =
|
|
3242
|
-
workspace_id:
|
|
3243
|
-
excluded:
|
|
3355
|
+
var workspaceGuardrailExclusionSchema = z8.object({
|
|
3356
|
+
workspace_id: z8.string().describe("Workspace ID whose exclusion state changes"),
|
|
3357
|
+
excluded: z8.boolean().describe("True to exclude this workspace; false to restore enforcement")
|
|
3244
3358
|
});
|
|
3245
3359
|
var GUARDRAILS_TOOL_SCHEMAS = {
|
|
3246
3360
|
getOrganisationDefaults: {},
|
|
3247
3361
|
listGuardrails: {
|
|
3248
|
-
workspace_id:
|
|
3249
|
-
organisation_id:
|
|
3250
|
-
page_size:
|
|
3251
|
-
|
|
3362
|
+
workspace_id: z8.string().optional().describe("Filter guardrails by workspace ID"),
|
|
3363
|
+
organisation_id: z8.string().optional().describe("Filter guardrails by organization ID"),
|
|
3364
|
+
page_size: PageSizeSchema.describe(
|
|
3365
|
+
"Number of items per page (1-100, default: 100)"
|
|
3366
|
+
),
|
|
3367
|
+
current_page: CurrentPageSchema
|
|
3252
3368
|
},
|
|
3253
3369
|
getGuardrail: {
|
|
3254
|
-
guardrail_id:
|
|
3370
|
+
guardrail_id: z8.string().describe("The guardrail UUID or slug (with guard_ prefix) to retrieve")
|
|
3255
3371
|
},
|
|
3256
3372
|
createGuardrail: {
|
|
3257
|
-
name:
|
|
3258
|
-
checks:
|
|
3373
|
+
name: z8.string().describe("Name of the guardrail"),
|
|
3374
|
+
checks: z8.array(guardrailCheckSchema).min(1).describe("Array of checks to apply (at least one required)"),
|
|
3259
3375
|
actions: guardrailActionSchema.describe(
|
|
3260
3376
|
"Actions to take when guardrail checks pass or fail"
|
|
3261
3377
|
),
|
|
3262
|
-
workspace_id:
|
|
3263
|
-
organisation_id:
|
|
3378
|
+
workspace_id: z8.string().optional().describe("Workspace ID to create the guardrail in"),
|
|
3379
|
+
organisation_id: z8.string().optional().describe("Organisation ID (required if workspace_id not provided)")
|
|
3264
3380
|
},
|
|
3265
3381
|
updateGuardrail: {
|
|
3266
|
-
guardrail_id:
|
|
3267
|
-
name:
|
|
3268
|
-
checks:
|
|
3382
|
+
guardrail_id: z8.string().describe("The guardrail UUID or slug to update"),
|
|
3383
|
+
name: z8.string().optional().describe("New name for the guardrail"),
|
|
3384
|
+
checks: z8.array(guardrailCheckSchema).min(1).optional().describe("Updated array of checks to apply"),
|
|
3269
3385
|
actions: guardrailActionSchema.optional().describe("Updated actions configuration")
|
|
3270
3386
|
},
|
|
3271
3387
|
deleteGuardrail: {
|
|
3272
|
-
guardrail_id:
|
|
3388
|
+
guardrail_id: z8.string().describe("The guardrail UUID or slug to delete")
|
|
3273
3389
|
},
|
|
3274
3390
|
updateOrganisationDefaults: {
|
|
3275
|
-
input_guardrails:
|
|
3276
|
-
output_guardrails:
|
|
3391
|
+
input_guardrails: z8.array(z8.string()).optional().describe("Ordered guardrail IDs or slugs to enforce on model input"),
|
|
3392
|
+
output_guardrails: z8.array(z8.string()).optional().describe("Ordered guardrail IDs or slugs to enforce on model output")
|
|
3277
3393
|
},
|
|
3278
3394
|
listWorkspaceExclusions: {
|
|
3279
|
-
organisation_id:
|
|
3395
|
+
organisation_id: z8.string().describe("Organisation ID whose workspace exclusions should be listed")
|
|
3280
3396
|
},
|
|
3281
3397
|
updateWorkspaceExclusions: {
|
|
3282
|
-
organisation_id:
|
|
3283
|
-
workspaces:
|
|
3284
|
-
override_existing:
|
|
3398
|
+
organisation_id: z8.string().describe("Organisation ID whose workspace exclusions should be updated"),
|
|
3399
|
+
workspaces: z8.array(workspaceGuardrailExclusionSchema).min(1).describe("Workspace exclusion states to apply"),
|
|
3400
|
+
override_existing: z8.boolean().optional().describe("Replace existing exclusion states instead of merging changes")
|
|
3285
3401
|
}
|
|
3286
3402
|
};
|
|
3287
3403
|
var GET_ORGANISATION_DEFAULTS_ANNOTATIONS = {
|
|
@@ -3483,7 +3599,7 @@ function registerGuardrailsTools(server, service) {
|
|
|
3483
3599
|
}
|
|
3484
3600
|
|
|
3485
3601
|
// src/tools/integrations.tools.ts
|
|
3486
|
-
import { z as
|
|
3602
|
+
import { z as z10 } from "zod";
|
|
3487
3603
|
|
|
3488
3604
|
// src/lib/limits.ts
|
|
3489
3605
|
var PERIODIC_RESET_DEFAULT = "monthly";
|
|
@@ -3526,25 +3642,25 @@ function buildRateLimits(params) {
|
|
|
3526
3642
|
}
|
|
3527
3643
|
|
|
3528
3644
|
// src/tools/secret-mapping.schemas.ts
|
|
3529
|
-
import { z as
|
|
3645
|
+
import { z as z9 } from "zod";
|
|
3530
3646
|
function createSecretMappingSchema({
|
|
3531
3647
|
allowKeyTarget,
|
|
3532
3648
|
targetFieldDescription,
|
|
3533
3649
|
secretReferenceDescription,
|
|
3534
3650
|
valueFormatDescription
|
|
3535
3651
|
}) {
|
|
3536
|
-
return
|
|
3537
|
-
target_field:
|
|
3652
|
+
return z9.object({
|
|
3653
|
+
target_field: z9.string().refine(
|
|
3538
3654
|
(value) => allowKeyTarget && value === "key" || value.startsWith("configurations."),
|
|
3539
3655
|
allowKeyTarget ? "target_field must be 'key' or start with 'configurations.'" : "target_field must start with 'configurations.'"
|
|
3540
3656
|
).describe(targetFieldDescription),
|
|
3541
|
-
secret_reference_id:
|
|
3542
|
-
secret_key:
|
|
3543
|
-
value_format:
|
|
3657
|
+
secret_reference_id: z9.string().describe(secretReferenceDescription),
|
|
3658
|
+
secret_key: z9.string().nullable().optional().describe("Optional key to select from a multi-value secret"),
|
|
3659
|
+
value_format: z9.enum(["string", "json"]).nullable().optional().describe(valueFormatDescription)
|
|
3544
3660
|
});
|
|
3545
3661
|
}
|
|
3546
3662
|
function uniqueSecretMappingsSchema(itemSchema) {
|
|
3547
|
-
return
|
|
3663
|
+
return z9.array(itemSchema).superRefine((mappings, context) => {
|
|
3548
3664
|
const firstIndexByTarget = /* @__PURE__ */ new Map();
|
|
3549
3665
|
for (const [index, mapping] of mappings.entries()) {
|
|
3550
3666
|
const firstIndex = firstIndexByTarget.get(mapping.target_field);
|
|
@@ -3571,8 +3687,8 @@ var integrationSecretMappingSchema = createSecretMappingSchema({
|
|
|
3571
3687
|
var integrationSecretMappingsSchema = uniqueSecretMappingsSchema(
|
|
3572
3688
|
integrationSecretMappingSchema
|
|
3573
3689
|
);
|
|
3574
|
-
var nullableMultiplier = (description) =>
|
|
3575
|
-
var pricingMultiplierSchema =
|
|
3690
|
+
var nullableMultiplier = (description) => z10.coerce.number().nonnegative().nullable().optional().describe(description);
|
|
3691
|
+
var pricingMultiplierSchema = z10.object({
|
|
3576
3692
|
default: nullableMultiplier(
|
|
3577
3693
|
"Fallback multiplier for pricing units; 1 is unchanged, 0.8 is a 20% discount"
|
|
3578
3694
|
),
|
|
@@ -3616,69 +3732,71 @@ var pricingMultiplierSchema = z9.object({
|
|
|
3616
3732
|
cache_write_image_input_token: nullableMultiplier(
|
|
3617
3733
|
"Cache-write image input token price multiplier"
|
|
3618
3734
|
),
|
|
3619
|
-
image:
|
|
3735
|
+
image: z10.object({
|
|
3620
3736
|
default: nullableMultiplier("Default image-generation price multiplier")
|
|
3621
3737
|
}).nullable().optional().describe("Image-generation pricing multipliers"),
|
|
3622
|
-
additional_units:
|
|
3738
|
+
additional_units: z10.record(z10.string(), z10.coerce.number().nonnegative().nullable()).nullable().optional().describe(
|
|
3623
3739
|
"Multipliers keyed by Portkey pricing unit, such as web_search or file_search"
|
|
3624
3740
|
)
|
|
3625
3741
|
});
|
|
3626
|
-
var pricingAdjustmentsSchema =
|
|
3742
|
+
var pricingAdjustmentsSchema = z10.object({
|
|
3627
3743
|
multiplier: pricingMultiplierSchema.optional().describe("Per-unit multipliers applied over Portkey catalog pricing")
|
|
3628
3744
|
}).nullable();
|
|
3629
|
-
var modelConfigurationsSchema =
|
|
3630
|
-
custom_host:
|
|
3631
|
-
custom_headers:
|
|
3745
|
+
var modelConfigurationsSchema = z10.object({
|
|
3746
|
+
custom_host: z10.string().url().optional().describe("Custom upstream URL used only for this model"),
|
|
3747
|
+
custom_headers: z10.record(z10.string(), z10.string()).optional().describe("Headers sent only for this model; values may contain secrets")
|
|
3632
3748
|
});
|
|
3633
|
-
var tokenPricingSchema =
|
|
3634
|
-
price:
|
|
3749
|
+
var tokenPricingSchema = z10.object({
|
|
3750
|
+
price: z10.coerce.number().nonnegative().describe("Static price per token in the integration pricing unit")
|
|
3635
3751
|
});
|
|
3636
|
-
var integrationModelPricingSchema =
|
|
3637
|
-
type:
|
|
3638
|
-
pay_as_you_go:
|
|
3752
|
+
var integrationModelPricingSchema = z10.object({
|
|
3753
|
+
type: z10.literal("static").describe("Static per-token pricing configuration"),
|
|
3754
|
+
pay_as_you_go: z10.object({
|
|
3639
3755
|
request_token: tokenPricingSchema.optional().describe("Input token pricing"),
|
|
3640
3756
|
response_token: tokenPricingSchema.optional().describe("Output token pricing")
|
|
3641
3757
|
}).optional().describe("Pay-as-you-go rates for this integration model")
|
|
3642
3758
|
});
|
|
3643
3759
|
var INTEGRATIONS_TOOL_SCHEMAS = {
|
|
3644
3760
|
getModelPricing: {
|
|
3645
|
-
provider:
|
|
3761
|
+
provider: z10.string().describe(
|
|
3646
3762
|
"Lowercase Portkey provider identifier, such as openai, anthropic, bedrock, or x-ai"
|
|
3647
3763
|
),
|
|
3648
|
-
model:
|
|
3764
|
+
model: z10.string().describe("Exact provider model identifier, such as gpt-4o")
|
|
3649
3765
|
},
|
|
3650
3766
|
listIntegrations: {
|
|
3651
|
-
current_page:
|
|
3652
|
-
page_size:
|
|
3653
|
-
|
|
3654
|
-
|
|
3767
|
+
current_page: CurrentPageSchema,
|
|
3768
|
+
page_size: PageSizeSchema.describe(
|
|
3769
|
+
"Number of results per page (default 100, max 100)"
|
|
3770
|
+
),
|
|
3771
|
+
workspace_id: z10.string().optional().describe("Filter integrations accessible by a specific workspace"),
|
|
3772
|
+
type: z10.enum(["workspace", "organisation", "all"]).optional().describe(
|
|
3655
3773
|
"Filter by integration type: 'workspace', 'organisation', or 'all' (default)"
|
|
3656
3774
|
)
|
|
3657
3775
|
},
|
|
3658
3776
|
createIntegration: {
|
|
3659
|
-
name:
|
|
3660
|
-
ai_provider_id:
|
|
3777
|
+
name: z10.string().describe("Human-readable name for the integration"),
|
|
3778
|
+
ai_provider_id: z10.string().describe(
|
|
3661
3779
|
"ID of the AI provider (e.g., 'openai', 'anthropic', 'azure-openai', 'aws-bedrock', 'vertex-ai')"
|
|
3662
3780
|
),
|
|
3663
|
-
slug:
|
|
3781
|
+
slug: z10.string().optional().describe(
|
|
3664
3782
|
"URL-friendly identifier (auto-generated from name if not provided)"
|
|
3665
3783
|
),
|
|
3666
|
-
key:
|
|
3667
|
-
description:
|
|
3668
|
-
workspace_id:
|
|
3669
|
-
api_version:
|
|
3670
|
-
resource_name:
|
|
3671
|
-
deployment_name:
|
|
3672
|
-
aws_region:
|
|
3673
|
-
aws_access_key_id:
|
|
3674
|
-
aws_secret_access_key:
|
|
3675
|
-
vertex_project_id:
|
|
3676
|
-
vertex_region:
|
|
3677
|
-
custom_host:
|
|
3678
|
-
create_default_provider:
|
|
3784
|
+
key: z10.string().optional().describe("API key for the provider (if required)"),
|
|
3785
|
+
description: z10.string().optional().describe("Optional description of the integration"),
|
|
3786
|
+
workspace_id: z10.string().optional().describe("Workspace ID for workspace-scoped integrations"),
|
|
3787
|
+
api_version: z10.string().optional().describe("API version (for Azure OpenAI)"),
|
|
3788
|
+
resource_name: z10.string().optional().describe("Resource name (for Azure OpenAI)"),
|
|
3789
|
+
deployment_name: z10.string().optional().describe("Deployment name (for Azure OpenAI)"),
|
|
3790
|
+
aws_region: z10.string().optional().describe("AWS region (for AWS Bedrock)"),
|
|
3791
|
+
aws_access_key_id: z10.string().optional().describe("AWS access key ID (for AWS Bedrock)"),
|
|
3792
|
+
aws_secret_access_key: z10.string().optional().describe("AWS secret access key (for AWS Bedrock)"),
|
|
3793
|
+
vertex_project_id: z10.string().optional().describe("GCP project ID (for Vertex AI)"),
|
|
3794
|
+
vertex_region: z10.string().optional().describe("GCP region (for Vertex AI)"),
|
|
3795
|
+
custom_host: z10.string().optional().describe("Custom base URL for the provider"),
|
|
3796
|
+
create_default_provider: z10.boolean().optional().describe(
|
|
3679
3797
|
"Create a provider automatically for a workspace-scoped integration; defaults to true"
|
|
3680
3798
|
),
|
|
3681
|
-
default_provider_slug:
|
|
3799
|
+
default_provider_slug: z10.string().max(255).regex(/^[a-zA-Z0-9_-]+$/).optional().describe("Custom slug for the automatically created workspace provider"),
|
|
3682
3800
|
secret_mappings: integrationSecretMappingsSchema.optional().describe(
|
|
3683
3801
|
"Unique runtime Secret Reference mappings; mapping key allows the key field to be omitted"
|
|
3684
3802
|
),
|
|
@@ -3687,22 +3805,22 @@ var INTEGRATIONS_TOOL_SCHEMAS = {
|
|
|
3687
3805
|
)
|
|
3688
3806
|
},
|
|
3689
3807
|
getIntegration: {
|
|
3690
|
-
slug:
|
|
3808
|
+
slug: z10.string().describe("The unique slug identifier of the integration to retrieve")
|
|
3691
3809
|
},
|
|
3692
3810
|
updateIntegration: {
|
|
3693
|
-
slug:
|
|
3694
|
-
name:
|
|
3695
|
-
key:
|
|
3696
|
-
description:
|
|
3697
|
-
api_version:
|
|
3698
|
-
resource_name:
|
|
3699
|
-
deployment_name:
|
|
3700
|
-
aws_region:
|
|
3701
|
-
aws_access_key_id:
|
|
3702
|
-
aws_secret_access_key:
|
|
3703
|
-
vertex_project_id:
|
|
3704
|
-
vertex_region:
|
|
3705
|
-
custom_host:
|
|
3811
|
+
slug: z10.string().describe("The slug of the integration to update"),
|
|
3812
|
+
name: z10.string().optional().describe("New human-readable name for the integration"),
|
|
3813
|
+
key: z10.string().optional().describe("New API key for the provider"),
|
|
3814
|
+
description: z10.string().optional().describe("New description for the integration"),
|
|
3815
|
+
api_version: z10.string().optional().describe("New API version (for Azure OpenAI)"),
|
|
3816
|
+
resource_name: z10.string().optional().describe("New resource name (for Azure OpenAI)"),
|
|
3817
|
+
deployment_name: z10.string().optional().describe("New deployment name (for Azure OpenAI)"),
|
|
3818
|
+
aws_region: z10.string().optional().describe("New AWS region (for AWS Bedrock)"),
|
|
3819
|
+
aws_access_key_id: z10.string().optional().describe("New AWS access key ID (for AWS Bedrock)"),
|
|
3820
|
+
aws_secret_access_key: z10.string().optional().describe("New AWS secret access key (for AWS Bedrock)"),
|
|
3821
|
+
vertex_project_id: z10.string().optional().describe("New GCP project ID (for Vertex AI)"),
|
|
3822
|
+
vertex_region: z10.string().optional().describe("New GCP region (for Vertex AI)"),
|
|
3823
|
+
custom_host: z10.string().optional().describe("New custom base URL for the provider"),
|
|
3706
3824
|
secret_mappings: integrationSecretMappingsSchema.optional().describe(
|
|
3707
3825
|
"Replacement runtime Secret Reference mappings; each target_field must be unique"
|
|
3708
3826
|
),
|
|
@@ -3711,78 +3829,78 @@ var INTEGRATIONS_TOOL_SCHEMAS = {
|
|
|
3711
3829
|
)
|
|
3712
3830
|
},
|
|
3713
3831
|
deleteIntegration: {
|
|
3714
|
-
slug:
|
|
3832
|
+
slug: z10.string().describe("The slug of the integration to delete")
|
|
3715
3833
|
},
|
|
3716
3834
|
listIntegrationModels: {
|
|
3717
|
-
slug:
|
|
3718
|
-
current_page:
|
|
3719
|
-
page_size:
|
|
3835
|
+
slug: z10.string().describe("The slug of the integration"),
|
|
3836
|
+
current_page: CurrentPageSchema,
|
|
3837
|
+
page_size: PageSizeSchema.describe("Number of results per page")
|
|
3720
3838
|
},
|
|
3721
3839
|
updateIntegrationModels: {
|
|
3722
|
-
slug:
|
|
3723
|
-
allow_all_models:
|
|
3840
|
+
slug: z10.string().describe("The slug of the integration"),
|
|
3841
|
+
allow_all_models: z10.boolean().optional().describe(
|
|
3724
3842
|
"Whether newly available provider models are enabled by default"
|
|
3725
3843
|
),
|
|
3726
|
-
models:
|
|
3727
|
-
|
|
3728
|
-
slug:
|
|
3729
|
-
model_name:
|
|
3844
|
+
models: z10.array(
|
|
3845
|
+
z10.object({
|
|
3846
|
+
slug: z10.string().describe("The model slug identifier"),
|
|
3847
|
+
model_name: z10.string().optional().describe(
|
|
3730
3848
|
"Display name for the model (required for custom models)"
|
|
3731
3849
|
),
|
|
3732
|
-
enabled:
|
|
3733
|
-
is_custom:
|
|
3734
|
-
is_finetune:
|
|
3735
|
-
base_model_slug:
|
|
3850
|
+
enabled: z10.boolean().describe("Whether the model is enabled"),
|
|
3851
|
+
is_custom: z10.boolean().optional().describe("Whether this is a custom model (default: false)"),
|
|
3852
|
+
is_finetune: z10.boolean().optional().describe("Whether this entry is a fine-tuned model"),
|
|
3853
|
+
base_model_slug: z10.string().optional().describe("Base model slug for a fine-tuned model"),
|
|
3736
3854
|
configurations: modelConfigurationsSchema.optional().describe("Per-model custom upstream host and headers"),
|
|
3737
3855
|
pricing_config: integrationModelPricingSchema.optional().describe("Static custom pricing for this integration model")
|
|
3738
3856
|
})
|
|
3739
3857
|
).describe("Array of model configurations to update")
|
|
3740
3858
|
},
|
|
3741
3859
|
deleteIntegrationModel: {
|
|
3742
|
-
slug:
|
|
3743
|
-
model_slug:
|
|
3860
|
+
slug: z10.string().describe("The slug of the integration"),
|
|
3861
|
+
model_slug: z10.string().describe("The slug of the model to delete")
|
|
3744
3862
|
},
|
|
3745
3863
|
listIntegrationWorkspaces: {
|
|
3746
|
-
slug:
|
|
3747
|
-
current_page:
|
|
3748
|
-
page_size:
|
|
3864
|
+
slug: z10.string().describe("The slug of the integration"),
|
|
3865
|
+
current_page: CurrentPageSchema,
|
|
3866
|
+
page_size: PageSizeSchema.describe("Number of results per page")
|
|
3749
3867
|
},
|
|
3750
3868
|
updateIntegrationWorkspaces: {
|
|
3751
|
-
slug:
|
|
3752
|
-
workspaces:
|
|
3753
|
-
|
|
3754
|
-
id:
|
|
3755
|
-
enabled:
|
|
3756
|
-
credit_limit:
|
|
3757
|
-
alert_threshold:
|
|
3758
|
-
rate_limit_rpm:
|
|
3759
|
-
reset_usage:
|
|
3760
|
-
create_default_provider:
|
|
3869
|
+
slug: z10.string().describe("The slug of the integration"),
|
|
3870
|
+
workspaces: z10.array(
|
|
3871
|
+
z10.object({
|
|
3872
|
+
id: z10.string().describe("The workspace ID"),
|
|
3873
|
+
enabled: z10.boolean().describe("Whether the workspace has access to this integration"),
|
|
3874
|
+
credit_limit: z10.coerce.number().positive().optional().describe("Credit limit for this workspace"),
|
|
3875
|
+
alert_threshold: z10.coerce.number().min(0).max(100).optional().describe("Alert threshold percentage (0-100)"),
|
|
3876
|
+
rate_limit_rpm: z10.coerce.number().positive().optional().describe("Rate limit in requests per minute"),
|
|
3877
|
+
reset_usage: z10.boolean().optional().describe("Reset exhausted usage status to active"),
|
|
3878
|
+
create_default_provider: z10.boolean().optional().describe(
|
|
3761
3879
|
"Override whether a provider is auto-created for this workspace"
|
|
3762
3880
|
),
|
|
3763
|
-
default_provider_slug:
|
|
3881
|
+
default_provider_slug: z10.string().optional().describe(
|
|
3764
3882
|
"Override the auto-created provider slug for this workspace"
|
|
3765
3883
|
)
|
|
3766
3884
|
})
|
|
3767
3885
|
).describe("Array of workspace configurations to update"),
|
|
3768
|
-
global_workspace_access_enabled:
|
|
3886
|
+
global_workspace_access_enabled: z10.boolean().optional().describe(
|
|
3769
3887
|
"Enable or disable access for all current and future workspaces"
|
|
3770
3888
|
),
|
|
3771
|
-
global_credit_limit:
|
|
3889
|
+
global_credit_limit: z10.coerce.number().positive().optional().describe(
|
|
3772
3890
|
"Global cost credit limit applied with global workspace access"
|
|
3773
3891
|
),
|
|
3774
|
-
global_alert_threshold:
|
|
3775
|
-
global_rate_limit_rpm:
|
|
3776
|
-
override_existing_workspace_access:
|
|
3777
|
-
create_default_provider:
|
|
3778
|
-
default_provider_slug:
|
|
3892
|
+
global_alert_threshold: z10.coerce.number().nonnegative().max(100).optional().describe("Global cost alert threshold applied to workspace access"),
|
|
3893
|
+
global_rate_limit_rpm: z10.coerce.number().positive().optional().describe("Global requests-per-minute limit for workspace access"),
|
|
3894
|
+
override_existing_workspace_access: z10.boolean().optional().describe("Apply global settings over existing per-workspace access"),
|
|
3895
|
+
create_default_provider: z10.boolean().optional().describe("Auto-create providers when granting workspace access"),
|
|
3896
|
+
default_provider_slug: z10.string().optional().describe("Default slug for providers auto-created in workspaces")
|
|
3779
3897
|
}
|
|
3780
3898
|
};
|
|
3781
|
-
var updateIntegrationWorkspacesSchema =
|
|
3899
|
+
var updateIntegrationWorkspacesSchema = z10.object(INTEGRATIONS_TOOL_SCHEMAS.updateIntegrationWorkspaces).superRefine((value, ctx) => {
|
|
3782
3900
|
const hasGlobalLimits = value.global_credit_limit !== void 0 || value.global_alert_threshold !== void 0 || value.global_rate_limit_rpm !== void 0;
|
|
3783
3901
|
if (hasGlobalLimits && value.global_workspace_access_enabled === void 0) {
|
|
3784
3902
|
ctx.addIssue({
|
|
3785
|
-
code:
|
|
3903
|
+
code: z10.ZodIssueCode.custom,
|
|
3786
3904
|
path: ["global_workspace_access_enabled"],
|
|
3787
3905
|
message: "global_workspace_access_enabled is required when setting global limits."
|
|
3788
3906
|
});
|
|
@@ -4114,31 +4232,31 @@ function registerIntegrationsTools(server, service) {
|
|
|
4114
4232
|
}
|
|
4115
4233
|
|
|
4116
4234
|
// src/tools/keys.tools.ts
|
|
4117
|
-
import { z as
|
|
4118
|
-
var virtualKeySecretMappingSchema =
|
|
4119
|
-
target_field:
|
|
4235
|
+
import { z as z11 } from "zod";
|
|
4236
|
+
var virtualKeySecretMappingSchema = z11.object({
|
|
4237
|
+
target_field: z11.string().refine(
|
|
4120
4238
|
(value) => value === "key" || value.startsWith("model_config."),
|
|
4121
4239
|
"target_field must be 'key' or start with 'model_config.'"
|
|
4122
4240
|
).describe("Virtual Key field populated from the Secret Reference"),
|
|
4123
|
-
secret_reference_id:
|
|
4124
|
-
secret_key:
|
|
4125
|
-
value_format:
|
|
4241
|
+
secret_reference_id: z11.string().describe("Secret Reference ID that owns the external secret"),
|
|
4242
|
+
secret_key: z11.string().nullable().optional().describe("Optional key selected from a structured external secret"),
|
|
4243
|
+
value_format: z11.enum(["json", "string"]).nullable().optional().describe("Whether Portkey reads the mapped value as JSON or a string")
|
|
4126
4244
|
});
|
|
4127
|
-
var virtualKeyDeploymentSchema =
|
|
4128
|
-
api_version:
|
|
4129
|
-
deployment_name:
|
|
4130
|
-
alias:
|
|
4131
|
-
is_default:
|
|
4245
|
+
var virtualKeyDeploymentSchema = z11.object({
|
|
4246
|
+
api_version: z11.string().min(1).describe("Azure OpenAI API version"),
|
|
4247
|
+
deployment_name: z11.string().min(1).describe("Azure deployment name"),
|
|
4248
|
+
alias: z11.string().optional().describe("Optional model alias for the deployment"),
|
|
4249
|
+
is_default: z11.boolean().optional().describe("Whether this is the default Azure deployment")
|
|
4132
4250
|
});
|
|
4133
|
-
var apiKeyRateLimitSchema =
|
|
4134
|
-
type:
|
|
4135
|
-
unit:
|
|
4136
|
-
value:
|
|
4251
|
+
var apiKeyRateLimitSchema = z11.object({
|
|
4252
|
+
type: z11.enum(["requests", "tokens"]).describe("Whether the limit counts requests or tokens"),
|
|
4253
|
+
unit: z11.enum(["rpd", "rph", "rpm", "rps", "rpw"]).describe("Rate window unit for the request or token count"),
|
|
4254
|
+
value: z11.coerce.number().int().nonnegative().describe("Maximum count in the selected rate window")
|
|
4137
4255
|
});
|
|
4138
|
-
var rotationPolicySchema =
|
|
4139
|
-
rotation_period:
|
|
4140
|
-
next_rotation_at:
|
|
4141
|
-
key_transition_period_ms:
|
|
4256
|
+
var rotationPolicySchema = z11.object({
|
|
4257
|
+
rotation_period: z11.enum(["weekly", "monthly"]).nullable().optional().describe("Built-in weekly or monthly automatic rotation cadence"),
|
|
4258
|
+
next_rotation_at: z11.iso.datetime({ offset: true }).nullable().optional().describe("Explicit next rotation timestamp in ISO 8601 format"),
|
|
4259
|
+
key_transition_period_ms: z11.coerce.number().int().min(18e5).optional().describe("Overlap in milliseconds before the previous key expires")
|
|
4142
4260
|
}).superRefine((value, context) => {
|
|
4143
4261
|
if (value.rotation_period && value.next_rotation_at) {
|
|
4144
4262
|
context.addIssue({
|
|
@@ -4150,112 +4268,112 @@ var rotationPolicySchema = z10.object({
|
|
|
4150
4268
|
}).describe("Automatic API-key rotation policy, or null to remove it");
|
|
4151
4269
|
var KEYS_TOOL_SCHEMAS = {
|
|
4152
4270
|
listVirtualKeys: {
|
|
4153
|
-
current_page:
|
|
4154
|
-
page_size:
|
|
4271
|
+
current_page: CurrentPageSchema,
|
|
4272
|
+
page_size: PageSizeSchema.describe("Number of results per page (max 100)")
|
|
4155
4273
|
},
|
|
4156
4274
|
createVirtualKey: {
|
|
4157
|
-
name:
|
|
4158
|
-
provider:
|
|
4275
|
+
name: z11.string().describe("Display name for the virtual key"),
|
|
4276
|
+
provider: z11.string().describe(
|
|
4159
4277
|
"Provider slug (e.g., 'openai', 'anthropic', 'azure-openai', 'google')"
|
|
4160
4278
|
),
|
|
4161
|
-
key:
|
|
4162
|
-
note:
|
|
4163
|
-
workspace_id:
|
|
4164
|
-
api_version:
|
|
4165
|
-
resource_name:
|
|
4166
|
-
deployment_name:
|
|
4167
|
-
deployment_configurations:
|
|
4279
|
+
key: z11.string().optional().describe("Provider API key; omit when secret_mappings supplies key"),
|
|
4280
|
+
note: z11.string().optional().describe("Optional note or description for this key"),
|
|
4281
|
+
workspace_id: z11.string().optional().describe("Workspace ID to create the key in"),
|
|
4282
|
+
api_version: z11.string().optional().describe("API version (for Azure OpenAI)"),
|
|
4283
|
+
resource_name: z11.string().optional().describe("Resource name (for Azure OpenAI)"),
|
|
4284
|
+
deployment_name: z11.string().optional().describe("Deployment name (for Azure OpenAI)"),
|
|
4285
|
+
deployment_configurations: z11.array(virtualKeyDeploymentSchema).optional().describe(
|
|
4168
4286
|
"Azure deployment configurations with API versions and aliases"
|
|
4169
4287
|
),
|
|
4170
|
-
expires_at:
|
|
4171
|
-
secret_mappings:
|
|
4172
|
-
credit_limit:
|
|
4173
|
-
alert_threshold:
|
|
4288
|
+
expires_at: z11.iso.datetime({ offset: true }).optional().describe("Expiration in ISO 8601 format"),
|
|
4289
|
+
secret_mappings: z11.array(virtualKeySecretMappingSchema).optional().describe("Secret Reference mappings for key or model_config fields"),
|
|
4290
|
+
credit_limit: z11.coerce.number().positive().optional().describe("Maximum usage cost threshold"),
|
|
4291
|
+
alert_threshold: z11.coerce.number().min(0).max(100).optional().describe(
|
|
4174
4292
|
"Percentage of credit_limit at which to send alert emails (0-100)"
|
|
4175
4293
|
),
|
|
4176
|
-
rate_limit_rpm:
|
|
4294
|
+
rate_limit_rpm: z11.coerce.number().positive().optional().describe("Requests per minute limit")
|
|
4177
4295
|
},
|
|
4178
4296
|
getVirtualKey: {
|
|
4179
|
-
slug:
|
|
4297
|
+
slug: z11.string().describe("The unique slug identifier of the virtual key to retrieve")
|
|
4180
4298
|
},
|
|
4181
4299
|
updateVirtualKey: {
|
|
4182
|
-
slug:
|
|
4183
|
-
name:
|
|
4184
|
-
key:
|
|
4185
|
-
note:
|
|
4186
|
-
credit_limit:
|
|
4187
|
-
alert_threshold:
|
|
4188
|
-
rate_limit_rpm:
|
|
4189
|
-
deployment_configurations:
|
|
4190
|
-
secret_mappings:
|
|
4300
|
+
slug: z11.string().describe("The slug of the virtual key to update"),
|
|
4301
|
+
name: z11.string().optional().describe("New display name for the key"),
|
|
4302
|
+
key: z11.string().optional().describe("New provider API key value"),
|
|
4303
|
+
note: z11.string().optional().describe("New note or description"),
|
|
4304
|
+
credit_limit: z11.coerce.number().positive().optional().describe("New credit limit for usage"),
|
|
4305
|
+
alert_threshold: z11.coerce.number().min(0).max(100).optional().describe("New alert threshold percentage (0-100)"),
|
|
4306
|
+
rate_limit_rpm: z11.coerce.number().positive().optional().describe("New rate limit in requests per minute"),
|
|
4307
|
+
deployment_configurations: z11.array(virtualKeyDeploymentSchema).optional().describe("Replacement Azure deployment configurations"),
|
|
4308
|
+
secret_mappings: z11.array(virtualKeySecretMappingSchema).optional().describe("Replacement Secret Reference mappings")
|
|
4191
4309
|
},
|
|
4192
4310
|
deleteVirtualKey: {
|
|
4193
|
-
slug:
|
|
4311
|
+
slug: z11.string().describe("The slug of the virtual key to delete")
|
|
4194
4312
|
},
|
|
4195
4313
|
createApiKey: {
|
|
4196
|
-
type:
|
|
4314
|
+
type: z11.enum(["organisation", "workspace"]).describe(
|
|
4197
4315
|
"Key type: 'organisation' for org-wide access or 'workspace' for workspace-scoped"
|
|
4198
4316
|
),
|
|
4199
|
-
sub_type:
|
|
4317
|
+
sub_type: z11.enum(["user", "service"]).describe(
|
|
4200
4318
|
"Sub-type: 'user' for user-associated keys or 'service' for service accounts"
|
|
4201
4319
|
),
|
|
4202
|
-
name:
|
|
4203
|
-
description:
|
|
4204
|
-
organisation_id:
|
|
4205
|
-
workspace_id:
|
|
4206
|
-
user_id:
|
|
4207
|
-
scopes:
|
|
4320
|
+
name: z11.string().describe("Display name for the API key"),
|
|
4321
|
+
description: z11.string().optional().describe("Optional description for the key"),
|
|
4322
|
+
organisation_id: z11.string().optional().describe("Organisation UUID"),
|
|
4323
|
+
workspace_id: z11.string().optional().describe("Workspace ID (required for workspace-type keys)"),
|
|
4324
|
+
user_id: z11.string().optional().describe("User ID (required for user sub-type keys)"),
|
|
4325
|
+
scopes: z11.array(z11.string()).describe(
|
|
4208
4326
|
"Permission scopes for the key (e.g., ['logs.read', 'analytics.read'])"
|
|
4209
4327
|
),
|
|
4210
|
-
credit_limit:
|
|
4211
|
-
alert_threshold:
|
|
4212
|
-
rate_limit_rpm:
|
|
4213
|
-
rate_limits:
|
|
4214
|
-
default_config_id:
|
|
4215
|
-
default_metadata:
|
|
4216
|
-
default_allow_config_override:
|
|
4217
|
-
alert_emails:
|
|
4218
|
-
expires_at:
|
|
4328
|
+
credit_limit: z11.coerce.number().positive().optional().describe("Credit limit for usage"),
|
|
4329
|
+
alert_threshold: z11.coerce.number().min(0).max(100).optional().describe("Alert threshold percentage (0-100)"),
|
|
4330
|
+
rate_limit_rpm: z11.coerce.number().positive().optional().describe("Rate limit in requests per minute"),
|
|
4331
|
+
rate_limits: z11.array(apiKeyRateLimitSchema).nullable().optional().describe("Request or token rate limits, or null to clear them"),
|
|
4332
|
+
default_config_id: z11.string().optional().describe("Default configuration ID to use with this key"),
|
|
4333
|
+
default_metadata: z11.record(z11.string(), z11.string()).optional().describe("Default metadata key-value pairs"),
|
|
4334
|
+
default_allow_config_override: z11.boolean().optional().describe("Allow callers to override the default config"),
|
|
4335
|
+
alert_emails: z11.array(z11.string()).optional().describe("Email addresses for alerts"),
|
|
4336
|
+
expires_at: z11.iso.datetime({ offset: true }).optional().describe("Expiration date in ISO 8601 format"),
|
|
4219
4337
|
rotation_policy: rotationPolicySchema.nullable().optional().describe("Automatic API-key rotation policy, or null to disable it")
|
|
4220
4338
|
},
|
|
4221
4339
|
listApiKeys: {
|
|
4222
|
-
page_size:
|
|
4223
|
-
current_page:
|
|
4224
|
-
workspace_id:
|
|
4340
|
+
page_size: PageSizeSchema.describe("Number of results per page (max 100)"),
|
|
4341
|
+
current_page: CurrentPageSchema,
|
|
4342
|
+
workspace_id: z11.string().optional().describe("Filter by workspace ID")
|
|
4225
4343
|
},
|
|
4226
4344
|
getApiKey: {
|
|
4227
|
-
id:
|
|
4345
|
+
id: z11.string().uuid().describe("The UUID of the API key to retrieve")
|
|
4228
4346
|
},
|
|
4229
4347
|
updateApiKey: {
|
|
4230
|
-
id:
|
|
4231
|
-
name:
|
|
4232
|
-
description:
|
|
4233
|
-
scopes:
|
|
4234
|
-
credit_limit:
|
|
4235
|
-
alert_threshold:
|
|
4236
|
-
rate_limit_rpm:
|
|
4237
|
-
rate_limits:
|
|
4238
|
-
reset_usage:
|
|
4239
|
-
default_config_id:
|
|
4240
|
-
default_metadata:
|
|
4241
|
-
default_allow_config_override:
|
|
4242
|
-
alert_emails:
|
|
4243
|
-
expires_at:
|
|
4348
|
+
id: z11.string().uuid().describe("The UUID of the API key to update"),
|
|
4349
|
+
name: z11.string().optional().describe("New display name for the key"),
|
|
4350
|
+
description: z11.string().optional().describe("New description for the key"),
|
|
4351
|
+
scopes: z11.array(z11.string()).optional().describe("New permission scopes for the key"),
|
|
4352
|
+
credit_limit: z11.coerce.number().positive().optional().describe("New credit limit for usage"),
|
|
4353
|
+
alert_threshold: z11.coerce.number().min(0).max(100).optional().describe("New alert threshold percentage (0-100)"),
|
|
4354
|
+
rate_limit_rpm: z11.coerce.number().positive().optional().describe("New rate limit in requests per minute"),
|
|
4355
|
+
rate_limits: z11.array(apiKeyRateLimitSchema).nullable().optional().describe("Replacement request or token rate limits, or null to clear"),
|
|
4356
|
+
reset_usage: z11.coerce.number().nonnegative().optional().describe("Set to a nonnegative acknowledgement value to reset usage"),
|
|
4357
|
+
default_config_id: z11.string().optional().describe("New default configuration ID"),
|
|
4358
|
+
default_metadata: z11.record(z11.string(), z11.string()).optional().describe("New default metadata key-value pairs"),
|
|
4359
|
+
default_allow_config_override: z11.boolean().optional().describe("Whether callers may override the key's default config"),
|
|
4360
|
+
alert_emails: z11.array(z11.string()).optional().describe("New email addresses for alerts"),
|
|
4361
|
+
expires_at: z11.iso.datetime({ offset: true }).nullable().optional().describe(
|
|
4244
4362
|
"New expiration date in ISO 8601 format, or null to remove expiration"
|
|
4245
4363
|
),
|
|
4246
4364
|
rotation_policy: rotationPolicySchema.nullable().optional().describe("Replacement rotation policy, or null to disable it")
|
|
4247
4365
|
},
|
|
4248
4366
|
rotateApiKey: {
|
|
4249
|
-
id:
|
|
4250
|
-
key_transition_period_ms:
|
|
4367
|
+
id: z11.string().uuid().describe("API key UUID obtained from list_api_keys"),
|
|
4368
|
+
key_transition_period_ms: z11.coerce.number().int().min(18e5).optional().describe(
|
|
4251
4369
|
"Overlap in milliseconds while the previous key remains valid; minimum 1,800,000 (30 minutes), for example 3,600,000 for 1 hour"
|
|
4252
4370
|
)
|
|
4253
4371
|
},
|
|
4254
4372
|
deleteApiKey: {
|
|
4255
|
-
id:
|
|
4373
|
+
id: z11.string().uuid().describe("The UUID of the API key to delete")
|
|
4256
4374
|
}
|
|
4257
4375
|
};
|
|
4258
|
-
var createVirtualKeySchema =
|
|
4376
|
+
var createVirtualKeySchema = z11.object(KEYS_TOOL_SCHEMAS.createVirtualKey).superRefine((value, context) => {
|
|
4259
4377
|
if (value.key === void 0 && !value.secret_mappings?.some((mapping) => mapping.target_field === "key")) {
|
|
4260
4378
|
context.addIssue({
|
|
4261
4379
|
code: "custom",
|
|
@@ -4264,17 +4382,17 @@ var createVirtualKeySchema = z10.object(KEYS_TOOL_SCHEMAS.createVirtualKey).supe
|
|
|
4264
4382
|
});
|
|
4265
4383
|
}
|
|
4266
4384
|
});
|
|
4267
|
-
var createApiKeySchema =
|
|
4385
|
+
var createApiKeySchema = z11.object(KEYS_TOOL_SCHEMAS.createApiKey).superRefine((value, ctx) => {
|
|
4268
4386
|
if (value.type === "workspace" && !value.workspace_id) {
|
|
4269
4387
|
ctx.addIssue({
|
|
4270
|
-
code:
|
|
4388
|
+
code: z11.ZodIssueCode.custom,
|
|
4271
4389
|
path: ["workspace_id"],
|
|
4272
4390
|
message: "workspace_id is required when type is 'workspace'"
|
|
4273
4391
|
});
|
|
4274
4392
|
}
|
|
4275
4393
|
if (value.sub_type === "user" && !value.user_id) {
|
|
4276
4394
|
ctx.addIssue({
|
|
4277
|
-
code:
|
|
4395
|
+
code: z11.ZodIssueCode.custom,
|
|
4278
4396
|
path: ["user_id"],
|
|
4279
4397
|
message: "user_id is required when sub_type is 'user'"
|
|
4280
4398
|
});
|
|
@@ -4597,43 +4715,43 @@ function registerKeysTools(server, service) {
|
|
|
4597
4715
|
}
|
|
4598
4716
|
|
|
4599
4717
|
// src/tools/labels.tools.ts
|
|
4600
|
-
import { z as
|
|
4718
|
+
import { z as z12 } from "zod";
|
|
4601
4719
|
var LABELS_TOOL_SCHEMAS = {
|
|
4602
4720
|
createPromptLabel: {
|
|
4603
|
-
name:
|
|
4604
|
-
organisation_id:
|
|
4605
|
-
workspace_id:
|
|
4606
|
-
description:
|
|
4607
|
-
color_code:
|
|
4721
|
+
name: z12.string().describe("Name of the label"),
|
|
4722
|
+
organisation_id: z12.string().optional().describe("Organisation ID to create the label in"),
|
|
4723
|
+
workspace_id: z12.string().optional().describe("Workspace ID to create the label in"),
|
|
4724
|
+
description: z12.string().optional().describe("Description of the label"),
|
|
4725
|
+
color_code: z12.string().regex(/^#[0-9A-Fa-f]{6}$/).optional().describe(
|
|
4608
4726
|
"Hex format, e.g. '#FF5733'. Optional \u2014 omit for default color."
|
|
4609
4727
|
)
|
|
4610
4728
|
},
|
|
4611
4729
|
listPromptLabels: {
|
|
4612
|
-
organisation_id:
|
|
4613
|
-
workspace_id:
|
|
4614
|
-
search:
|
|
4615
|
-
current_page:
|
|
4616
|
-
page_size:
|
|
4730
|
+
organisation_id: z12.string().optional().describe("Filter by organisation ID"),
|
|
4731
|
+
workspace_id: z12.string().optional().describe("Filter by workspace ID"),
|
|
4732
|
+
search: z12.string().optional().describe("Search labels by name"),
|
|
4733
|
+
current_page: CurrentPageSchema,
|
|
4734
|
+
page_size: PageSizeSchema
|
|
4617
4735
|
},
|
|
4618
4736
|
getPromptLabel: {
|
|
4619
|
-
label_id:
|
|
4620
|
-
organisation_id:
|
|
4621
|
-
workspace_id:
|
|
4737
|
+
label_id: z12.string().describe("Label ID to retrieve"),
|
|
4738
|
+
organisation_id: z12.string().optional().describe("Organisation ID for filtering"),
|
|
4739
|
+
workspace_id: z12.string().optional().describe("Workspace ID for filtering")
|
|
4622
4740
|
},
|
|
4623
4741
|
updatePromptLabel: {
|
|
4624
|
-
label_id:
|
|
4625
|
-
name:
|
|
4626
|
-
description:
|
|
4627
|
-
color_code:
|
|
4742
|
+
label_id: z12.string().describe("Label ID to update"),
|
|
4743
|
+
name: z12.string().optional().describe("New name for the label"),
|
|
4744
|
+
description: z12.string().optional().describe("New description"),
|
|
4745
|
+
color_code: z12.string().regex(/^#[0-9A-Fa-f]{6}$/).optional().describe("New hex color code (e.g., '#FF5733')")
|
|
4628
4746
|
},
|
|
4629
4747
|
deletePromptLabel: {
|
|
4630
|
-
label_id:
|
|
4748
|
+
label_id: z12.string().describe("Label ID to delete")
|
|
4631
4749
|
}
|
|
4632
4750
|
};
|
|
4633
|
-
var createPromptLabelSchema =
|
|
4751
|
+
var createPromptLabelSchema = z12.object(LABELS_TOOL_SCHEMAS.createPromptLabel).superRefine((value, ctx) => {
|
|
4634
4752
|
if (!value.organisation_id && !value.workspace_id) {
|
|
4635
4753
|
ctx.addIssue({
|
|
4636
|
-
code:
|
|
4754
|
+
code: z12.ZodIssueCode.custom,
|
|
4637
4755
|
message: "Either organisation_id or workspace_id is required"
|
|
4638
4756
|
});
|
|
4639
4757
|
}
|
|
@@ -4730,13 +4848,13 @@ function registerLabelsTools(server, service) {
|
|
|
4730
4848
|
}
|
|
4731
4849
|
|
|
4732
4850
|
// src/tools/limits.tools.ts
|
|
4733
|
-
import { z as
|
|
4734
|
-
var statusSchema =
|
|
4735
|
-
var rateUnitSchema =
|
|
4736
|
-
var rateTargetSchema =
|
|
4737
|
-
var conditionValueSchema =
|
|
4738
|
-
var conditionSchema =
|
|
4739
|
-
key:
|
|
4851
|
+
import { z as z13 } from "zod";
|
|
4852
|
+
var statusSchema = z13.enum(["active", "archived"]);
|
|
4853
|
+
var rateUnitSchema = z13.enum(["rpm", "rph", "rpd", "rpw"]);
|
|
4854
|
+
var rateTargetSchema = z13.enum(["llm", "mcp_tools"]);
|
|
4855
|
+
var conditionValueSchema = z13.union([z13.string(), z13.array(z13.string()).min(1)]);
|
|
4856
|
+
var conditionSchema = z13.object({
|
|
4857
|
+
key: z13.string().min(1).describe(
|
|
4740
4858
|
"Match key such as api_key, virtual_key, provider, config, prompt, model, endpoint_type, mcp_server, mcp_tool, workspace_id, or metadata.*"
|
|
4741
4859
|
),
|
|
4742
4860
|
value: conditionValueSchema.describe(
|
|
@@ -4744,92 +4862,92 @@ var conditionSchema = z12.object({
|
|
|
4744
4862
|
),
|
|
4745
4863
|
excludes: conditionValueSchema.optional().describe("Values to exclude")
|
|
4746
4864
|
});
|
|
4747
|
-
var groupBySchema =
|
|
4748
|
-
key:
|
|
4865
|
+
var groupBySchema = z13.object({
|
|
4866
|
+
key: z13.string().min(1).describe(
|
|
4749
4867
|
"Counter grouping key such as api_key, workspace_id, virtual_key, provider, config, prompt, model, mcp_server, mcp_tool, or metadata.*"
|
|
4750
4868
|
)
|
|
4751
4869
|
});
|
|
4752
4870
|
var paginationSchema = {
|
|
4753
|
-
page_size:
|
|
4754
|
-
current_page:
|
|
4871
|
+
page_size: PageSizeSchema.describe("Number of policies to return per page"),
|
|
4872
|
+
current_page: CurrentPageSchema.describe("Zero-based page number")
|
|
4755
4873
|
};
|
|
4756
4874
|
var LIMITS_TOOL_SCHEMAS = {
|
|
4757
4875
|
listRateLimits: {
|
|
4758
|
-
workspace_id:
|
|
4876
|
+
workspace_id: z13.string().optional().describe("Filter by workspace UUID"),
|
|
4759
4877
|
status: statusSchema.optional().describe("Filter by active or archived status"),
|
|
4760
|
-
type:
|
|
4878
|
+
type: z13.enum(["requests", "tokens"]).optional().describe("Filter by counter type"),
|
|
4761
4879
|
unit: rateUnitSchema.optional().describe("Filter by reset interval"),
|
|
4762
4880
|
target: rateTargetSchema.optional().describe("Filter by LLM or MCP-tool target"),
|
|
4763
4881
|
...paginationSchema
|
|
4764
4882
|
},
|
|
4765
4883
|
getRateLimit: {
|
|
4766
|
-
id:
|
|
4884
|
+
id: z13.string().min(1).describe("Rate-limit policy UUID"),
|
|
4767
4885
|
status: statusSchema.optional().describe("Include an archived policy by status")
|
|
4768
4886
|
},
|
|
4769
4887
|
createRateLimit: {
|
|
4770
|
-
conditions:
|
|
4771
|
-
group_by:
|
|
4772
|
-
type:
|
|
4888
|
+
conditions: z13.array(conditionSchema).min(1).describe("Policy match conditions"),
|
|
4889
|
+
group_by: z13.array(groupBySchema).min(1).describe("Counter grouping dimensions"),
|
|
4890
|
+
type: z13.enum(["requests", "tokens"]).describe("Counter type"),
|
|
4773
4891
|
unit: rateUnitSchema.describe("Counter reset interval"),
|
|
4774
|
-
value:
|
|
4775
|
-
name:
|
|
4892
|
+
value: z13.coerce.number().nonnegative().describe("Maximum requests or tokens"),
|
|
4893
|
+
name: z13.string().optional().describe("Optional policy display name"),
|
|
4776
4894
|
target: rateTargetSchema.optional().describe("LLM or MCP-tool enforcement target"),
|
|
4777
|
-
workspace_id:
|
|
4778
|
-
organisation_id:
|
|
4895
|
+
workspace_id: z13.string().optional().describe("Workspace UUID scope"),
|
|
4896
|
+
organisation_id: z13.string().optional().describe("Organisation UUID scope")
|
|
4779
4897
|
},
|
|
4780
4898
|
updateRateLimit: {
|
|
4781
|
-
id:
|
|
4782
|
-
name:
|
|
4899
|
+
id: z13.string().min(1).describe("Rate-limit policy UUID"),
|
|
4900
|
+
name: z13.string().optional().describe("Replacement display name"),
|
|
4783
4901
|
unit: rateUnitSchema.optional().describe("Replacement reset interval"),
|
|
4784
|
-
value:
|
|
4785
|
-
conditions:
|
|
4902
|
+
value: z13.coerce.number().nonnegative().optional().describe("Replacement maximum"),
|
|
4903
|
+
conditions: z13.array(conditionSchema).min(1).optional().describe("Replacement conditions")
|
|
4786
4904
|
},
|
|
4787
4905
|
deleteRateLimit: {
|
|
4788
|
-
id:
|
|
4906
|
+
id: z13.string().min(1).describe("Rate-limit policy UUID to delete")
|
|
4789
4907
|
},
|
|
4790
4908
|
listUsageLimits: {
|
|
4791
|
-
workspace_id:
|
|
4909
|
+
workspace_id: z13.string().optional().describe("Filter by workspace UUID"),
|
|
4792
4910
|
status: statusSchema.optional().describe("Filter by active or archived status"),
|
|
4793
|
-
type:
|
|
4911
|
+
type: z13.enum(["cost", "tokens"]).optional().describe("Filter by budget type"),
|
|
4794
4912
|
...paginationSchema
|
|
4795
4913
|
},
|
|
4796
4914
|
getUsageLimit: {
|
|
4797
|
-
id:
|
|
4915
|
+
id: z13.string().min(1).describe("Usage-limit policy UUID"),
|
|
4798
4916
|
status: statusSchema.optional().describe("Include an archived policy by status"),
|
|
4799
|
-
include_usage:
|
|
4917
|
+
include_usage: z13.boolean().optional().describe("Include per-value usage counters")
|
|
4800
4918
|
},
|
|
4801
4919
|
createUsageLimit: {
|
|
4802
|
-
conditions:
|
|
4803
|
-
group_by:
|
|
4804
|
-
type:
|
|
4805
|
-
credit_limit:
|
|
4806
|
-
name:
|
|
4807
|
-
alert_threshold:
|
|
4808
|
-
periodic_reset:
|
|
4809
|
-
workspace_id:
|
|
4810
|
-
organisation_id:
|
|
4920
|
+
conditions: z13.array(conditionSchema).min(1).describe("Policy match conditions"),
|
|
4921
|
+
group_by: z13.array(groupBySchema).min(1).describe("Usage grouping dimensions"),
|
|
4922
|
+
type: z13.enum(["cost", "tokens"]).describe("Budget type"),
|
|
4923
|
+
credit_limit: z13.coerce.number().nonnegative().describe("Maximum cumulative usage"),
|
|
4924
|
+
name: z13.string().optional().describe("Optional policy display name"),
|
|
4925
|
+
alert_threshold: z13.coerce.number().nonnegative().nullable().optional().describe("Optional alert threshold"),
|
|
4926
|
+
periodic_reset: z13.enum(["monthly", "weekly"]).nullable().optional().describe("Optional reset schedule"),
|
|
4927
|
+
workspace_id: z13.string().optional().describe("Workspace UUID scope"),
|
|
4928
|
+
organisation_id: z13.string().optional().describe("Organisation UUID scope")
|
|
4811
4929
|
},
|
|
4812
4930
|
updateUsageLimit: {
|
|
4813
|
-
id:
|
|
4814
|
-
name:
|
|
4815
|
-
credit_limit:
|
|
4816
|
-
alert_threshold:
|
|
4817
|
-
periodic_reset:
|
|
4818
|
-
reset_usage_for_value:
|
|
4931
|
+
id: z13.string().min(1).describe("Usage-limit policy UUID"),
|
|
4932
|
+
name: z13.string().optional().describe("Replacement display name"),
|
|
4933
|
+
credit_limit: z13.coerce.number().nonnegative().optional().describe("Replacement cumulative maximum"),
|
|
4934
|
+
alert_threshold: z13.coerce.number().nonnegative().nullable().optional().describe("Replacement alert threshold"),
|
|
4935
|
+
periodic_reset: z13.enum(["monthly", "weekly"]).nullable().optional().describe("Replacement reset schedule"),
|
|
4936
|
+
reset_usage_for_value: z13.string().optional().describe("Grouped value whose usage should reset")
|
|
4819
4937
|
},
|
|
4820
4938
|
deleteUsageLimit: {
|
|
4821
|
-
id:
|
|
4939
|
+
id: z13.string().min(1).describe("Usage-limit policy UUID to archive")
|
|
4822
4940
|
},
|
|
4823
4941
|
listUsageLimitEntities: {
|
|
4824
|
-
limit_id:
|
|
4825
|
-
status:
|
|
4826
|
-
search:
|
|
4827
|
-
page_size:
|
|
4828
|
-
current_page:
|
|
4942
|
+
limit_id: z13.string().min(1).describe("Usage-limit policy UUID"),
|
|
4943
|
+
status: z13.enum(["active", "exhausted"]).optional().describe("Filter by enforcement state"),
|
|
4944
|
+
search: z13.string().optional().describe("Search tracked values"),
|
|
4945
|
+
page_size: PageSizeSchema.describe("Number of entities per page"),
|
|
4946
|
+
current_page: CurrentPageSchema.describe("Zero-based page number")
|
|
4829
4947
|
},
|
|
4830
4948
|
resetUsageLimitEntity: {
|
|
4831
|
-
limit_id:
|
|
4832
|
-
entity_id:
|
|
4949
|
+
limit_id: z13.string().min(1).describe("Usage-limit policy UUID"),
|
|
4950
|
+
entity_id: z13.string().min(1).describe("Tracked entity UUID to reset")
|
|
4833
4951
|
}
|
|
4834
4952
|
};
|
|
4835
4953
|
function compact2(value) {
|
|
@@ -4962,8 +5080,8 @@ function registerLimitsTools(server, service) {
|
|
|
4962
5080
|
}
|
|
4963
5081
|
|
|
4964
5082
|
// src/tools/logging.tools.ts
|
|
4965
|
-
import { z as
|
|
4966
|
-
var logExportFieldSchema =
|
|
5083
|
+
import { z as z14 } from "zod";
|
|
5084
|
+
var logExportFieldSchema = z14.enum([
|
|
4967
5085
|
"id",
|
|
4968
5086
|
"trace_id",
|
|
4969
5087
|
"created_at",
|
|
@@ -4986,12 +5104,12 @@ var logExportFieldSchema = z13.enum([
|
|
|
4986
5104
|
"metadata"
|
|
4987
5105
|
]);
|
|
4988
5106
|
var getLogShape = {
|
|
4989
|
-
log_id:
|
|
4990
|
-
path_format:
|
|
4991
|
-
created_at:
|
|
4992
|
-
type:
|
|
5107
|
+
log_id: z14.string().describe("Gateway log ID to retrieve"),
|
|
5108
|
+
path_format: z14.enum(["v1", "v2"]).optional().describe("Log storage path format; defaults to v1"),
|
|
5109
|
+
created_at: z14.iso.datetime({ offset: true }).optional().describe("Log creation timestamp in ISO 8601 format; required for v2"),
|
|
5110
|
+
type: z14.enum(["hooks"]).optional().describe("Set to hooks when retrieving a hook execution log")
|
|
4993
5111
|
};
|
|
4994
|
-
var getLogSchema =
|
|
5112
|
+
var getLogSchema = z14.object(getLogShape).superRefine((input, context) => {
|
|
4995
5113
|
if (input.path_format === "v2" && input.created_at === void 0) {
|
|
4996
5114
|
context.addIssue({
|
|
4997
5115
|
code: "custom",
|
|
@@ -5002,67 +5120,67 @@ var getLogSchema = z13.object(getLogShape).superRefine((input, context) => {
|
|
|
5002
5120
|
});
|
|
5003
5121
|
var LOGGING_TOOL_SCHEMAS = {
|
|
5004
5122
|
getLogExportFieldRestrictions: {
|
|
5005
|
-
workspace_id:
|
|
5123
|
+
workspace_id: z14.string().describe("Workspace ID whose export field restrictions should be read")
|
|
5006
5124
|
},
|
|
5007
5125
|
insertLog: {
|
|
5008
|
-
request_url:
|
|
5009
|
-
request_provider:
|
|
5010
|
-
request_method:
|
|
5011
|
-
request_headers:
|
|
5012
|
-
request_body:
|
|
5013
|
-
response_status:
|
|
5014
|
-
response_headers:
|
|
5015
|
-
response_body:
|
|
5016
|
-
response_time:
|
|
5017
|
-
streaming_mode:
|
|
5018
|
-
metadata_organization:
|
|
5019
|
-
metadata_user:
|
|
5020
|
-
metadata_trace_id:
|
|
5021
|
-
metadata_span_id:
|
|
5022
|
-
metadata_span_name:
|
|
5023
|
-
metadata_parent_span_id:
|
|
5024
|
-
metadata_custom:
|
|
5126
|
+
request_url: z14.string().optional().describe("The endpoint URL being called"),
|
|
5127
|
+
request_provider: z14.string().optional().describe("AI provider name (e.g., 'openai', 'anthropic')"),
|
|
5128
|
+
request_method: z14.string().optional().default("post").describe("HTTP method used (defaults to 'post')"),
|
|
5129
|
+
request_headers: z14.record(z14.string(), z14.string()).optional().describe("Request headers as key-value pairs"),
|
|
5130
|
+
request_body: z14.record(z14.string(), z14.unknown()).optional().describe("Request payload/body"),
|
|
5131
|
+
response_status: z14.coerce.number().optional().default(200).describe("HTTP response status code (defaults to 200)"),
|
|
5132
|
+
response_headers: z14.record(z14.string(), z14.string()).optional().describe("Response headers as key-value pairs"),
|
|
5133
|
+
response_body: z14.record(z14.string(), z14.unknown()).optional().describe("Response payload/body"),
|
|
5134
|
+
response_time: z14.coerce.number().optional().describe("Response latency in milliseconds"),
|
|
5135
|
+
streaming_mode: z14.boolean().optional().default(false).describe("Whether the response was streamed"),
|
|
5136
|
+
metadata_organization: z14.string().optional().describe("Organization identifier for the log"),
|
|
5137
|
+
metadata_user: z14.string().optional().describe("User identifier for the log"),
|
|
5138
|
+
metadata_trace_id: z14.string().optional().describe("Trace ID for distributed tracing"),
|
|
5139
|
+
metadata_span_id: z14.string().optional().describe("Span ID for tracing"),
|
|
5140
|
+
metadata_span_name: z14.string().optional().describe("Span name for tracing"),
|
|
5141
|
+
metadata_parent_span_id: z14.string().optional().describe("Parent span ID for tracing"),
|
|
5142
|
+
metadata_custom: z14.record(z14.string(), z14.unknown()).optional().describe("Additional custom metadata key-value pairs")
|
|
5025
5143
|
},
|
|
5026
5144
|
createLogExport: {
|
|
5027
|
-
workspace_id:
|
|
5028
|
-
description:
|
|
5029
|
-
time_min:
|
|
5145
|
+
workspace_id: z14.string().optional().describe("Workspace ID for the export"),
|
|
5146
|
+
description: z14.string().optional().describe("Human-readable description for the export job"),
|
|
5147
|
+
time_min: z14.string().describe(
|
|
5030
5148
|
"Minimum time filter in date format (e.g., '2024-01-01' or ISO 8601)"
|
|
5031
5149
|
),
|
|
5032
|
-
time_max:
|
|
5150
|
+
time_max: z14.string().describe(
|
|
5033
5151
|
"Maximum time filter in date format (e.g., '2024-01-31' or ISO 8601)"
|
|
5034
5152
|
),
|
|
5035
|
-
cost_min:
|
|
5036
|
-
cost_max:
|
|
5037
|
-
total_units_min:
|
|
5038
|
-
total_units_max:
|
|
5039
|
-
ai_model:
|
|
5040
|
-
requested_fields:
|
|
5153
|
+
cost_min: z14.coerce.number().optional().describe("Minimum cost filter"),
|
|
5154
|
+
cost_max: z14.coerce.number().optional().describe("Maximum cost filter"),
|
|
5155
|
+
total_units_min: z14.coerce.number().optional().describe("Minimum total units (tokens) filter"),
|
|
5156
|
+
total_units_max: z14.coerce.number().optional().describe("Maximum total units (tokens) filter"),
|
|
5157
|
+
ai_model: z14.array(z14.string()).optional().describe("Filter by specific AI model names"),
|
|
5158
|
+
requested_fields: z14.array(logExportFieldSchema).describe(
|
|
5041
5159
|
"Fields to include in export: id, trace_id, created_at, request, response, is_success, ai_org, ai_model, req_units, res_units, total_units, request_url, cost, cost_currency, response_time, response_status_code, mode, config, prompt_slug, metadata"
|
|
5042
5160
|
)
|
|
5043
5161
|
},
|
|
5044
5162
|
listLogExports: {
|
|
5045
|
-
workspace_id:
|
|
5163
|
+
workspace_id: z14.string().describe("Workspace ID to list exports for (required)")
|
|
5046
5164
|
},
|
|
5047
5165
|
getLogExport: {
|
|
5048
|
-
export_id:
|
|
5166
|
+
export_id: z14.string().describe("The unique ID of the log export")
|
|
5049
5167
|
},
|
|
5050
5168
|
startLogExport: {
|
|
5051
|
-
export_id:
|
|
5169
|
+
export_id: z14.string().describe("The unique ID of the log export to start")
|
|
5052
5170
|
},
|
|
5053
5171
|
cancelLogExport: {
|
|
5054
|
-
export_id:
|
|
5172
|
+
export_id: z14.string().describe("The unique ID of the log export to cancel")
|
|
5055
5173
|
},
|
|
5056
5174
|
downloadLogExport: {
|
|
5057
|
-
export_id:
|
|
5175
|
+
export_id: z14.string().describe("The unique ID of the log export to download")
|
|
5058
5176
|
},
|
|
5059
5177
|
updateLogExport: {
|
|
5060
|
-
export_id:
|
|
5061
|
-
workspace_id:
|
|
5062
|
-
time_of_generation_max:
|
|
5178
|
+
export_id: z14.string().describe("The unique ID of the log export to update"),
|
|
5179
|
+
workspace_id: z14.string().optional().describe("Workspace ID for the export"),
|
|
5180
|
+
time_of_generation_max: z14.string().optional().describe(
|
|
5063
5181
|
"Maximum time filter in date format (e.g., '2024-07-25' or ISO 8601)"
|
|
5064
5182
|
),
|
|
5065
|
-
requested_fields:
|
|
5183
|
+
requested_fields: z14.array(logExportFieldSchema).optional().describe(
|
|
5066
5184
|
"Fields to include in export: id, trace_id, created_at, request, response, is_success, ai_org, ai_model, req_units, res_units, total_units, request_url, cost, cost_currency, response_time, response_status_code, mode, config, prompt_slug, metadata"
|
|
5067
5185
|
)
|
|
5068
5186
|
}
|
|
@@ -5288,7 +5406,7 @@ function registerLoggingTools(server, service) {
|
|
|
5288
5406
|
}
|
|
5289
5407
|
|
|
5290
5408
|
// src/tools/mcp-integrations.tools.ts
|
|
5291
|
-
import { z as
|
|
5409
|
+
import { z as z15 } from "zod";
|
|
5292
5410
|
var mcpSecretMappingSchema = createSecretMappingSchema({
|
|
5293
5411
|
allowKeyTarget: false,
|
|
5294
5412
|
targetFieldDescription: "Configuration field resolved at runtime, such as configurations.oauth_metadata",
|
|
@@ -5298,10 +5416,10 @@ var mcpSecretMappingSchema = createSecretMappingSchema({
|
|
|
5298
5416
|
var mcpSecretMappingsSchema = uniqueSecretMappingsSchema(
|
|
5299
5417
|
mcpSecretMappingSchema
|
|
5300
5418
|
);
|
|
5301
|
-
var mcpConfigurationsSchema =
|
|
5419
|
+
var mcpConfigurationsSchema = z15.record(z15.string(), z15.unknown()).superRefine((value, ctx) => {
|
|
5302
5420
|
if ("custom_headers" in value && !isStringRecord(value.custom_headers)) {
|
|
5303
5421
|
ctx.addIssue({
|
|
5304
|
-
code:
|
|
5422
|
+
code: z15.ZodIssueCode.custom,
|
|
5305
5423
|
path: ["custom_headers"],
|
|
5306
5424
|
message: "configurations.custom_headers must be a string-to-string record"
|
|
5307
5425
|
});
|
|
@@ -5309,33 +5427,35 @@ var mcpConfigurationsSchema = z14.record(z14.string(), z14.unknown()).superRefin
|
|
|
5309
5427
|
});
|
|
5310
5428
|
var MCP_INTEGRATIONS_TOOL_SCHEMAS = {
|
|
5311
5429
|
listMcpIntegrations: {
|
|
5312
|
-
current_page:
|
|
5313
|
-
page_size:
|
|
5314
|
-
|
|
5315
|
-
|
|
5316
|
-
|
|
5430
|
+
current_page: CurrentPageSchema,
|
|
5431
|
+
page_size: pageSizeSchema(1e3).describe(
|
|
5432
|
+
"Number of results per page (max 1000)"
|
|
5433
|
+
),
|
|
5434
|
+
workspace_id: z15.string().optional().describe("Filter by workspace ID"),
|
|
5435
|
+
organisation_id: z15.string().optional().describe("Filter by organisation UUID"),
|
|
5436
|
+
type: z15.enum(["workspace", "organisation", "all"]).optional().describe(
|
|
5317
5437
|
"Filter by workspace, organisation, or all integration ownership"
|
|
5318
5438
|
),
|
|
5319
|
-
search:
|
|
5439
|
+
search: z15.string().optional().describe("Search integrations by name")
|
|
5320
5440
|
},
|
|
5321
5441
|
createMcpIntegration: {
|
|
5322
|
-
name:
|
|
5323
|
-
url:
|
|
5324
|
-
auth_type:
|
|
5442
|
+
name: z15.string().describe("Display name for the MCP integration"),
|
|
5443
|
+
url: z15.string().describe("URL endpoint of the MCP server to integrate"),
|
|
5444
|
+
auth_type: z15.string().min(1).describe(
|
|
5325
5445
|
"Authentication type. Current examples are 'none', 'headers' (custom headers), and 'oauth_auto' (OAuth); Portkey may accept additional values."
|
|
5326
5446
|
),
|
|
5327
|
-
transport:
|
|
5447
|
+
transport: z15.enum(["http", "sse"]).describe(
|
|
5328
5448
|
"MCP transport protocol: 'http' (streamable HTTP) or 'sse' (server-sent events)"
|
|
5329
5449
|
),
|
|
5330
|
-
slug:
|
|
5331
|
-
description:
|
|
5332
|
-
custom_headers:
|
|
5450
|
+
slug: z15.string().optional().describe("Custom slug. Auto-generated if omitted"),
|
|
5451
|
+
description: z15.string().optional().describe("Description of the MCP integration"),
|
|
5452
|
+
custom_headers: z15.record(z15.string(), z15.string()).optional().describe(
|
|
5333
5453
|
'Custom headers for authentication (e.g. { "Authorization": "Bearer xxx" }). Sent via configurations.custom_headers'
|
|
5334
5454
|
),
|
|
5335
5455
|
configurations: mcpConfigurationsSchema.optional().describe(
|
|
5336
5456
|
"Additional documented or forward-compatible configuration fields. For headers auth, configurations.custom_headers is a string-to-string header map."
|
|
5337
5457
|
),
|
|
5338
|
-
workspace_id:
|
|
5458
|
+
workspace_id: z15.string().optional().describe(
|
|
5339
5459
|
"Workspace ID \u2014 required when using organization admin API keys"
|
|
5340
5460
|
),
|
|
5341
5461
|
secret_mappings: mcpSecretMappingsSchema.optional().describe(
|
|
@@ -5343,18 +5463,18 @@ var MCP_INTEGRATIONS_TOOL_SCHEMAS = {
|
|
|
5343
5463
|
)
|
|
5344
5464
|
},
|
|
5345
5465
|
getMcpIntegration: {
|
|
5346
|
-
id:
|
|
5466
|
+
id: z15.string().describe("The MCP integration ID or slug to retrieve")
|
|
5347
5467
|
},
|
|
5348
5468
|
updateMcpIntegration: {
|
|
5349
|
-
id:
|
|
5350
|
-
name:
|
|
5351
|
-
description:
|
|
5352
|
-
url:
|
|
5353
|
-
auth_type:
|
|
5469
|
+
id: z15.string().describe("The MCP integration ID or slug to update"),
|
|
5470
|
+
name: z15.string().optional().describe("New display name"),
|
|
5471
|
+
description: z15.string().optional().describe("New description"),
|
|
5472
|
+
url: z15.string().optional().describe("New URL endpoint"),
|
|
5473
|
+
auth_type: z15.string().min(1).optional().describe(
|
|
5354
5474
|
"New authentication type. Current examples are 'none', 'headers' (custom headers), and 'oauth_auto' (OAuth); Portkey may accept additional values."
|
|
5355
5475
|
),
|
|
5356
|
-
transport:
|
|
5357
|
-
custom_headers:
|
|
5476
|
+
transport: z15.enum(["http", "sse"]).optional().describe("New transport protocol"),
|
|
5477
|
+
custom_headers: z15.record(z15.string(), z15.string()).optional().describe(
|
|
5358
5478
|
"New custom headers for authentication. Sent via configurations.custom_headers"
|
|
5359
5479
|
),
|
|
5360
5480
|
configurations: mcpConfigurationsSchema.optional().describe(
|
|
@@ -5365,50 +5485,50 @@ var MCP_INTEGRATIONS_TOOL_SCHEMAS = {
|
|
|
5365
5485
|
)
|
|
5366
5486
|
},
|
|
5367
5487
|
deleteMcpIntegration: {
|
|
5368
|
-
id:
|
|
5488
|
+
id: z15.string().describe("The MCP integration ID or slug to delete")
|
|
5369
5489
|
},
|
|
5370
5490
|
getMcpIntegrationMetadata: {
|
|
5371
|
-
id:
|
|
5491
|
+
id: z15.string().describe("The MCP integration ID or slug")
|
|
5372
5492
|
},
|
|
5373
5493
|
listMcpIntegrationCapabilities: {
|
|
5374
|
-
id:
|
|
5494
|
+
id: z15.string().describe("The MCP integration ID or slug")
|
|
5375
5495
|
},
|
|
5376
5496
|
updateMcpIntegrationCapabilities: {
|
|
5377
|
-
id:
|
|
5378
|
-
capabilities:
|
|
5379
|
-
|
|
5380
|
-
name:
|
|
5381
|
-
type:
|
|
5382
|
-
enabled:
|
|
5497
|
+
id: z15.string().describe("The MCP integration ID or slug"),
|
|
5498
|
+
capabilities: z15.array(
|
|
5499
|
+
z15.object({
|
|
5500
|
+
name: z15.string().describe("Capability name"),
|
|
5501
|
+
type: z15.enum(["tool", "prompt", "resource"]).describe("Capability type"),
|
|
5502
|
+
enabled: z15.boolean().describe("Whether to enable the capability")
|
|
5383
5503
|
})
|
|
5384
5504
|
).min(1).describe("Array of capability updates")
|
|
5385
5505
|
},
|
|
5386
5506
|
listMcpIntegrationWorkspaces: {
|
|
5387
|
-
id:
|
|
5507
|
+
id: z15.string().describe("The MCP integration ID or slug")
|
|
5388
5508
|
},
|
|
5389
5509
|
updateMcpIntegrationWorkspaces: {
|
|
5390
|
-
id:
|
|
5391
|
-
workspaces:
|
|
5392
|
-
|
|
5393
|
-
id:
|
|
5394
|
-
enabled:
|
|
5510
|
+
id: z15.string().describe("The MCP integration ID or slug"),
|
|
5511
|
+
workspaces: z15.array(
|
|
5512
|
+
z15.object({
|
|
5513
|
+
id: z15.string().describe("Workspace ID"),
|
|
5514
|
+
enabled: z15.boolean().describe("Whether workspace has access")
|
|
5395
5515
|
})
|
|
5396
5516
|
).min(1).describe("Array of workspace access updates")
|
|
5397
5517
|
}
|
|
5398
5518
|
};
|
|
5399
|
-
var createMcpIntegrationSchema =
|
|
5519
|
+
var createMcpIntegrationSchema = z15.object(MCP_INTEGRATIONS_TOOL_SCHEMAS.createMcpIntegration).superRefine((value, ctx) => {
|
|
5400
5520
|
const configuredHeaders = value.configurations?.custom_headers;
|
|
5401
5521
|
if (value.auth_type === "headers" && (!value.custom_headers || Object.keys(value.custom_headers).length === 0) && (!isStringRecord(configuredHeaders) || Object.keys(configuredHeaders).length === 0) && !value.secret_mappings?.some(
|
|
5402
5522
|
(mapping) => mapping.target_field === "configurations.custom_headers"
|
|
5403
5523
|
)) {
|
|
5404
5524
|
ctx.addIssue({
|
|
5405
|
-
code:
|
|
5525
|
+
code: z15.ZodIssueCode.custom,
|
|
5406
5526
|
path: [],
|
|
5407
5527
|
message: "custom_headers, configurations.custom_headers, or secret_mappings targeting configurations.custom_headers must be provided when auth_type is 'headers'"
|
|
5408
5528
|
});
|
|
5409
5529
|
}
|
|
5410
5530
|
});
|
|
5411
|
-
var updateMcpIntegrationSchema =
|
|
5531
|
+
var updateMcpIntegrationSchema = z15.object(
|
|
5412
5532
|
MCP_INTEGRATIONS_TOOL_SCHEMAS.updateMcpIntegration
|
|
5413
5533
|
);
|
|
5414
5534
|
function isRecord2(value) {
|
|
@@ -5647,79 +5767,83 @@ function registerMcpIntegrationsTools(server, service) {
|
|
|
5647
5767
|
}
|
|
5648
5768
|
|
|
5649
5769
|
// src/tools/mcp-servers.tools.ts
|
|
5650
|
-
import { z as
|
|
5770
|
+
import { z as z16 } from "zod";
|
|
5651
5771
|
var MCP_SERVERS_TOOL_SCHEMAS = {
|
|
5652
5772
|
listMcpServers: {
|
|
5653
|
-
current_page:
|
|
5654
|
-
page_size:
|
|
5655
|
-
workspace_id:
|
|
5773
|
+
current_page: CurrentPageSchema,
|
|
5774
|
+
page_size: PageSizeSchema.describe("Number of results per page (max 100)"),
|
|
5775
|
+
workspace_id: z16.string().optional().describe("Filter by workspace ID")
|
|
5656
5776
|
},
|
|
5657
5777
|
createMcpServer: {
|
|
5658
|
-
name:
|
|
5659
|
-
mcp_integration_id:
|
|
5660
|
-
slug:
|
|
5661
|
-
description:
|
|
5778
|
+
name: z16.string().describe("Display name for the MCP server"),
|
|
5779
|
+
mcp_integration_id: z16.string().describe("ID or slug of the MCP integration this server belongs to"),
|
|
5780
|
+
slug: z16.string().optional().describe("Custom slug. Auto-generated if omitted"),
|
|
5781
|
+
description: z16.string().optional().describe("Description of the MCP server")
|
|
5662
5782
|
},
|
|
5663
5783
|
getMcpServer: {
|
|
5664
|
-
id:
|
|
5784
|
+
id: z16.string().describe("The MCP server ID or slug to retrieve")
|
|
5665
5785
|
},
|
|
5666
5786
|
updateMcpServer: {
|
|
5667
|
-
id:
|
|
5668
|
-
name:
|
|
5669
|
-
description:
|
|
5787
|
+
id: z16.string().describe("The MCP server ID or slug to update"),
|
|
5788
|
+
name: z16.string().optional().describe("New display name"),
|
|
5789
|
+
description: z16.string().optional().describe("New description")
|
|
5670
5790
|
},
|
|
5671
5791
|
deleteMcpServer: {
|
|
5672
|
-
id:
|
|
5792
|
+
id: z16.string().describe("The MCP server ID or slug to delete")
|
|
5673
5793
|
},
|
|
5674
5794
|
testMcpServer: {
|
|
5675
|
-
id:
|
|
5795
|
+
id: z16.string().describe("The MCP server ID or slug to test")
|
|
5676
5796
|
},
|
|
5677
5797
|
listMcpServerCapabilities: {
|
|
5678
|
-
id:
|
|
5679
|
-
current_page:
|
|
5680
|
-
page_size:
|
|
5798
|
+
id: z16.string().describe("The MCP server ID or slug"),
|
|
5799
|
+
current_page: CurrentPageSchema,
|
|
5800
|
+
page_size: PageSizeSchema.describe("Number of results per page (max 100)")
|
|
5681
5801
|
},
|
|
5682
5802
|
updateMcpServerCapabilities: {
|
|
5683
|
-
id:
|
|
5684
|
-
capabilities:
|
|
5685
|
-
|
|
5686
|
-
name:
|
|
5687
|
-
type:
|
|
5688
|
-
enabled:
|
|
5803
|
+
id: z16.string().describe("The MCP server ID or slug"),
|
|
5804
|
+
capabilities: z16.array(
|
|
5805
|
+
z16.object({
|
|
5806
|
+
name: z16.string().describe("Capability name"),
|
|
5807
|
+
type: z16.enum(["tool", "prompt", "resource"]).describe("Capability type"),
|
|
5808
|
+
enabled: z16.boolean().describe("Whether to enable the capability")
|
|
5689
5809
|
})
|
|
5690
5810
|
).min(1).describe("Array of capability updates")
|
|
5691
5811
|
},
|
|
5692
5812
|
listMcpServerUserAccess: {
|
|
5693
|
-
id:
|
|
5694
|
-
current_page:
|
|
5695
|
-
page_size:
|
|
5813
|
+
id: z16.string().describe("The MCP server ID or slug"),
|
|
5814
|
+
current_page: CurrentPageSchema,
|
|
5815
|
+
page_size: PageSizeSchema.describe("Number of results per page (max 100)")
|
|
5696
5816
|
},
|
|
5697
5817
|
updateMcpServerUserAccess: {
|
|
5698
|
-
id:
|
|
5699
|
-
users:
|
|
5700
|
-
|
|
5701
|
-
user_id:
|
|
5702
|
-
enabled:
|
|
5818
|
+
id: z16.string().describe("The MCP server ID or slug"),
|
|
5819
|
+
users: z16.array(
|
|
5820
|
+
z16.object({
|
|
5821
|
+
user_id: z16.string().describe("User ID"),
|
|
5822
|
+
enabled: z16.boolean().describe("Whether user has access")
|
|
5703
5823
|
})
|
|
5704
5824
|
).min(1).describe("Array of user access updates")
|
|
5705
5825
|
},
|
|
5706
5826
|
listMcpServerConnections: {
|
|
5707
|
-
id:
|
|
5708
|
-
user_id:
|
|
5827
|
+
id: z16.string().describe("MCP server ID or slug whose connections to list"),
|
|
5828
|
+
user_id: z16.string().uuid().optional().describe(
|
|
5709
5829
|
"User UUID to filter; user-scoped keys default to their own user when omitted"
|
|
5710
5830
|
),
|
|
5711
|
-
workspace_id:
|
|
5831
|
+
workspace_id: z16.string().optional().describe(
|
|
5712
5832
|
"Workspace ID or slug; required with an organisation admin API key"
|
|
5713
5833
|
),
|
|
5714
|
-
current_page:
|
|
5715
|
-
|
|
5834
|
+
current_page: CurrentPageSchema.describe(
|
|
5835
|
+
"Zero-based results page; defaults to 0"
|
|
5836
|
+
),
|
|
5837
|
+
page_size: pageSizeSchema(500).describe(
|
|
5838
|
+
"Connections per page, from 1 through 500; defaults to 100"
|
|
5839
|
+
)
|
|
5716
5840
|
},
|
|
5717
5841
|
disconnectMcpServerConnection: {
|
|
5718
|
-
id:
|
|
5719
|
-
user_id:
|
|
5842
|
+
id: z16.string().describe("MCP server ID or slug containing the active connection"),
|
|
5843
|
+
user_id: z16.string().uuid().optional().describe(
|
|
5720
5844
|
"User UUID to disconnect; required with service keys and derived from user keys when omitted"
|
|
5721
5845
|
),
|
|
5722
|
-
workspace_id:
|
|
5846
|
+
workspace_id: z16.string().optional().describe(
|
|
5723
5847
|
"Workspace ID or slug; required with an organisation admin API key"
|
|
5724
5848
|
)
|
|
5725
5849
|
}
|
|
@@ -5946,40 +6070,40 @@ function registerMcpServersTools(server, service) {
|
|
|
5946
6070
|
}
|
|
5947
6071
|
|
|
5948
6072
|
// src/tools/partials.tools.ts
|
|
5949
|
-
import { z as
|
|
6073
|
+
import { z as z17 } from "zod";
|
|
5950
6074
|
var PARTIALS_TOOL_SCHEMAS = {
|
|
5951
6075
|
createPromptPartial: {
|
|
5952
|
-
name:
|
|
5953
|
-
string:
|
|
5954
|
-
workspace_id:
|
|
6076
|
+
name: z17.string().describe("Display name for the partial"),
|
|
6077
|
+
string: z17.string().describe("The partial content/template string"),
|
|
6078
|
+
workspace_id: z17.string().optional().describe(
|
|
5955
6079
|
"Workspace ID to create partial in (required for org-level API keys)"
|
|
5956
6080
|
),
|
|
5957
|
-
version_description:
|
|
6081
|
+
version_description: z17.string().optional().describe("Description for this version")
|
|
5958
6082
|
},
|
|
5959
6083
|
listPromptPartials: {
|
|
5960
|
-
collection_id:
|
|
6084
|
+
collection_id: z17.string().optional().describe(
|
|
5961
6085
|
"Filter by collection ID. Optional \u2014 omit to list all partials across collections"
|
|
5962
6086
|
)
|
|
5963
6087
|
},
|
|
5964
6088
|
getPromptPartial: {
|
|
5965
|
-
prompt_partial_id:
|
|
6089
|
+
prompt_partial_id: z17.string().describe("Prompt partial ID or slug to retrieve")
|
|
5966
6090
|
},
|
|
5967
6091
|
updatePromptPartial: {
|
|
5968
|
-
prompt_partial_id:
|
|
5969
|
-
name:
|
|
5970
|
-
string:
|
|
5971
|
-
description:
|
|
5972
|
-
status:
|
|
6092
|
+
prompt_partial_id: z17.string().describe("Prompt partial ID or slug to update"),
|
|
6093
|
+
name: z17.string().optional().describe("New display name for the partial"),
|
|
6094
|
+
string: z17.string().optional().describe("New content for the partial"),
|
|
6095
|
+
description: z17.string().optional().describe("Description for this version"),
|
|
6096
|
+
status: z17.enum(["active", "archived"]).optional().describe("New status for the partial")
|
|
5973
6097
|
},
|
|
5974
6098
|
deletePromptPartial: {
|
|
5975
|
-
prompt_partial_id:
|
|
6099
|
+
prompt_partial_id: z17.string().describe("Prompt partial ID or slug to delete")
|
|
5976
6100
|
},
|
|
5977
6101
|
listPartialVersions: {
|
|
5978
|
-
prompt_partial_id:
|
|
6102
|
+
prompt_partial_id: z17.string().describe("Prompt partial ID or slug to list versions for")
|
|
5979
6103
|
},
|
|
5980
6104
|
publishPartial: {
|
|
5981
|
-
prompt_partial_id:
|
|
5982
|
-
version:
|
|
6105
|
+
prompt_partial_id: z17.string().describe("Prompt partial ID or slug"),
|
|
6106
|
+
version: z17.coerce.number().positive().describe("Version number to publish as default")
|
|
5983
6107
|
}
|
|
5984
6108
|
};
|
|
5985
6109
|
function registerPartialsTools(server, service) {
|
|
@@ -6117,77 +6241,6 @@ function registerPartialsTools(server, service) {
|
|
|
6117
6241
|
|
|
6118
6242
|
// src/tools/prompts.tools.ts
|
|
6119
6243
|
import { z as z18 } from "zod";
|
|
6120
|
-
|
|
6121
|
-
// src/lib/schemas.ts
|
|
6122
|
-
import { z as z17 } from "zod";
|
|
6123
|
-
var PromptFunctionSchema = z17.object({
|
|
6124
|
-
name: z17.string().describe("Function name"),
|
|
6125
|
-
description: z17.string().optional().describe("Function description"),
|
|
6126
|
-
parameters: z17.record(z17.string(), z17.unknown()).optional().describe("Function parameters schema")
|
|
6127
|
-
});
|
|
6128
|
-
var PromptToolSchema = z17.object({
|
|
6129
|
-
type: z17.literal("function").describe("Tool type"),
|
|
6130
|
-
function: PromptFunctionSchema.describe("Function definition")
|
|
6131
|
-
});
|
|
6132
|
-
var HyperparametersSchema = z17.object({
|
|
6133
|
-
max_tokens: z17.coerce.number().positive().optional().describe("Maximum tokens to generate"),
|
|
6134
|
-
temperature: z17.coerce.number().min(0).max(2).optional().describe("Sampling temperature (0-2)"),
|
|
6135
|
-
top_p: z17.coerce.number().min(0).max(1).optional().describe("Top-p sampling (0-1)"),
|
|
6136
|
-
top_k: z17.coerce.number().positive().optional().describe("Top-k sampling"),
|
|
6137
|
-
presence_penalty: z17.coerce.number().min(-2).max(2).optional().describe("Presence penalty (-2 to 2)"),
|
|
6138
|
-
frequency_penalty: z17.coerce.number().min(-2).max(2).optional().describe("Frequency penalty (-2 to 2)"),
|
|
6139
|
-
stop: z17.array(z17.string()).optional().describe("Stop sequences")
|
|
6140
|
-
});
|
|
6141
|
-
var PromptAppIdentifierSchema = z17.string().min(1).describe(
|
|
6142
|
-
"App identifier (REQUIRED). Use your deployed app name, for example 'hourlink' or 'support-console'."
|
|
6143
|
-
);
|
|
6144
|
-
var PromptEnvironmentIdentifierSchema = z17.string().min(1).describe(
|
|
6145
|
-
"Environment identifier (REQUIRED). Use your environment name, for example 'dev', 'staging', 'prod', or 'qa'."
|
|
6146
|
-
);
|
|
6147
|
-
var BillingMetadataSchema = z17.object({
|
|
6148
|
-
client_id: z17.string().describe("Client ID for billing attribution (REQUIRED)"),
|
|
6149
|
-
app: PromptAppIdentifierSchema,
|
|
6150
|
-
env: PromptEnvironmentIdentifierSchema,
|
|
6151
|
-
project_id: z17.string().optional().describe("Project ID for granular billing"),
|
|
6152
|
-
feature: z17.string().optional().describe("Feature name for tracking")
|
|
6153
|
-
});
|
|
6154
|
-
var ToolChoiceSchema = z17.object({
|
|
6155
|
-
mode: z17.enum(["auto", "none", "function"]).describe(
|
|
6156
|
-
"Tool choice mode: auto lets the model decide, none disables tool use, function forces one function by name"
|
|
6157
|
-
),
|
|
6158
|
-
function_name: z17.string().optional().describe("Required when mode is 'function'; ignored otherwise")
|
|
6159
|
-
}).superRefine((value, ctx) => {
|
|
6160
|
-
if (value.mode === "function" && !value.function_name) {
|
|
6161
|
-
ctx.addIssue({
|
|
6162
|
-
code: z17.ZodIssueCode.custom,
|
|
6163
|
-
path: ["function_name"],
|
|
6164
|
-
message: "function_name is required when mode is 'function'"
|
|
6165
|
-
});
|
|
6166
|
-
}
|
|
6167
|
-
if (value.mode !== "function" && value.function_name !== void 0) {
|
|
6168
|
-
ctx.addIssue({
|
|
6169
|
-
code: z17.ZodIssueCode.custom,
|
|
6170
|
-
path: ["function_name"],
|
|
6171
|
-
message: "function_name is only allowed when mode is 'function'"
|
|
6172
|
-
});
|
|
6173
|
-
}
|
|
6174
|
-
});
|
|
6175
|
-
function toPromptToolChoice(toolChoice) {
|
|
6176
|
-
if (!toolChoice) {
|
|
6177
|
-
return void 0;
|
|
6178
|
-
}
|
|
6179
|
-
if (toolChoice.mode === "function") {
|
|
6180
|
-
return {
|
|
6181
|
-
type: "function",
|
|
6182
|
-
function: {
|
|
6183
|
-
name: toolChoice.function_name
|
|
6184
|
-
}
|
|
6185
|
-
};
|
|
6186
|
-
}
|
|
6187
|
-
return toolChoice.mode;
|
|
6188
|
-
}
|
|
6189
|
-
|
|
6190
|
-
// src/tools/prompts.tools.ts
|
|
6191
6244
|
var PROMPT_VARIABLES_SCHEMA = z18.record(z18.string(), z18.union([z18.string(), z18.number(), z18.boolean()])).describe("Variable values to substitute into the template");
|
|
6192
6245
|
var PROMPT_TEMPLATE_CONTENT_BLOCK_SCHEMA = z18.object({
|
|
6193
6246
|
type: z18.string().describe("Content block type"),
|
|
@@ -6234,8 +6287,8 @@ var PROMPTS_TOOL_SCHEMAS = {
|
|
|
6234
6287
|
),
|
|
6235
6288
|
workspace_id: z18.string().optional().describe("Filter by workspace ID"),
|
|
6236
6289
|
search: z18.string().optional().describe("Search prompts by name"),
|
|
6237
|
-
current_page:
|
|
6238
|
-
page_size:
|
|
6290
|
+
current_page: CurrentPageSchema,
|
|
6291
|
+
page_size: PageSizeSchema
|
|
6239
6292
|
},
|
|
6240
6293
|
getPrompt: {
|
|
6241
6294
|
prompt_id: z18.string().describe("Prompt ID or slug to retrieve")
|
|
@@ -6410,11 +6463,12 @@ function formatPromptVersion(version) {
|
|
|
6410
6463
|
};
|
|
6411
6464
|
}
|
|
6412
6465
|
function formatPromptListResponse(prompts, params) {
|
|
6413
|
-
const
|
|
6466
|
+
const paginated = params.current_page !== void 0;
|
|
6467
|
+
const currentPage = params.current_page ?? 0;
|
|
6414
6468
|
const returnedCount = prompts.data.length;
|
|
6415
6469
|
const pageSize = params.page_size ?? returnedCount;
|
|
6416
|
-
const nextOffset = currentPage * pageSize;
|
|
6417
|
-
const hasMore = returnedCount > 0 && nextOffset < prompts.total;
|
|
6470
|
+
const nextOffset = (currentPage + 1) * pageSize;
|
|
6471
|
+
const hasMore = paginated && returnedCount > 0 && nextOffset < prompts.total;
|
|
6418
6472
|
return {
|
|
6419
6473
|
total: prompts.total,
|
|
6420
6474
|
current_page: currentPage,
|
|
@@ -6815,8 +6869,10 @@ function registerPromptsTools(server, service) {
|
|
|
6815
6869
|
import { z as z19 } from "zod";
|
|
6816
6870
|
var PROVIDERS_TOOL_SCHEMAS = {
|
|
6817
6871
|
listProviders: {
|
|
6818
|
-
current_page:
|
|
6819
|
-
page_size:
|
|
6872
|
+
current_page: CurrentPageSchema,
|
|
6873
|
+
page_size: PageSizeSchema.describe(
|
|
6874
|
+
"Number of results per page (max 100, default 50)"
|
|
6875
|
+
),
|
|
6820
6876
|
workspace_id: z19.string().optional().describe(
|
|
6821
6877
|
"Workspace ID - required when using organization admin keys, optional with workspace API keys"
|
|
6822
6878
|
)
|
|
@@ -7192,8 +7248,12 @@ var SECRET_REFERENCE_TOOL_SCHEMAS = {
|
|
|
7192
7248
|
),
|
|
7193
7249
|
tags: tagsSchema.optional().describe("Return references matching these tags"),
|
|
7194
7250
|
search: z20.string().min(1).max(255).optional().describe("Search references by name"),
|
|
7195
|
-
current_page:
|
|
7196
|
-
|
|
7251
|
+
current_page: CurrentPageSchema.describe(
|
|
7252
|
+
"Zero-based page number; defaults to 0"
|
|
7253
|
+
),
|
|
7254
|
+
page_size: PageSizeSchema.describe(
|
|
7255
|
+
"References per page, from 1 to 100; defaults to 20"
|
|
7256
|
+
)
|
|
7197
7257
|
},
|
|
7198
7258
|
get: {
|
|
7199
7259
|
id: z20.string().min(1).describe("Secret Reference UUID or slug")
|
|
@@ -7449,8 +7509,8 @@ function registerTracingTools(server, service) {
|
|
|
7449
7509
|
import { z as z22 } from "zod";
|
|
7450
7510
|
var USERS_TOOL_SCHEMAS = {
|
|
7451
7511
|
listAllUsers: {
|
|
7452
|
-
current_page:
|
|
7453
|
-
page_size:
|
|
7512
|
+
current_page: CurrentPageSchema,
|
|
7513
|
+
page_size: PageSizeSchema.describe("Number of results per page (max 100)"),
|
|
7454
7514
|
role: z22.enum(["admin", "member", "owner"]).optional().describe("Filter by organisation role"),
|
|
7455
7515
|
email: z22.string().email().optional().describe("Filter by exact email")
|
|
7456
7516
|
},
|
|
@@ -7493,7 +7553,7 @@ var USERS_TOOL_SCHEMAS = {
|
|
|
7493
7553
|
cost_max: z22.coerce.number().positive().optional().describe("Maximum cost in cents to filter by"),
|
|
7494
7554
|
status_code: z22.string().optional().describe("Filter by specific HTTP status codes (comma-separated)"),
|
|
7495
7555
|
virtual_keys: z22.string().optional().describe("Filter by specific virtual key slugs (comma-separated)"),
|
|
7496
|
-
page_size:
|
|
7556
|
+
page_size: PageSizeSchema.describe("Number of results per page (max 100)")
|
|
7497
7557
|
},
|
|
7498
7558
|
getUser: {
|
|
7499
7559
|
user_id: z22.string().describe("The user ID to retrieve")
|
|
@@ -7508,8 +7568,8 @@ var USERS_TOOL_SCHEMAS = {
|
|
|
7508
7568
|
user_id: z22.string().describe("The user ID to delete")
|
|
7509
7569
|
},
|
|
7510
7570
|
listUserInvites: {
|
|
7511
|
-
current_page:
|
|
7512
|
-
page_size:
|
|
7571
|
+
current_page: CurrentPageSchema,
|
|
7572
|
+
page_size: PageSizeSchema.describe("Number of results per page (max 100)"),
|
|
7513
7573
|
role: z22.enum(["admin", "member"]).optional().describe("Filter invitations by organisation role"),
|
|
7514
7574
|
email: z22.string().email().optional().describe("Filter by invited email"),
|
|
7515
7575
|
status: z22.enum(["pending", "cancelled", "accepted", "expired"]).optional().describe("Filter invitations by lifecycle status")
|
|
@@ -7720,8 +7780,10 @@ var createScimWorkspaceMappingSchema = z23.object(createScimWorkspaceMappingShap
|
|
|
7720
7780
|
});
|
|
7721
7781
|
var WORKSPACES_TOOL_SCHEMAS = {
|
|
7722
7782
|
listWorkspaces: {
|
|
7723
|
-
page_size:
|
|
7724
|
-
|
|
7783
|
+
page_size: PageSizeSchema.describe(
|
|
7784
|
+
"Number of workspaces to return per page (max 100)"
|
|
7785
|
+
),
|
|
7786
|
+
current_page: CurrentPageSchema,
|
|
7725
7787
|
name: z23.string().optional().describe("Case-sensitive name filter"),
|
|
7726
7788
|
exact_name: z23.string().optional().describe("Exact workspace name filter"),
|
|
7727
7789
|
status: z23.enum(["active", "archived"]).optional().describe("Filter by workspace lifecycle status")
|
|
@@ -7770,8 +7832,8 @@ var WORKSPACES_TOOL_SCHEMAS = {
|
|
|
7770
7832
|
},
|
|
7771
7833
|
listWorkspaceMembers: {
|
|
7772
7834
|
workspace_id: z23.string().describe("The workspace ID to list members for"),
|
|
7773
|
-
current_page:
|
|
7774
|
-
page_size:
|
|
7835
|
+
current_page: CurrentPageSchema.describe("Zero-based page number"),
|
|
7836
|
+
page_size: PageSizeSchema.describe("Number of members per page"),
|
|
7775
7837
|
role: z23.enum(["admin", "manager", "member"]).optional().describe("Filter by workspace role"),
|
|
7776
7838
|
email: z23.string().email().optional().describe("Filter by member email")
|
|
7777
7839
|
},
|
|
@@ -7805,9 +7867,9 @@ var WORKSPACES_TOOL_SCHEMAS = {
|
|
|
7805
7867
|
),
|
|
7806
7868
|
role: z23.enum(["admin", "member", "manager"]).optional().describe("Return only mappings that grant this workspace role"),
|
|
7807
7869
|
page: z23.coerce.number().int().nonnegative().optional().describe(
|
|
7808
|
-
"Zero-based results page to retrieve; the first page is 0.
|
|
7870
|
+
"Zero-based results page to retrieve; the first page is 0. These SCIM tools name the parameter page, not the current_page used by other list tools."
|
|
7809
7871
|
),
|
|
7810
|
-
page_size:
|
|
7872
|
+
page_size: PageSizeSchema.describe("Mappings per page, from 1 through 100")
|
|
7811
7873
|
},
|
|
7812
7874
|
deleteScimWorkspaceMapping: {
|
|
7813
7875
|
mapping_id: z23.string().describe("SCIM workspace mapping ID from list_scim_workspace_mappings")
|
|
@@ -7815,9 +7877,11 @@ var WORKSPACES_TOOL_SCHEMAS = {
|
|
|
7815
7877
|
listScimGroups: {
|
|
7816
7878
|
search: z23.string().optional().describe("Case-insensitive text to match against SCIM group names"),
|
|
7817
7879
|
page: z23.coerce.number().int().nonnegative().optional().describe(
|
|
7818
|
-
"Zero-based results page to retrieve; the first page is 0.
|
|
7880
|
+
"Zero-based results page to retrieve; the first page is 0. These SCIM tools name the parameter page, not the current_page used by other list tools."
|
|
7819
7881
|
),
|
|
7820
|
-
page_size:
|
|
7882
|
+
page_size: PageSizeSchema.describe(
|
|
7883
|
+
"SCIM groups per page, from 1 through 100"
|
|
7884
|
+
)
|
|
7821
7885
|
}
|
|
7822
7886
|
};
|
|
7823
7887
|
function formatWorkspaceDefaults(defaults) {
|