@promptlayer/mcp-server 1.11.0 → 1.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +3 -0
- package/README.md +57 -3
- package/build/client.d.ts +40 -21
- package/build/client.d.ts.map +1 -1
- package/build/client.js +47 -23
- package/build/client.js.map +1 -1
- package/build/handlers.d.ts.map +1 -1
- package/build/handlers.js +78 -23
- package/build/handlers.js.map +1 -1
- package/build/index.js +10 -5
- package/build/index.js.map +1 -1
- package/build/types.d.ts +2143 -749
- package/build/types.d.ts.map +1 -1
- package/build/types.js +588 -260
- package/build/types.js.map +1 -1
- package/build/utils.d.ts.map +1 -1
- package/build/utils.js +10 -1
- package/build/utils.js.map +1 -1
- package/gcp/app.yaml +1 -1
- package/gcp/package-lock.json +12 -12
- package/gcp/package.json +5 -3
- package/gcp/src/index.ts +101 -37
- package/package.json +6 -4
- package/src/client.ts +47 -24
- package/src/handlers.ts +150 -50
- package/src/index.ts +10 -5
- package/src/types.ts +644 -307
- package/src/utils.ts +8 -1
package/build/types.js
CHANGED
|
@@ -162,33 +162,7 @@ export const CreateSpansBulkArgsSchema = z.object({
|
|
|
162
162
|
spans: z.array(z.record(z.unknown())).describe("Array of span objects (each with name, context, kind, start_time, end_time, status, attributes, resource; optional: parent_id, log_request)"),
|
|
163
163
|
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
164
164
|
});
|
|
165
|
-
// ──
|
|
166
|
-
export const ListDatasetsArgsSchema = z.object({
|
|
167
|
-
page: z.number().int().optional().describe("Page number (default: 1)"),
|
|
168
|
-
per_page: z.number().int().optional().describe("Items per page (default: 10)"),
|
|
169
|
-
name: z.string().optional().describe("Filter by dataset group name (case-insensitive partial match)"),
|
|
170
|
-
status: z.enum(["active", "deleted", "all"]).optional().describe("Filter by status (default: 'active')"),
|
|
171
|
-
dataset_group_id: z.number().int().optional().describe("Filter by dataset group ID"),
|
|
172
|
-
prompt_id: z.number().int().optional().describe("Filter by prompt ID"),
|
|
173
|
-
prompt_version_id: z.number().int().optional().describe("Filter by prompt version ID"),
|
|
174
|
-
prompt_label_id: z.number().int().optional().describe("Filter by prompt label ID"),
|
|
175
|
-
report_id: z.number().int().optional().describe("Filter by report ID"),
|
|
176
|
-
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
177
|
-
});
|
|
178
|
-
// ── Create Dataset Group (POST /api/public/v2/dataset-groups) ────────────
|
|
179
|
-
export const CreateDatasetGroupArgsSchema = z.object({
|
|
180
|
-
name: z.string().optional().describe("Dataset group name (unique within workspace). Auto-generated if omitted."),
|
|
181
|
-
folder_id: z.number().int().optional().describe("Folder ID to place the dataset group into"),
|
|
182
|
-
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
183
|
-
});
|
|
184
|
-
// ── Create Dataset Version from File (POST /api/public/v2/dataset-versions/from-file)
|
|
185
|
-
export const CreateDatasetVersionFromFileArgsSchema = z.object({
|
|
186
|
-
dataset_group_id: z.number().int().describe("Dataset group ID"),
|
|
187
|
-
file_name: z.string().describe("File name with extension (e.g. 'data.csv' or 'data.json')"),
|
|
188
|
-
file_content_base64: z.string().describe("Base64-encoded file content"),
|
|
189
|
-
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
190
|
-
});
|
|
191
|
-
// ── Structured filter primitives (shared by request search + dataset-from-history) ──
|
|
165
|
+
// ── Structured filter primitives (shared by request search + Smart Table imports) ──
|
|
192
166
|
// NOTE: value/filters use loose types (z.unknown()) because the backend validates
|
|
193
167
|
// operator-field compatibility at runtime. This is tracked as a known exception in
|
|
194
168
|
// scripts/diff-endpoints.ts.
|
|
@@ -218,145 +192,6 @@ const StructuredFilterGroupSchema = z.object({
|
|
|
218
192
|
logic: z.enum(["AND", "OR"]).optional().describe("Logical operator (default: AND)"),
|
|
219
193
|
filters: z.array(z.union([StructuredFilterSchema, z.lazy(() => StructuredFilterGroupSchema)])).describe("Filters or nested filter groups"),
|
|
220
194
|
});
|
|
221
|
-
// ── Create Dataset Version from Filter Params (POST /api/public/v2/dataset-versions/from-filter-params)
|
|
222
|
-
export const CreateDatasetVersionFromFilterParamsArgsSchema = z.object({
|
|
223
|
-
dataset_group_id: z.number().int().describe("Dataset group ID to create the new version under"),
|
|
224
|
-
request_log_ids: z.array(z.number().int().positive()).optional().describe("Static snapshot mode: pin the dataset to an explicit list of request log IDs (capped at 50,000). " +
|
|
225
|
-
"≤50 IDs run synchronously; >50 are processed asynchronously. " +
|
|
226
|
-
"Datasets created this way are not refreshable."),
|
|
227
|
-
filter_group: StructuredFilterGroupSchema.optional().describe("Structured filter mode: same shape as search-request-logs (AND/OR groups of field/operator/value filters). " +
|
|
228
|
-
"Always processed asynchronously. Persisted on the dataset so refresh_dataset can replay it."),
|
|
229
|
-
q: z.string().optional().describe("Free-text search query applied alongside filter_group"),
|
|
230
|
-
sort_by: z.enum([
|
|
231
|
-
"request_start_time", "input_tokens", "output_tokens", "cost",
|
|
232
|
-
"latency_ms", "status", "turn_count", "tool_call_count",
|
|
233
|
-
]).optional().describe("Sort field"),
|
|
234
|
-
sort_order: z.enum(["asc", "desc"]).optional().describe("Sort direction (defaults to desc when sort_by is set)"),
|
|
235
|
-
variables_to_parse: z.array(z.string()).optional().describe("Input variable names to extract as dataset columns"),
|
|
236
|
-
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
237
|
-
});
|
|
238
|
-
// ── Get Dataset Rows (GET /api/public/v2/datasets/{dataset_id}/rows) ─────
|
|
239
|
-
export const GetDatasetRowsArgsSchema = z.object({
|
|
240
|
-
dataset_id: z.number().int().describe("The ID of the dataset to retrieve rows from"),
|
|
241
|
-
page: z.number().int().optional().describe("Page number (default: 1)"),
|
|
242
|
-
per_page: z.number().int().optional().describe("Rows per page (default: 10, max: 100)"),
|
|
243
|
-
q: z.string().optional().describe("Search query for filtering rows"),
|
|
244
|
-
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
245
|
-
});
|
|
246
|
-
// ── Create Draft Dataset Version (POST /api/public/v2/dataset-versions/create-draft) ─────
|
|
247
|
-
export const CreateDraftDatasetVersionArgsSchema = z.object({
|
|
248
|
-
dataset_group_id: z.number().int().describe("ID of the dataset group to create a draft version for"),
|
|
249
|
-
source_dataset_id: z.number().int().optional().describe("Optional ID of an existing dataset version to copy rows from. Must belong to the same dataset group."),
|
|
250
|
-
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
251
|
-
});
|
|
252
|
-
// ── Add Request Log to Draft Dataset (POST /api/public/v2/dataset-versions/add-request-log) ─────
|
|
253
|
-
export const AddRequestLogToDatasetVersionArgsSchema = z.object({
|
|
254
|
-
dataset_group_id: z.number().int().describe("ID of the dataset group containing the draft"),
|
|
255
|
-
request_log_id: z.number().int().describe("ID of the request log to add as a dataset row"),
|
|
256
|
-
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
257
|
-
});
|
|
258
|
-
// ── Save Draft Dataset Version (POST /api/public/v2/dataset-versions/save-draft) ─────
|
|
259
|
-
export const SaveDraftDatasetVersionArgsSchema = z.object({
|
|
260
|
-
dataset_group_id: z.number().int().describe("ID of the dataset group containing the draft to save"),
|
|
261
|
-
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
262
|
-
});
|
|
263
|
-
// ── List Evaluations (GET /api/public/v2/evaluations) ────────────────────
|
|
264
|
-
export const ListEvaluationsArgsSchema = z.object({
|
|
265
|
-
page: z.number().int().optional().describe("Page number (default: 1)"),
|
|
266
|
-
per_page: z.number().int().optional().describe("Items per page (default: 10)"),
|
|
267
|
-
name: z.string().optional().describe("Filter by name (case-insensitive partial match)"),
|
|
268
|
-
status: z.enum(["active", "deleted", "all"]).optional().describe("Filter by status (default: 'active')"),
|
|
269
|
-
include_runs: z.boolean().optional().describe("If true, include batch runs nested under each evaluation with status and cell status counts (default: false)"),
|
|
270
|
-
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
271
|
-
});
|
|
272
|
-
// ── Get Evaluation Rows (GET /api/public/v2/evaluations/{evaluation_id}/rows)
|
|
273
|
-
export const GetEvaluationRowsArgsSchema = z.object({
|
|
274
|
-
evaluation_id: z.number().int().describe("The ID of the evaluation to retrieve rows from"),
|
|
275
|
-
page: z.number().int().optional().describe("Page number (default: 1)"),
|
|
276
|
-
per_page: z.number().int().optional().describe("Rows per page (default: 10, max: 100)"),
|
|
277
|
-
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
278
|
-
});
|
|
279
|
-
// ── Create Evaluation Pipeline / Report (POST /reports) ──────────────────
|
|
280
|
-
export const CreateReportArgsSchema = z.object({
|
|
281
|
-
dataset_group_id: z.number().int().describe("Dataset group ID"),
|
|
282
|
-
name: z.string().optional().describe("Pipeline name (auto-generated if omitted)"),
|
|
283
|
-
folder_id: z.number().int().optional().describe("Folder ID for organization"),
|
|
284
|
-
dataset_version_number: z.number().int().optional().describe("Dataset version (uses latest if omitted)"),
|
|
285
|
-
columns: z.array(z.record(z.unknown())).optional().describe("Evaluation columns (each: column_type, name, configuration)"),
|
|
286
|
-
score_configuration: z.record(z.unknown()).optional().describe("Custom scoring logic configuration"),
|
|
287
|
-
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
288
|
-
});
|
|
289
|
-
// ── Run Evaluation (POST /reports/{report_id}/run) ───────────────────────
|
|
290
|
-
export const RunReportArgsSchema = z.object({
|
|
291
|
-
report_id: z.number().int().describe("Evaluation pipeline ID"),
|
|
292
|
-
name: z.string().describe("Name for this evaluation run"),
|
|
293
|
-
dataset_id: z.number().int().optional().describe("Override dataset ID"),
|
|
294
|
-
refresh_dataset: z.boolean().optional().describe("Refresh the dataset before running"),
|
|
295
|
-
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
296
|
-
});
|
|
297
|
-
// ── Get Evaluation (GET /reports/{report_id}) ────────────────────────────
|
|
298
|
-
export const GetReportArgsSchema = z.object({
|
|
299
|
-
report_id: z.number().int().describe("Evaluation pipeline ID"),
|
|
300
|
-
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
301
|
-
});
|
|
302
|
-
// ── Get Evaluation Score (GET /reports/{report_id}/score) ────────────────
|
|
303
|
-
export const GetReportScoreArgsSchema = z.object({
|
|
304
|
-
report_id: z.number().int().describe("Evaluation pipeline ID"),
|
|
305
|
-
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
306
|
-
});
|
|
307
|
-
// ── Configure Custom Scoring (PATCH /reports/{report_id}/score-card) ─────
|
|
308
|
-
// NOTE: This endpoint is in the PromptLayer reference docs but NOT in the
|
|
309
|
-
// OpenAPI spec. Tracked as a known exception in scripts/diff-endpoints.ts.
|
|
310
|
-
// See: https://docs.promptlayer.com/reference/update-report-score-card
|
|
311
|
-
export const UpdateReportScoreCardArgsSchema = z.object({
|
|
312
|
-
report_id: z.number().int().describe("Evaluation pipeline ID"),
|
|
313
|
-
column_names: z.array(z.string()).describe("Column names to include in score"),
|
|
314
|
-
code: z.string().optional().describe("Custom Python/JavaScript code for score calculation"),
|
|
315
|
-
code_language: z.enum(["PYTHON", "JAVASCRIPT"]).optional().describe("Code language (default: PYTHON)"),
|
|
316
|
-
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
317
|
-
});
|
|
318
|
-
// ── Delete Reports by Name (DELETE /reports/name/{report_name}) ──────────
|
|
319
|
-
export const DeleteReportsByNameArgsSchema = z.object({
|
|
320
|
-
report_name: z.string().describe("Name of reports to archive"),
|
|
321
|
-
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
322
|
-
});
|
|
323
|
-
// ── Delete Report by ID (DELETE /reports/{report_id}) ────────────────────
|
|
324
|
-
export const DeleteReportArgsSchema = z.object({
|
|
325
|
-
report_id: z.number().int().describe("Evaluation pipeline ID to archive"),
|
|
326
|
-
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
327
|
-
});
|
|
328
|
-
// ── Rename Report (PATCH /reports/{report_id}/rename) ────────────────────
|
|
329
|
-
export const RenameReportArgsSchema = z.object({
|
|
330
|
-
report_id: z.number().int().describe("Evaluation pipeline ID to rename"),
|
|
331
|
-
name: z.string().min(1).max(255).optional().describe("New name for the evaluation pipeline. Provide name, tags, or both."),
|
|
332
|
-
tags: z.array(z.string()).optional().describe("Replace the pipeline's tags. Pass an empty array to clear them. Provide name, tags, or both."),
|
|
333
|
-
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
334
|
-
});
|
|
335
|
-
// ── Add Report Column (POST /report-columns) ─────────────────────────────
|
|
336
|
-
export const AddReportColumnArgsSchema = z.object({
|
|
337
|
-
report_id: z.number().int().describe("Evaluation pipeline ID to add the column to"),
|
|
338
|
-
column_type: z.string().describe("Column type (e.g. LLM_ASSERTION, CODE_EXECUTION, PROMPT_TEMPLATE). See https://docs.promptlayer.com/features/evaluations/column-types"),
|
|
339
|
-
name: z.string().min(1).describe("Unique column name within the pipeline"),
|
|
340
|
-
configuration: z.record(z.unknown()).describe("Column-type-specific configuration"),
|
|
341
|
-
position: z.number().int().positive().optional().describe("Position in the pipeline (auto-assigned if omitted). Cannot overwrite dataset columns."),
|
|
342
|
-
is_part_of_score: z.boolean().optional().describe("Whether this column contributes to the score (default false)"),
|
|
343
|
-
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
344
|
-
});
|
|
345
|
-
// ── Edit Report Column (PATCH /report-columns/{report_column_id}) ────────
|
|
346
|
-
export const EditReportColumnArgsSchema = z.object({
|
|
347
|
-
report_column_id: z.number().int().describe("Report column ID to edit"),
|
|
348
|
-
report_id: z.number().int().describe("Parent evaluation pipeline ID (must match the column's report)"),
|
|
349
|
-
column_type: z.string().describe("Column type (e.g. LLM_ASSERTION, CODE_EXECUTION, PROMPT_TEMPLATE). DATASET is not allowed."),
|
|
350
|
-
configuration: z.record(z.unknown()).optional().describe("Replacement column configuration"),
|
|
351
|
-
name: z.string().min(1).optional().describe("New column name (must be unique within the pipeline)"),
|
|
352
|
-
position: z.number().int().positive().optional().describe("New position. Cannot overwrite dataset columns."),
|
|
353
|
-
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
354
|
-
});
|
|
355
|
-
// ── Delete Report Column (DELETE /report-columns/{report_column_id}) ─────
|
|
356
|
-
export const DeleteReportColumnArgsSchema = z.object({
|
|
357
|
-
report_column_id: z.number().int().describe("Report column ID to delete. Cannot be a DATASET column."),
|
|
358
|
-
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
359
|
-
});
|
|
360
195
|
// ── List Agents (GET /workflows) ─────────────────────────────────────────
|
|
361
196
|
export const ListWorkflowsArgsSchema = z.object({
|
|
362
197
|
page: z.number().int().optional().describe("Page number (default: 1)"),
|
|
@@ -430,17 +265,51 @@ export const GetToolRegistryArgsSchema = z.object({
|
|
|
430
265
|
version: z.number().int().optional().describe("Resolve by specific version number"),
|
|
431
266
|
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
432
267
|
});
|
|
268
|
+
export const ToolExecutionSchema = z.object({
|
|
269
|
+
type: z.literal("code"),
|
|
270
|
+
language: z.enum(["python", "javascript"]),
|
|
271
|
+
code: z.string().describe("Function body only. Signature is auto-generated; LLM args arrive as a single `args` object."),
|
|
272
|
+
});
|
|
433
273
|
export const CreateToolRegistryArgsSchema = z.object({
|
|
434
274
|
name: z.string().describe("Tool name (unique per workspace)"),
|
|
435
275
|
tool_definition: z.record(z.unknown()).describe("Tool definition in OpenAI function-calling format: {type: 'function', function: {name, description, parameters}}"),
|
|
276
|
+
description: z.string().optional().describe("Optional human-readable description of the tool"),
|
|
436
277
|
folder_id: z.number().int().optional().describe("Folder ID to place tool in"),
|
|
437
278
|
commit_message: z.string().optional().describe("Commit message for the initial version"),
|
|
279
|
+
execution: ToolExecutionSchema.optional().describe("Optional sandbox-executable body. When set, PromptLayer auto-runs the body between LLM turns whenever a prompt uses this tool."),
|
|
438
280
|
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
439
281
|
});
|
|
440
282
|
export const CreateToolVersionArgsSchema = z.object({
|
|
441
283
|
identifier: z.string().describe("Tool ID (numeric) or name"),
|
|
442
284
|
tool_definition: z.record(z.unknown()).describe("Updated tool definition in OpenAI function-calling format"),
|
|
443
285
|
commit_message: z.string().optional().describe("Commit message describing what changed"),
|
|
286
|
+
execution: ToolExecutionSchema.optional().describe("Optional sandbox-executable body to attach to this version. See ToolExecutionSchema for details."),
|
|
287
|
+
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
288
|
+
});
|
|
289
|
+
export const TestExecuteToolRegistryArgsSchema = z.object({
|
|
290
|
+
identifier: z.string().describe("Tool ID (numeric) or name"),
|
|
291
|
+
inputs: z.record(z.unknown()).optional().describe("Arguments passed to the tool body, keyed by the tool's parameter names. Same shape the LLM would emit."),
|
|
292
|
+
execution: ToolExecutionSchema.optional().describe("In-flight override of the stored execution config. Lets you test unsaved code without creating a version."),
|
|
293
|
+
tool_definition: z.record(z.unknown()).optional().describe("In-flight override of the stored tool definition. Useful for testing a different function name without saving."),
|
|
294
|
+
label: z.string().optional().describe("Resolve version by label name (e.g. 'production'). Falls back to latest if neither label nor version given."),
|
|
295
|
+
version: z.number().int().optional().describe("Resolve by specific version number"),
|
|
296
|
+
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
297
|
+
});
|
|
298
|
+
// ── Env Vars ─────────────────────────────────────────────────────────────
|
|
299
|
+
export const ListWorkspaceEnvVarsArgsSchema = z.object({
|
|
300
|
+
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
301
|
+
});
|
|
302
|
+
export const CreateWorkspaceEnvVarArgsSchema = z.object({
|
|
303
|
+
key: z.string().describe("Env var name. Must match ^[A-Za-z_][A-Za-z0-9_]*$ and not be a reserved runtime name (PATH, LD_PRELOAD, PYTHONSTARTUP, NODE_OPTIONS, etc.)"),
|
|
304
|
+
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
305
|
+
});
|
|
306
|
+
export const ListToolEnvVarsArgsSchema = z.object({
|
|
307
|
+
identifier: z.string().describe("Tool ID (numeric) or name"),
|
|
308
|
+
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
309
|
+
});
|
|
310
|
+
export const CreateToolEnvVarArgsSchema = z.object({
|
|
311
|
+
identifier: z.string().describe("Tool ID (numeric) or name"),
|
|
312
|
+
key: z.string().describe("Env var name. Must match ^[A-Za-z_][A-Za-z0-9_]*$ and not be a reserved runtime name."),
|
|
444
313
|
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
445
314
|
});
|
|
446
315
|
export const CreateFolderArgsSchema = z.object({
|
|
@@ -622,6 +491,325 @@ export const GetRequestSearchSuggestionsArgsSchema = z.object({
|
|
|
622
491
|
filter_group: z.string().optional().describe("JSON-encoded filter group to scope suggestions to matching requests"),
|
|
623
492
|
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
624
493
|
});
|
|
494
|
+
// ── Smart Tables (public v2) ────────────────────────────────────────────
|
|
495
|
+
const UuidSchema = z.string().uuid();
|
|
496
|
+
const CursorPaginationShape = {
|
|
497
|
+
cursor: z.string().optional().describe("Pagination cursor from a previous response"),
|
|
498
|
+
limit: z.number().int().min(1).max(100).optional().describe("Items per page (1-100)"),
|
|
499
|
+
};
|
|
500
|
+
const SmartTablePromptFilterShape = {
|
|
501
|
+
prompt_id: z.number().int().positive().optional().describe("Filter to tables/sheets that reference this prompt"),
|
|
502
|
+
prompt_version_id: z.number().int().positive().optional().describe("Filter to tables/sheets that reference this prompt version"),
|
|
503
|
+
prompt_label_id: z.number().int().positive().optional().describe("Filter to tables/sheets that reference this prompt label"),
|
|
504
|
+
};
|
|
505
|
+
const SmartTableColumnTypeSchema = z.enum([
|
|
506
|
+
"TEXT",
|
|
507
|
+
"ABSOLUTE_NUMERIC_DISTANCE",
|
|
508
|
+
"AI_DATA_EXTRACTION",
|
|
509
|
+
"APPLY_DIFF",
|
|
510
|
+
"ASSERT_VALID",
|
|
511
|
+
"COALESCE",
|
|
512
|
+
"CONDITION",
|
|
513
|
+
"CODE_EXECUTION",
|
|
514
|
+
"COMBINE_COLUMNS",
|
|
515
|
+
"COMPARE",
|
|
516
|
+
"COMPOSITION",
|
|
517
|
+
"CONTAINS",
|
|
518
|
+
"CONVERSATION_SIMULATOR",
|
|
519
|
+
"COSINE_SIMILARITY",
|
|
520
|
+
"COUNT",
|
|
521
|
+
"DATASET",
|
|
522
|
+
"ENDPOINT",
|
|
523
|
+
"FOR_LOOP",
|
|
524
|
+
"HUMAN",
|
|
525
|
+
"JSON_PATH",
|
|
526
|
+
"LLM_ASSERTION",
|
|
527
|
+
"MATH_OPERATOR",
|
|
528
|
+
"MCP",
|
|
529
|
+
"MIN_MAX",
|
|
530
|
+
"PARSE_VALUE",
|
|
531
|
+
"PROMPT_TEMPLATE",
|
|
532
|
+
"REGEX",
|
|
533
|
+
"REGEX_EXTRACTION",
|
|
534
|
+
"VARIABLE",
|
|
535
|
+
"WHILE_LOOP",
|
|
536
|
+
"WORKFLOW",
|
|
537
|
+
"XML_PATH",
|
|
538
|
+
]).describe("Smart Table column type. Use uppercase backend enum values.");
|
|
539
|
+
const SmartCellStatusSchema = z.enum(["STALE", "QUEUED", "DISPATCHED", "RUNNING", "COMPLETED", "FAILED"]);
|
|
540
|
+
const SmartTableColumnDependencySchema = z.object({
|
|
541
|
+
column_id: UuidSchema.describe("Source column UUID"),
|
|
542
|
+
reference_type: z.string().optional().describe("Dependency reference type, usually 'value'"),
|
|
543
|
+
config_key: z.string().optional().describe("Optional config key this dependency feeds"),
|
|
544
|
+
config_meta: z.record(z.unknown()).optional().describe("Optional dependency metadata"),
|
|
545
|
+
});
|
|
546
|
+
const SmartTableRequestLogImportBaseShape = {
|
|
547
|
+
request_log_ids: z.array(z.number().int().positive()).optional().describe("Explicit request log IDs to import"),
|
|
548
|
+
filter_group: StructuredFilterGroupSchema.optional().describe("Structured request log filters. Provide this or request_log_ids."),
|
|
549
|
+
q: z.string().optional().describe("Free-text request log search applied with filter_group"),
|
|
550
|
+
sort_by: z.string().optional().describe("Request log sort field"),
|
|
551
|
+
sort_order: z.enum(["asc", "desc"]).optional().describe("Request log sort direction"),
|
|
552
|
+
metadata_cost_breakdown_key: z.string().optional().describe("Optional metadata key used for cost breakdown filtering"),
|
|
553
|
+
variables_to_parse: z.array(z.string()).optional().describe("Input variable names to extract as columns"),
|
|
554
|
+
include_fields: z.array(z.string()).optional().describe("Additional request fields to include as imported columns"),
|
|
555
|
+
limit: z.number().int().positive().optional().describe("Maximum number of matching request logs to import"),
|
|
556
|
+
};
|
|
557
|
+
const SmartTableSheetFileSourceSchema = z.object({
|
|
558
|
+
type: z.literal("file"),
|
|
559
|
+
file_name: z.string().min(1).max(255).describe("CSV or JSON file name for a new sheet import"),
|
|
560
|
+
file_content_base64: z.string().min(1).describe("Base64-encoded file content"),
|
|
561
|
+
});
|
|
562
|
+
const SmartTableSheetRequestLogsSourceSchema = z.object({
|
|
563
|
+
type: z.literal("request_logs"),
|
|
564
|
+
...SmartTableRequestLogImportBaseShape,
|
|
565
|
+
});
|
|
566
|
+
export const ListSmartTablesArgsSchema = z.object({
|
|
567
|
+
folder_id: z.number().int().positive().optional().describe("Filter by folder ID"),
|
|
568
|
+
name: z.string().optional().describe("Filter by table title"),
|
|
569
|
+
...CursorPaginationShape,
|
|
570
|
+
sort: z.enum(["created_at"]).optional().describe("Sort field (default: created_at)"),
|
|
571
|
+
order: z.enum(["asc", "desc"]).optional().describe("Sort direction (default: desc)"),
|
|
572
|
+
...SmartTablePromptFilterShape,
|
|
573
|
+
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
574
|
+
});
|
|
575
|
+
export const CreateSmartTableArgsSchema = z.object({
|
|
576
|
+
title: z.string().min(1).max(255).optional().describe("Table title. Omit for an auto-generated Untitled Table name."),
|
|
577
|
+
folder_id: z.number().int().positive().optional().describe("Folder ID to place the table into"),
|
|
578
|
+
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
579
|
+
});
|
|
580
|
+
export const GetSmartTableArgsSchema = z.object({
|
|
581
|
+
table_id: UuidSchema.describe("Smart Table UUID"),
|
|
582
|
+
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
583
|
+
});
|
|
584
|
+
export const UpdateSmartTableArgsSchema = z.object({
|
|
585
|
+
table_id: UuidSchema.describe("Smart Table UUID"),
|
|
586
|
+
title: z.string().min(1).max(255).optional().describe("New table title"),
|
|
587
|
+
folder_id: z.number().int().positive().optional().describe("Folder ID, or omit to leave unchanged"),
|
|
588
|
+
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
589
|
+
});
|
|
590
|
+
export const ListSmartTableSheetsArgsSchema = z.object({
|
|
591
|
+
table_id: UuidSchema.describe("Smart Table UUID"),
|
|
592
|
+
...CursorPaginationShape,
|
|
593
|
+
sort: z.enum(["index"]).optional().describe("Sort field (default: index)"),
|
|
594
|
+
order: z.enum(["asc", "desc"]).optional().describe("Sort direction (default: asc)"),
|
|
595
|
+
...SmartTablePromptFilterShape,
|
|
596
|
+
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
597
|
+
});
|
|
598
|
+
export const CreateSmartTableSheetArgsSchema = z.object({
|
|
599
|
+
table_id: UuidSchema.describe("Smart Table UUID"),
|
|
600
|
+
title: z.string().min(1).max(255).optional().describe("Sheet title"),
|
|
601
|
+
index: z.number().int().min(0).optional().describe("Sheet index"),
|
|
602
|
+
operation_id: z.string().min(1).max(255).optional().describe("Optional idempotency/status operation ID"),
|
|
603
|
+
source: z.discriminatedUnion("type", [
|
|
604
|
+
SmartTableSheetFileSourceSchema,
|
|
605
|
+
SmartTableSheetRequestLogsSourceSchema,
|
|
606
|
+
]).describe("Source for the new sheet: file or request_logs"),
|
|
607
|
+
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
608
|
+
});
|
|
609
|
+
export const GetSmartTableSheetArgsSchema = z.object({
|
|
610
|
+
table_id: UuidSchema.describe("Smart Table UUID"),
|
|
611
|
+
sheet_id: UuidSchema.describe("Sheet UUID"),
|
|
612
|
+
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
613
|
+
});
|
|
614
|
+
export const UpdateSmartTableSheetArgsSchema = z.object({
|
|
615
|
+
table_id: UuidSchema.describe("Smart Table UUID"),
|
|
616
|
+
sheet_id: UuidSchema.describe("Sheet UUID"),
|
|
617
|
+
title: z.string().min(1).max(255).optional().describe("New sheet title"),
|
|
618
|
+
index: z.number().int().min(0).optional().describe("New sheet index"),
|
|
619
|
+
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
620
|
+
});
|
|
621
|
+
export const GetSmartTableSheetImportOperationArgsSchema = z.object({
|
|
622
|
+
table_id: UuidSchema.describe("Smart Table UUID"),
|
|
623
|
+
operation_id: z.string().min(1).describe("Import operation ID"),
|
|
624
|
+
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
625
|
+
});
|
|
626
|
+
export const ImportSmartTableSheetFileArgsSchema = z.object({
|
|
627
|
+
table_id: UuidSchema.describe("Smart Table UUID"),
|
|
628
|
+
sheet_id: UuidSchema.describe("Sheet UUID"),
|
|
629
|
+
operation_id: z.string().optional().describe("Optional idempotency/status operation ID"),
|
|
630
|
+
file_name: z.string().min(1).max(255).describe("CSV file name"),
|
|
631
|
+
file_content_base64: z.string().min(1).describe("Base64-encoded CSV content"),
|
|
632
|
+
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
633
|
+
});
|
|
634
|
+
export const ImportSmartTableSheetRequestLogsArgsSchema = z.object({
|
|
635
|
+
table_id: UuidSchema.describe("Smart Table UUID"),
|
|
636
|
+
sheet_id: UuidSchema.describe("Sheet UUID"),
|
|
637
|
+
operation_id: z.string().optional().describe("Optional idempotency/status operation ID"),
|
|
638
|
+
...SmartTableRequestLogImportBaseShape,
|
|
639
|
+
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
640
|
+
});
|
|
641
|
+
export const ListSmartTableColumnsArgsSchema = z.object({
|
|
642
|
+
table_id: UuidSchema.describe("Smart Table UUID"),
|
|
643
|
+
sheet_id: UuidSchema.describe("Sheet UUID"),
|
|
644
|
+
...CursorPaginationShape,
|
|
645
|
+
sort: z.enum(["position_rank"]).optional().describe("Sort field (default: position_rank)"),
|
|
646
|
+
order: z.enum(["asc", "desc"]).optional().describe("Sort direction (default: asc)"),
|
|
647
|
+
include_system_columns: z.boolean().optional().describe("Include system columns in the response"),
|
|
648
|
+
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
649
|
+
});
|
|
650
|
+
export const CreateSmartTableColumnArgsSchema = z.object({
|
|
651
|
+
table_id: UuidSchema.describe("Smart Table UUID"),
|
|
652
|
+
sheet_id: UuidSchema.describe("Sheet UUID"),
|
|
653
|
+
title: z.string().min(1).max(255).describe("Column title"),
|
|
654
|
+
type: SmartTableColumnTypeSchema,
|
|
655
|
+
config: z.record(z.unknown()).nullable().optional().describe("Column-type-specific configuration"),
|
|
656
|
+
dependencies: z.array(SmartTableColumnDependencySchema).nullable().optional().describe("Column dependencies"),
|
|
657
|
+
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
658
|
+
});
|
|
659
|
+
export const UpdateSmartTableColumnArgsSchema = z.object({
|
|
660
|
+
table_id: UuidSchema.describe("Smart Table UUID"),
|
|
661
|
+
sheet_id: UuidSchema.describe("Sheet UUID"),
|
|
662
|
+
column_id: UuidSchema.describe("Column UUID"),
|
|
663
|
+
title: z.string().min(1).max(255).optional().describe("New column title"),
|
|
664
|
+
config: z.record(z.unknown()).nullable().optional().describe("Replacement column configuration"),
|
|
665
|
+
dependencies: z.array(SmartTableColumnDependencySchema).nullable().optional().describe("Replacement column dependencies"),
|
|
666
|
+
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
667
|
+
});
|
|
668
|
+
export const ListSmartTableRowsArgsSchema = z.object({
|
|
669
|
+
table_id: UuidSchema.describe("Smart Table UUID"),
|
|
670
|
+
sheet_id: UuidSchema.describe("Sheet UUID"),
|
|
671
|
+
...CursorPaginationShape,
|
|
672
|
+
sort: z.enum(["row_index"]).optional().describe("Sort field (default: row_index)"),
|
|
673
|
+
order: z.enum(["asc", "desc"]).optional().describe("Sort direction (default: asc)"),
|
|
674
|
+
include_columns: z.boolean().optional().describe("Include column metadata"),
|
|
675
|
+
include_row_count: z.boolean().optional().describe("Include total row count"),
|
|
676
|
+
include_system_columns: z.boolean().optional().describe("Include system columns"),
|
|
677
|
+
include_execution_metadata_aggregates: z.boolean().optional().describe("Include execution metadata aggregates"),
|
|
678
|
+
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
679
|
+
});
|
|
680
|
+
export const AddSmartTableRowsArgsSchema = z.object({
|
|
681
|
+
table_id: UuidSchema.describe("Smart Table UUID"),
|
|
682
|
+
sheet_id: UuidSchema.describe("Sheet UUID"),
|
|
683
|
+
count: z.number().int().min(1).max(100).optional().describe("Number of rows to add (default: 1, max: 100)"),
|
|
684
|
+
values: z.array(z.record(z.unknown())).max(100).optional().describe("Optional row values, keyed by column UUID"),
|
|
685
|
+
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
686
|
+
});
|
|
687
|
+
export const GetSmartTableCellArgsSchema = z.object({
|
|
688
|
+
table_id: UuidSchema.describe("Smart Table UUID"),
|
|
689
|
+
sheet_id: UuidSchema.describe("Sheet UUID"),
|
|
690
|
+
cell_id: UuidSchema.describe("Cell UUID"),
|
|
691
|
+
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
692
|
+
});
|
|
693
|
+
export const UpdateSmartTableCellArgsSchema = z.object({
|
|
694
|
+
table_id: UuidSchema.describe("Smart Table UUID"),
|
|
695
|
+
sheet_id: UuidSchema.describe("Sheet UUID"),
|
|
696
|
+
cell_id: UuidSchema.describe("Cell UUID"),
|
|
697
|
+
display_value: z.string().nullable().optional().describe("Text to display for a text cell"),
|
|
698
|
+
value: z.unknown().optional().describe("Structured cell value"),
|
|
699
|
+
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
700
|
+
});
|
|
701
|
+
export const RecalculateSmartTableCellArgsSchema = z.object({
|
|
702
|
+
table_id: UuidSchema.describe("Smart Table UUID"),
|
|
703
|
+
sheet_id: UuidSchema.describe("Sheet UUID"),
|
|
704
|
+
cell_id: UuidSchema.describe("Cell UUID"),
|
|
705
|
+
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
706
|
+
});
|
|
707
|
+
export const RecalculateSmartTableCellsArgsSchema = z.object({
|
|
708
|
+
table_id: UuidSchema.describe("Smart Table UUID"),
|
|
709
|
+
sheet_id: UuidSchema.describe("Sheet UUID"),
|
|
710
|
+
cell_ids: z.array(UuidSchema).min(1).describe("Cell UUIDs to recalculate"),
|
|
711
|
+
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
712
|
+
});
|
|
713
|
+
export const ListSmartTableOperationsArgsSchema = z.object({
|
|
714
|
+
table_id: UuidSchema.describe("Smart Table UUID"),
|
|
715
|
+
sheet_id: UuidSchema.describe("Sheet UUID"),
|
|
716
|
+
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
717
|
+
});
|
|
718
|
+
export const CreateSmartTableOperationArgsSchema = z.object({
|
|
719
|
+
table_id: UuidSchema.describe("Smart Table UUID"),
|
|
720
|
+
sheet_id: UuidSchema.describe("Sheet UUID"),
|
|
721
|
+
operation: z.enum(["recalculate"]).optional().describe("Operation to run (default: recalculate)"),
|
|
722
|
+
column_ids: z.array(UuidSchema).optional().describe("Limit recalculation to these column UUIDs"),
|
|
723
|
+
row_ids: z.array(z.number().int()).optional().describe("Limit recalculation to these row IDs"),
|
|
724
|
+
statuses: z.array(SmartCellStatusSchema).optional().describe("Cell statuses to recalculate. Empty array means no status filter."),
|
|
725
|
+
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
726
|
+
});
|
|
727
|
+
export const GetSmartTableOperationArgsSchema = z.object({
|
|
728
|
+
table_id: UuidSchema.describe("Smart Table UUID"),
|
|
729
|
+
sheet_id: UuidSchema.describe("Sheet UUID"),
|
|
730
|
+
operation_id: z.string().min(1).describe("Operation/execution ID"),
|
|
731
|
+
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
732
|
+
});
|
|
733
|
+
export const CancelSmartTableOperationArgsSchema = GetSmartTableOperationArgsSchema;
|
|
734
|
+
export const GetSmartTableScoreArgsSchema = z.object({
|
|
735
|
+
table_id: UuidSchema.describe("Smart Table UUID"),
|
|
736
|
+
sheet_id: UuidSchema.describe("Sheet UUID"),
|
|
737
|
+
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
738
|
+
});
|
|
739
|
+
export const ConfigureSmartTableScoreArgsSchema = z.object({
|
|
740
|
+
table_id: UuidSchema.describe("Smart Table UUID"),
|
|
741
|
+
sheet_id: UuidSchema.describe("Sheet UUID"),
|
|
742
|
+
score_type: z.enum(["auto", "boolean", "numeric", "custom"]).optional().describe("Score configuration type"),
|
|
743
|
+
score_config: z.record(z.unknown()).optional().describe("Full backend score configuration"),
|
|
744
|
+
column_ids: z.array(UuidSchema).optional().describe("Column UUIDs to include in the score"),
|
|
745
|
+
column_names: z.array(z.string()).optional().describe("Column names to include in the score"),
|
|
746
|
+
code: z.string().min(1).max(50000).optional().describe("Custom score code. Implies score_type=custom."),
|
|
747
|
+
code_language: z.enum(["PYTHON", "JAVASCRIPT"]).optional().describe("Custom score code language (default: PYTHON)"),
|
|
748
|
+
true_values: z.array(z.string()).optional().describe("Values treated as true for boolean scoring"),
|
|
749
|
+
false_values: z.array(z.string()).optional().describe("Values treated as false for boolean scoring"),
|
|
750
|
+
assertion_aggregation: z.enum(["all", "any", "mean"]).optional().describe("How boolean assertions are aggregated"),
|
|
751
|
+
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
752
|
+
});
|
|
753
|
+
export const RecalculateSmartTableScoreArgsSchema = GetSmartTableScoreArgsSchema;
|
|
754
|
+
export const ListSmartTableVersionsArgsSchema = z.object({
|
|
755
|
+
table_id: UuidSchema.describe("Smart Table UUID"),
|
|
756
|
+
sheet_id: UuidSchema.describe("Sheet UUID"),
|
|
757
|
+
...CursorPaginationShape,
|
|
758
|
+
sort: z.enum(["version_number"]).optional().describe("Sort field (default: version_number)"),
|
|
759
|
+
order: z.enum(["asc", "desc"]).optional().describe("Sort direction (default: desc)"),
|
|
760
|
+
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
761
|
+
});
|
|
762
|
+
export const GetSmartTableVersionArgsSchema = z.object({
|
|
763
|
+
table_id: UuidSchema.describe("Smart Table UUID"),
|
|
764
|
+
sheet_id: UuidSchema.describe("Sheet UUID"),
|
|
765
|
+
version_id: UuidSchema.describe("Version UUID"),
|
|
766
|
+
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
767
|
+
});
|
|
768
|
+
export const CreateSmartTableVersionArgsSchema = z.object({
|
|
769
|
+
table_id: UuidSchema.describe("Smart Table UUID"),
|
|
770
|
+
sheet_id: UuidSchema.describe("Sheet UUID"),
|
|
771
|
+
name: z.string().min(1).max(255).optional().describe("Name for a new snapshot version"),
|
|
772
|
+
source_version_id: UuidSchema.optional().describe("Existing version UUID to restore"),
|
|
773
|
+
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
774
|
+
});
|
|
775
|
+
export const GetSmartTableScoreHistoryArgsSchema = z.object({
|
|
776
|
+
table_id: UuidSchema.describe("Smart Table UUID"),
|
|
777
|
+
sheet_id: UuidSchema.describe("Sheet UUID"),
|
|
778
|
+
max_points: z.number().int().min(50).max(5000).optional().describe("Maximum score-history points (default: 1200)"),
|
|
779
|
+
range: z.string().optional().describe("Score-history range, e.g. all, last_25, last_50, last_100, last_250"),
|
|
780
|
+
resolution: z.string().optional().describe("Score-history resolution (default: auto)"),
|
|
781
|
+
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
782
|
+
});
|
|
783
|
+
const LegacySmartTableMigrationSourceTypeSchema = z.enum(["dataset_group", "dataset", "report"]);
|
|
784
|
+
export const ListLegacySmartTableMigrationsArgsSchema = z.object({
|
|
785
|
+
source_type: LegacySmartTableMigrationSourceTypeSchema.optional().describe("Legacy source type to filter by"),
|
|
786
|
+
source_id: z.union([
|
|
787
|
+
z.number().int().positive(),
|
|
788
|
+
z.array(z.number().int().positive()),
|
|
789
|
+
]).optional().describe("One or more legacy source IDs. Requires source_type."),
|
|
790
|
+
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
791
|
+
});
|
|
792
|
+
export const PreviewLegacySmartTableMigrationArgsSchema = z.object({
|
|
793
|
+
source_type: LegacySmartTableMigrationSourceTypeSchema.describe("Legacy source type"),
|
|
794
|
+
source_id: z.number().int().positive().describe("Legacy source ID"),
|
|
795
|
+
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
796
|
+
});
|
|
797
|
+
export const MigrateLegacyToSmartTableArgsSchema = z.object({
|
|
798
|
+
source_type: LegacySmartTableMigrationSourceTypeSchema.describe("Legacy source type"),
|
|
799
|
+
source_id: z.number().int().positive().describe("Legacy source ID"),
|
|
800
|
+
force: z.boolean().optional().describe("Force remigration of an already migrated source"),
|
|
801
|
+
dry_run: z.boolean().optional().describe("Preview migration work without writing data"),
|
|
802
|
+
resume: z.boolean().optional().describe("Resume prior migration progress when available"),
|
|
803
|
+
continue_on_error: z.boolean().optional().describe("Continue migration after row/column-level errors"),
|
|
804
|
+
include_reports_with_missing_datasets: z.boolean().optional().describe("Include reports even if their datasets are missing"),
|
|
805
|
+
max_version_snapshot_cells: z.number().int().min(0).optional().describe("Maximum cells to snapshot per migrated version"),
|
|
806
|
+
report_preview_row_limit: z.number().int().min(0).optional().describe("Rows to include in migrated report previews"),
|
|
807
|
+
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
808
|
+
});
|
|
809
|
+
export const GetLegacySmartTableMigrationJobArgsSchema = z.object({
|
|
810
|
+
job_id: z.string().min(1).describe("Legacy Smart Table migration job ID"),
|
|
811
|
+
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
812
|
+
});
|
|
625
813
|
export const TOOL_DEFINITIONS = {
|
|
626
814
|
// ── Prompt Templates ────────────────────────────────────────────────
|
|
627
815
|
"get-prompt-template": {
|
|
@@ -761,138 +949,247 @@ export const TOOL_DEFINITIONS = {
|
|
|
761
949
|
inputSchema: CreateSpansBulkArgsSchema,
|
|
762
950
|
annotations: { readOnlyHint: false },
|
|
763
951
|
},
|
|
764
|
-
// ──
|
|
765
|
-
"list-
|
|
766
|
-
name: "list-
|
|
767
|
-
description: "List
|
|
768
|
-
|
|
952
|
+
// ── Smart Tables ───────────────────────────────────────────────────
|
|
953
|
+
"list-smart-tables": {
|
|
954
|
+
name: "list-smart-tables",
|
|
955
|
+
description: "List Smart Tables with cursor pagination. Smart Tables are PromptLayer's general-purpose data and " +
|
|
956
|
+
"computation layer — use them to organise test datasets, run prompt templates across rows, assert " +
|
|
957
|
+
"on outputs, compare results, build evaluations, or track regression over time. " +
|
|
958
|
+
"Filter by folder, title, or referenced prompt.",
|
|
959
|
+
inputSchema: ListSmartTablesArgsSchema,
|
|
769
960
|
annotations: { readOnlyHint: true },
|
|
770
961
|
},
|
|
771
|
-
"create-
|
|
772
|
-
name: "create-
|
|
773
|
-
description: "Create a
|
|
774
|
-
|
|
962
|
+
"create-smart-table": {
|
|
963
|
+
name: "create-smart-table",
|
|
964
|
+
description: "Create a Smart Table. Tables are general-purpose — they can hold any tabular data and run " +
|
|
965
|
+
"computed columns (PROMPT_TEMPLATE, LLM_ASSERTION, CODE_EXECUTION, COMPARE, etc.) over rows. " +
|
|
966
|
+
"Common uses include evaluations, regression testing, prompt comparisons, and dataset curation. " +
|
|
967
|
+
"After creating a table, add a sheet, then add columns and rows (or import request logs).",
|
|
968
|
+
inputSchema: CreateSmartTableArgsSchema,
|
|
775
969
|
annotations: { readOnlyHint: false },
|
|
776
970
|
},
|
|
777
|
-
"
|
|
778
|
-
name: "
|
|
779
|
-
description: "
|
|
780
|
-
inputSchema:
|
|
781
|
-
annotations: { readOnlyHint:
|
|
971
|
+
"get-smart-table": {
|
|
972
|
+
name: "get-smart-table",
|
|
973
|
+
description: "Get a Smart Table by UUID, including sheet counts and row counts.",
|
|
974
|
+
inputSchema: GetSmartTableArgsSchema,
|
|
975
|
+
annotations: { readOnlyHint: true },
|
|
782
976
|
},
|
|
783
|
-
"
|
|
784
|
-
name: "
|
|
785
|
-
description: "
|
|
786
|
-
|
|
787
|
-
" 2. filter_group (+ optional q) — structured AND/OR filter, same shape as search-request-logs. " +
|
|
788
|
-
"Async; persisted on the dataset so refresh_dataset can replay it.\n" +
|
|
789
|
-
"Use variables_to_parse to extract specific input variables as dataset columns.",
|
|
790
|
-
inputSchema: CreateDatasetVersionFromFilterParamsArgsSchema,
|
|
977
|
+
"update-smart-table": {
|
|
978
|
+
name: "update-smart-table",
|
|
979
|
+
description: "Update a Smart Table title or folder.",
|
|
980
|
+
inputSchema: UpdateSmartTableArgsSchema,
|
|
791
981
|
annotations: { readOnlyHint: false },
|
|
792
982
|
},
|
|
793
|
-
"
|
|
794
|
-
name: "
|
|
795
|
-
description: "
|
|
796
|
-
inputSchema:
|
|
983
|
+
"list-smart-table-sheets": {
|
|
984
|
+
name: "list-smart-table-sheets",
|
|
985
|
+
description: "List sheets in a Smart Table with cursor pagination.",
|
|
986
|
+
inputSchema: ListSmartTableSheetsArgsSchema,
|
|
797
987
|
annotations: { readOnlyHint: true },
|
|
798
988
|
},
|
|
799
|
-
"create-
|
|
800
|
-
name: "create-
|
|
801
|
-
description: "
|
|
802
|
-
|
|
989
|
+
"create-smart-table-sheet": {
|
|
990
|
+
name: "create-smart-table-sheet",
|
|
991
|
+
description: "Add a sheet (tab) to a Smart Table. Two source types:\n" +
|
|
992
|
+
" - file: seed rows from a base64-encoded CSV or JSON file.\n" +
|
|
993
|
+
" - request_logs: import historical request logs from PromptLayer by filter or explicit IDs — " +
|
|
994
|
+
" use this to build datasets from real production traffic for evaluation or analysis.",
|
|
995
|
+
inputSchema: CreateSmartTableSheetArgsSchema,
|
|
803
996
|
annotations: { readOnlyHint: false },
|
|
804
997
|
},
|
|
805
|
-
"
|
|
806
|
-
name: "
|
|
807
|
-
description: "
|
|
808
|
-
inputSchema:
|
|
809
|
-
annotations: { readOnlyHint:
|
|
998
|
+
"get-smart-table-sheet": {
|
|
999
|
+
name: "get-smart-table-sheet",
|
|
1000
|
+
description: "Get a single Smart Table sheet.",
|
|
1001
|
+
inputSchema: GetSmartTableSheetArgsSchema,
|
|
1002
|
+
annotations: { readOnlyHint: true },
|
|
810
1003
|
},
|
|
811
|
-
"
|
|
812
|
-
name: "
|
|
813
|
-
description: "
|
|
814
|
-
inputSchema:
|
|
1004
|
+
"update-smart-table-sheet": {
|
|
1005
|
+
name: "update-smart-table-sheet",
|
|
1006
|
+
description: "Update a Smart Table sheet title or index.",
|
|
1007
|
+
inputSchema: UpdateSmartTableSheetArgsSchema,
|
|
815
1008
|
annotations: { readOnlyHint: false },
|
|
816
1009
|
},
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
inputSchema: ListEvaluationsArgsSchema,
|
|
1010
|
+
"get-smart-table-sheet-import-operation": {
|
|
1011
|
+
name: "get-smart-table-sheet-import-operation",
|
|
1012
|
+
description: "Get status for a Smart Table sheet import operation.",
|
|
1013
|
+
inputSchema: GetSmartTableSheetImportOperationArgsSchema,
|
|
822
1014
|
annotations: { readOnlyHint: true },
|
|
823
1015
|
},
|
|
824
|
-
"
|
|
825
|
-
name: "
|
|
826
|
-
description: "
|
|
827
|
-
inputSchema:
|
|
1016
|
+
"import-smart-table-sheet-file": {
|
|
1017
|
+
name: "import-smart-table-sheet-file",
|
|
1018
|
+
description: "Import base64 CSV content into an existing Smart Table sheet.",
|
|
1019
|
+
inputSchema: ImportSmartTableSheetFileArgsSchema,
|
|
1020
|
+
annotations: { readOnlyHint: false },
|
|
1021
|
+
},
|
|
1022
|
+
"import-smart-table-sheet-request-logs": {
|
|
1023
|
+
name: "import-smart-table-sheet-request-logs",
|
|
1024
|
+
description: "Import historical request logs from PromptLayer into a Smart Table sheet. Provide either explicit " +
|
|
1025
|
+
"request_log_ids or a filter_group (same syntax as search-request-logs — filter by model, prompt, " +
|
|
1026
|
+
"metadata, date range, status, etc.). Use this to add production traffic rows to a table for " +
|
|
1027
|
+
"evaluation, comparison, or any other analysis.",
|
|
1028
|
+
inputSchema: ImportSmartTableSheetRequestLogsArgsSchema,
|
|
1029
|
+
annotations: { readOnlyHint: false },
|
|
1030
|
+
},
|
|
1031
|
+
"list-smart-table-columns": {
|
|
1032
|
+
name: "list-smart-table-columns",
|
|
1033
|
+
description: "List columns in a Smart Table sheet.",
|
|
1034
|
+
inputSchema: ListSmartTableColumnsArgsSchema,
|
|
828
1035
|
annotations: { readOnlyHint: true },
|
|
829
1036
|
},
|
|
830
|
-
"create-
|
|
831
|
-
name: "create-
|
|
832
|
-
description: "
|
|
833
|
-
|
|
1037
|
+
"create-smart-table-column": {
|
|
1038
|
+
name: "create-smart-table-column",
|
|
1039
|
+
description: "Add a column to a Smart Table sheet. Common types:\n" +
|
|
1040
|
+
" - PROMPT_TEMPLATE: run a prompt template against each row (e.g. regression testing or A/B comparison).\n" +
|
|
1041
|
+
" - LLM_ASSERTION: use an LLM to judge or assert something about a row's values.\n" +
|
|
1042
|
+
" - CODE_EXECUTION: run custom Python/JS logic per row.\n" +
|
|
1043
|
+
" - COMPARE: compare two column values side-by-side.\n" +
|
|
1044
|
+
" - CONTAINS / REGEX: string-matching checks.\n" +
|
|
1045
|
+
" - TEXT: static or manually entered text.\n" +
|
|
1046
|
+
" - DATASET: read a field from the imported dataset rows.\n" +
|
|
1047
|
+
"Use uppercase type values. Columns can depend on other columns via the dependencies field.",
|
|
1048
|
+
inputSchema: CreateSmartTableColumnArgsSchema,
|
|
834
1049
|
annotations: { readOnlyHint: false },
|
|
835
1050
|
},
|
|
836
|
-
"
|
|
837
|
-
name: "
|
|
838
|
-
description: "
|
|
839
|
-
inputSchema:
|
|
1051
|
+
"update-smart-table-column": {
|
|
1052
|
+
name: "update-smart-table-column",
|
|
1053
|
+
description: "Update a Smart Table column title, config, or dependencies. Column type and position are not changed by this tool.",
|
|
1054
|
+
inputSchema: UpdateSmartTableColumnArgsSchema,
|
|
840
1055
|
annotations: { readOnlyHint: false },
|
|
841
1056
|
},
|
|
842
|
-
"
|
|
843
|
-
name: "
|
|
844
|
-
description: "
|
|
845
|
-
inputSchema:
|
|
1057
|
+
"list-smart-table-rows": {
|
|
1058
|
+
name: "list-smart-table-rows",
|
|
1059
|
+
description: "List rows in a Smart Table sheet with optional column metadata and row counts.",
|
|
1060
|
+
inputSchema: ListSmartTableRowsArgsSchema,
|
|
846
1061
|
annotations: { readOnlyHint: true },
|
|
847
1062
|
},
|
|
848
|
-
"
|
|
849
|
-
name: "
|
|
850
|
-
description: "
|
|
851
|
-
inputSchema:
|
|
1063
|
+
"add-smart-table-rows": {
|
|
1064
|
+
name: "add-smart-table-rows",
|
|
1065
|
+
description: "Add up to 100 rows to a Smart Table sheet, optionally with values keyed by column UUID.",
|
|
1066
|
+
inputSchema: AddSmartTableRowsArgsSchema,
|
|
1067
|
+
annotations: { readOnlyHint: false },
|
|
1068
|
+
},
|
|
1069
|
+
"get-smart-table-cell": {
|
|
1070
|
+
name: "get-smart-table-cell",
|
|
1071
|
+
description: "Get a Smart Table cell by UUID.",
|
|
1072
|
+
inputSchema: GetSmartTableCellArgsSchema,
|
|
852
1073
|
annotations: { readOnlyHint: true },
|
|
853
1074
|
},
|
|
854
|
-
"update-
|
|
855
|
-
name: "update-
|
|
856
|
-
description: "
|
|
857
|
-
inputSchema:
|
|
1075
|
+
"update-smart-table-cell": {
|
|
1076
|
+
name: "update-smart-table-cell",
|
|
1077
|
+
description: "Update a Smart Table text cell. Computed cells should be recalculated instead.",
|
|
1078
|
+
inputSchema: UpdateSmartTableCellArgsSchema,
|
|
1079
|
+
annotations: { readOnlyHint: false },
|
|
1080
|
+
},
|
|
1081
|
+
"recalculate-smart-table-cell": {
|
|
1082
|
+
name: "recalculate-smart-table-cell",
|
|
1083
|
+
description: "Queue recalculation for one Smart Table computed cell.",
|
|
1084
|
+
inputSchema: RecalculateSmartTableCellArgsSchema,
|
|
858
1085
|
annotations: { readOnlyHint: false },
|
|
859
1086
|
},
|
|
860
|
-
"
|
|
861
|
-
name: "
|
|
862
|
-
description: "
|
|
863
|
-
inputSchema:
|
|
1087
|
+
"recalculate-smart-table-cells": {
|
|
1088
|
+
name: "recalculate-smart-table-cells",
|
|
1089
|
+
description: "Queue recalculation for multiple Smart Table computed cells.",
|
|
1090
|
+
inputSchema: RecalculateSmartTableCellsArgsSchema,
|
|
864
1091
|
annotations: { readOnlyHint: false },
|
|
865
1092
|
},
|
|
866
|
-
"
|
|
867
|
-
name: "
|
|
868
|
-
description: "
|
|
869
|
-
inputSchema:
|
|
1093
|
+
"list-smart-table-operations": {
|
|
1094
|
+
name: "list-smart-table-operations",
|
|
1095
|
+
description: "List active Smart Table sheet operations and cell status counts.",
|
|
1096
|
+
inputSchema: ListSmartTableOperationsArgsSchema,
|
|
1097
|
+
annotations: { readOnlyHint: true },
|
|
1098
|
+
},
|
|
1099
|
+
"create-smart-table-operation": {
|
|
1100
|
+
name: "create-smart-table-operation",
|
|
1101
|
+
description: "Trigger a recalculate operation on a Smart Table sheet — executes all computed columns " +
|
|
1102
|
+
"(PROMPT_TEMPLATE, LLM_ASSERTION, CODE_EXECUTION, etc.) for the selected rows and columns. " +
|
|
1103
|
+
"Scope the run with column_ids, row_ids, or statuses (e.g. only STALE cells). " +
|
|
1104
|
+
"Returns an operation_id to poll with get-smart-table-operation.",
|
|
1105
|
+
inputSchema: CreateSmartTableOperationArgsSchema,
|
|
870
1106
|
annotations: { readOnlyHint: false },
|
|
871
1107
|
},
|
|
872
|
-
"
|
|
873
|
-
name: "
|
|
874
|
-
description: "
|
|
875
|
-
inputSchema:
|
|
1108
|
+
"get-smart-table-operation": {
|
|
1109
|
+
name: "get-smart-table-operation",
|
|
1110
|
+
description: "Get status for a Smart Table sheet operation.",
|
|
1111
|
+
inputSchema: GetSmartTableOperationArgsSchema,
|
|
1112
|
+
annotations: { readOnlyHint: true },
|
|
1113
|
+
},
|
|
1114
|
+
"cancel-smart-table-operation": {
|
|
1115
|
+
name: "cancel-smart-table-operation",
|
|
1116
|
+
description: "Cancel an active Smart Table sheet operation.",
|
|
1117
|
+
inputSchema: CancelSmartTableOperationArgsSchema,
|
|
1118
|
+
annotations: { readOnlyHint: false },
|
|
1119
|
+
},
|
|
1120
|
+
"get-smart-table-score": {
|
|
1121
|
+
name: "get-smart-table-score",
|
|
1122
|
+
description: "Get the configured score and current aggregate result for a Smart Table sheet. " +
|
|
1123
|
+
"Useful when the sheet is being used as an evaluation — the score summarises how well the " +
|
|
1124
|
+
"assertion/computation columns performed across all rows.",
|
|
1125
|
+
inputSchema: GetSmartTableScoreArgsSchema,
|
|
1126
|
+
annotations: { readOnlyHint: true },
|
|
1127
|
+
},
|
|
1128
|
+
"configure-smart-table-score": {
|
|
1129
|
+
name: "configure-smart-table-score",
|
|
1130
|
+
description: "Configure scoring for a Smart Table sheet. Choose which columns contribute, set score_type " +
|
|
1131
|
+
"(auto, boolean, numeric, or custom), supply custom Python/JS aggregation code, or pass a full " +
|
|
1132
|
+
"score_config object.",
|
|
1133
|
+
inputSchema: ConfigureSmartTableScoreArgsSchema,
|
|
876
1134
|
annotations: { readOnlyHint: false },
|
|
877
1135
|
},
|
|
878
|
-
"
|
|
879
|
-
name: "
|
|
880
|
-
description: "
|
|
881
|
-
inputSchema:
|
|
1136
|
+
"recalculate-smart-table-score": {
|
|
1137
|
+
name: "recalculate-smart-table-score",
|
|
1138
|
+
description: "Recompute the aggregate score for a Smart Table sheet.",
|
|
1139
|
+
inputSchema: RecalculateSmartTableScoreArgsSchema,
|
|
882
1140
|
annotations: { readOnlyHint: false },
|
|
883
1141
|
},
|
|
884
|
-
"
|
|
885
|
-
name: "
|
|
886
|
-
description: "
|
|
887
|
-
|
|
1142
|
+
"list-smart-table-versions": {
|
|
1143
|
+
name: "list-smart-table-versions",
|
|
1144
|
+
description: "List saved snapshots (versions) for a Smart Table sheet. Versions capture the state of all rows " +
|
|
1145
|
+
"and cells at a point in time — useful for tracking how results change across prompt updates or runs.",
|
|
1146
|
+
inputSchema: ListSmartTableVersionsArgsSchema,
|
|
1147
|
+
annotations: { readOnlyHint: true },
|
|
1148
|
+
},
|
|
1149
|
+
"get-smart-table-version": {
|
|
1150
|
+
name: "get-smart-table-version",
|
|
1151
|
+
description: "Get a saved Smart Table sheet version, including its full snapshot of cell values.",
|
|
1152
|
+
inputSchema: GetSmartTableVersionArgsSchema,
|
|
1153
|
+
annotations: { readOnlyHint: true },
|
|
1154
|
+
},
|
|
1155
|
+
"create-smart-table-version": {
|
|
1156
|
+
name: "create-smart-table-version",
|
|
1157
|
+
description: "Save a named snapshot of a Smart Table sheet's current state — useful for capturing results " +
|
|
1158
|
+
"before making changes so you can compare later. Pass source_version_id to restore a prior snapshot.",
|
|
1159
|
+
inputSchema: CreateSmartTableVersionArgsSchema,
|
|
888
1160
|
annotations: { readOnlyHint: false },
|
|
889
1161
|
},
|
|
890
|
-
"
|
|
891
|
-
name: "
|
|
892
|
-
description: "
|
|
893
|
-
|
|
1162
|
+
"get-smart-table-score-history": {
|
|
1163
|
+
name: "get-smart-table-score-history",
|
|
1164
|
+
description: "Get score history across saved versions for a Smart Table sheet. Use this to track how scores " +
|
|
1165
|
+
"change over time — useful for regression monitoring when the sheet is used as an evaluation.",
|
|
1166
|
+
inputSchema: GetSmartTableScoreHistoryArgsSchema,
|
|
1167
|
+
annotations: { readOnlyHint: true },
|
|
1168
|
+
},
|
|
1169
|
+
"list-legacy-smart-table-migrations": {
|
|
1170
|
+
name: "list-legacy-smart-table-migrations",
|
|
1171
|
+
description: "List successful legacy dataset/evaluation to Smart Table migration mappings.",
|
|
1172
|
+
inputSchema: ListLegacySmartTableMigrationsArgsSchema,
|
|
1173
|
+
annotations: { readOnlyHint: true },
|
|
1174
|
+
},
|
|
1175
|
+
"preview-legacy-smart-table-migration": {
|
|
1176
|
+
name: "preview-legacy-smart-table-migration",
|
|
1177
|
+
description: "Preview conversion of a legacy dataset group, dataset, or report into a Smart Table.",
|
|
1178
|
+
inputSchema: PreviewLegacySmartTableMigrationArgsSchema,
|
|
1179
|
+
annotations: { readOnlyHint: true },
|
|
1180
|
+
},
|
|
1181
|
+
"migrate-legacy-to-smart-table": {
|
|
1182
|
+
name: "migrate-legacy-to-smart-table",
|
|
1183
|
+
description: "Start or dry-run conversion of a legacy dataset group, dataset, or report into a Smart Table.",
|
|
1184
|
+
inputSchema: MigrateLegacyToSmartTableArgsSchema,
|
|
894
1185
|
annotations: { readOnlyHint: false },
|
|
895
1186
|
},
|
|
1187
|
+
"get-legacy-smart-table-migration-job": {
|
|
1188
|
+
name: "get-legacy-smart-table-migration-job",
|
|
1189
|
+
description: "Get status and result details for a legacy Smart Table migration job.",
|
|
1190
|
+
inputSchema: GetLegacySmartTableMigrationJobArgsSchema,
|
|
1191
|
+
annotations: { readOnlyHint: true },
|
|
1192
|
+
},
|
|
896
1193
|
// ── Agents / Workflows ──────────────────────────────────────────────
|
|
897
1194
|
"list-workflows": {
|
|
898
1195
|
name: "list-workflows",
|
|
@@ -951,16 +1248,47 @@ export const TOOL_DEFINITIONS = {
|
|
|
951
1248
|
},
|
|
952
1249
|
"create-tool-registry": {
|
|
953
1250
|
name: "create-tool-registry",
|
|
954
|
-
description: "Create a new tool in the Tool Registry with an initial version. The tool definition should be in OpenAI function-calling format.",
|
|
1251
|
+
description: "Create a new tool in the Tool Registry with an initial version. The tool definition should be in OpenAI function-calling format. Pass an optional `execution` payload to attach a sandbox-executable body that PromptLayer will auto-run between LLM turns.",
|
|
955
1252
|
inputSchema: CreateToolRegistryArgsSchema,
|
|
956
1253
|
annotations: { readOnlyHint: false },
|
|
957
1254
|
},
|
|
958
1255
|
"create-tool-version": {
|
|
959
1256
|
name: "create-tool-version",
|
|
960
|
-
description: "Create a new version of an existing tool in the Tool Registry. Each version is immutable
|
|
1257
|
+
description: "Create a new version of an existing tool in the Tool Registry. Each version is immutable - this adds a new version with the updated definition. Pass an optional `execution` payload to attach (or replace) the sandbox-executable body for this version.",
|
|
961
1258
|
inputSchema: CreateToolVersionArgsSchema,
|
|
962
1259
|
annotations: { readOnlyHint: false },
|
|
963
1260
|
},
|
|
1261
|
+
"test-execute-tool-registry": {
|
|
1262
|
+
name: "test-execute-tool-registry",
|
|
1263
|
+
description: "Run a tool's execution body in the sandbox against test inputs. Returns the body's return value plus stdout/stderr/duration. Useful for verifying a body before publishing. Pass `execution` and/or `tool_definition` to test unsaved overrides without creating a version. User-code errors return status='error' inside the result (HTTP 200); sandbox infrastructure failures return HTTP 502.",
|
|
1264
|
+
inputSchema: TestExecuteToolRegistryArgsSchema,
|
|
1265
|
+
annotations: { readOnlyHint: false },
|
|
1266
|
+
},
|
|
1267
|
+
// ── Env Vars ────────────────────────────────────────────────────────
|
|
1268
|
+
"list-workspace-env-vars": {
|
|
1269
|
+
name: "list-workspace-env-vars",
|
|
1270
|
+
description: "List workspace-scoped environment variables. Returned values are masked (only `value_suffix` — last 4 chars). Workspace vars auto-inject into every auto-executing tool in this workspace; tool-scoped vars override them on the same key.",
|
|
1271
|
+
inputSchema: ListWorkspaceEnvVarsArgsSchema,
|
|
1272
|
+
annotations: { readOnlyHint: true },
|
|
1273
|
+
},
|
|
1274
|
+
"create-workspace-env-var": {
|
|
1275
|
+
name: "create-workspace-env-var",
|
|
1276
|
+
description: "Scaffold a workspace-scoped environment variable placeholder. Auto-injected into every auto-executing tool in this workspace. The value is always created empty; the user fills in the real value via Settings, Environment Variables. Key must match ^[A-Za-z_][A-Za-z0-9_]*$ and not collide with reserved runtime names.",
|
|
1277
|
+
inputSchema: CreateWorkspaceEnvVarArgsSchema,
|
|
1278
|
+
annotations: { readOnlyHint: false },
|
|
1279
|
+
},
|
|
1280
|
+
"list-tool-env-vars": {
|
|
1281
|
+
name: "list-tool-env-vars",
|
|
1282
|
+
description: "List tool-scoped environment variables for a specific tool (by ID or name). Returned values are masked (only `value_suffix`). Tool-scoped vars override workspace-scoped vars on the same key during sandbox execution.",
|
|
1283
|
+
inputSchema: ListToolEnvVarsArgsSchema,
|
|
1284
|
+
annotations: { readOnlyHint: true },
|
|
1285
|
+
},
|
|
1286
|
+
"create-tool-env-var": {
|
|
1287
|
+
name: "create-tool-env-var",
|
|
1288
|
+
description: "Scaffold a tool-scoped environment variable placeholder on a specific tool. Auto-injected only into THIS tool's sandbox execution and overrides any workspace-scoped var with the same key. The value is always created empty; the user fills in the real value via Settings.",
|
|
1289
|
+
inputSchema: CreateToolEnvVarArgsSchema,
|
|
1290
|
+
annotations: { readOnlyHint: false },
|
|
1291
|
+
},
|
|
964
1292
|
// ── Folders ─────────────────────────────────────────────────────────
|
|
965
1293
|
"create-folder": {
|
|
966
1294
|
name: "create-folder",
|