@promptlayer/mcp-server 1.6.0 → 1.8.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/README.md +5 -1
- package/build/client.d.ts +5 -0
- package/build/client.d.ts.map +1 -1
- package/build/client.js +5 -0
- package/build/client.js.map +1 -1
- package/build/handlers.d.ts.map +1 -1
- package/build/handlers.js +5 -0
- package/build/handlers.js.map +1 -1
- package/build/types.d.ts +208 -89
- package/build/types.d.ts.map +1 -1
- package/build/types.js +69 -16
- package/build/types.js.map +1 -1
- package/gcp/src/index.ts +8 -0
- package/package.json +1 -1
- package/src/client.ts +5 -0
- package/src/handlers.ts +14 -0
- package/src/types.ts +79 -16
package/src/types.ts
CHANGED
|
@@ -19,7 +19,6 @@ export const GetPromptTemplateArgsSchema = z.object({
|
|
|
19
19
|
.min(1)
|
|
20
20
|
.optional()
|
|
21
21
|
.describe("Specific version number (defaults to latest)"),
|
|
22
|
-
workspace_id: z.number().int().optional().describe("Workspace ID"),
|
|
23
22
|
label: z
|
|
24
23
|
.string()
|
|
25
24
|
.optional()
|
|
@@ -73,7 +72,6 @@ export const ListPromptTemplatesArgsSchema = z.object({
|
|
|
73
72
|
name: z.string().optional().describe("Filter by name (case-insensitive partial match)"),
|
|
74
73
|
tags: z.union([z.string(), z.array(z.string())]).optional().describe("Filter by tag(s). Only templates whose tags contain all specified values are returned."),
|
|
75
74
|
status: z.enum(["active", "deleted", "all"]).optional().describe("Filter by status (default: 'active')"),
|
|
76
|
-
workspace_id: z.number().int().optional().describe("Workspace ID"),
|
|
77
75
|
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
78
76
|
});
|
|
79
77
|
|
|
@@ -85,8 +83,7 @@ export const PublishPromptTemplateArgsSchema = z.object({
|
|
|
85
83
|
prompt_name: z.string().describe("Name of the prompt template"),
|
|
86
84
|
tags: z.array(z.string()).optional().describe("Tags to associate"),
|
|
87
85
|
folder_id: z.number().int().optional().describe("Folder ID to publish into"),
|
|
88
|
-
|
|
89
|
-
}).describe("Template metadata: prompt_name (required), tags, folder_id, workspace_id"),
|
|
86
|
+
}).describe("Template metadata: prompt_name (required), tags, folder_id"),
|
|
90
87
|
prompt_version: z.object({
|
|
91
88
|
prompt_template: z.record(z.unknown()).describe("The template content in chat ({type:'chat', messages:[...]}) or completion format"),
|
|
92
89
|
commit_message: z.string().optional().describe("Commit message (max 72 chars)"),
|
|
@@ -201,7 +198,6 @@ export const ListDatasetsArgsSchema = z.object({
|
|
|
201
198
|
prompt_version_id: z.number().int().optional().describe("Filter by prompt version ID"),
|
|
202
199
|
prompt_label_id: z.number().int().optional().describe("Filter by prompt label ID"),
|
|
203
200
|
report_id: z.number().int().optional().describe("Filter by report ID"),
|
|
204
|
-
workspace_id: z.number().int().optional().describe("Filter by workspace ID"),
|
|
205
201
|
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
206
202
|
});
|
|
207
203
|
|
|
@@ -209,7 +205,6 @@ export const ListDatasetsArgsSchema = z.object({
|
|
|
209
205
|
|
|
210
206
|
export const CreateDatasetGroupArgsSchema = z.object({
|
|
211
207
|
name: z.string().optional().describe("Dataset group name (unique within workspace). Auto-generated if omitted."),
|
|
212
|
-
workspace_id: z.number().int().optional().describe("Workspace ID"),
|
|
213
208
|
folder_id: z.number().int().optional().describe("Folder ID to place the dataset group into"),
|
|
214
209
|
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
215
210
|
});
|
|
@@ -228,7 +223,6 @@ export const CreateDatasetVersionFromFileArgsSchema = z.object({
|
|
|
228
223
|
export const CreateDatasetVersionFromFilterParamsArgsSchema = z.object({
|
|
229
224
|
dataset_group_id: z.number().int().describe("Dataset group ID"),
|
|
230
225
|
variables_to_parse: z.array(z.string()).optional().describe("Variables to extract from request logs"),
|
|
231
|
-
workspace_id: z.number().int().optional().describe("Workspace ID"),
|
|
232
226
|
tags: z.array(z.string()).optional().describe("Filter by tags (simple tag filter)"),
|
|
233
227
|
metadata: z.record(z.string()).optional().describe("Simple metadata key-value filter"),
|
|
234
228
|
start_time: z.string().optional().describe("Start time filter (ISO 8601)"),
|
|
@@ -270,7 +264,6 @@ export const CreateDatasetVersionFromFilterParamsArgsSchema = z.object({
|
|
|
270
264
|
|
|
271
265
|
export const GetDatasetRowsArgsSchema = z.object({
|
|
272
266
|
dataset_id: z.number().int().describe("The ID of the dataset to retrieve rows from"),
|
|
273
|
-
workspace_id: z.number().int().optional().describe("Filter by workspace ID"),
|
|
274
267
|
page: z.number().int().optional().describe("Page number (default: 1)"),
|
|
275
268
|
per_page: z.number().int().optional().describe("Rows per page (default: 10, max: 100)"),
|
|
276
269
|
q: z.string().optional().describe("Search query for filtering rows"),
|
|
@@ -308,7 +301,6 @@ export const ListEvaluationsArgsSchema = z.object({
|
|
|
308
301
|
name: z.string().optional().describe("Filter by name (case-insensitive partial match)"),
|
|
309
302
|
status: z.enum(["active", "deleted", "all"]).optional().describe("Filter by status (default: 'active')"),
|
|
310
303
|
include_runs: z.boolean().optional().describe("If true, include batch runs nested under each evaluation with status and cell status counts (default: false)"),
|
|
311
|
-
workspace_id: z.number().int().optional().describe("Filter by workspace ID"),
|
|
312
304
|
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
313
305
|
});
|
|
314
306
|
|
|
@@ -316,7 +308,6 @@ export const ListEvaluationsArgsSchema = z.object({
|
|
|
316
308
|
|
|
317
309
|
export const GetEvaluationRowsArgsSchema = z.object({
|
|
318
310
|
evaluation_id: z.number().int().describe("The ID of the evaluation to retrieve rows from"),
|
|
319
|
-
workspace_id: z.number().int().optional().describe("Filter by workspace ID"),
|
|
320
311
|
page: z.number().int().optional().describe("Page number (default: 1)"),
|
|
321
312
|
per_page: z.number().int().optional().describe("Rows per page (default: 10, max: 100)"),
|
|
322
313
|
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
@@ -378,6 +369,53 @@ export const DeleteReportsByNameArgsSchema = z.object({
|
|
|
378
369
|
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
379
370
|
});
|
|
380
371
|
|
|
372
|
+
// ── Delete Report by ID (DELETE /reports/{report_id}) ────────────────────
|
|
373
|
+
|
|
374
|
+
export const DeleteReportArgsSchema = z.object({
|
|
375
|
+
report_id: z.number().int().describe("Evaluation pipeline ID to archive"),
|
|
376
|
+
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
377
|
+
});
|
|
378
|
+
|
|
379
|
+
// ── Rename Report (PATCH /reports/{report_id}/rename) ────────────────────
|
|
380
|
+
|
|
381
|
+
export const RenameReportArgsSchema = z.object({
|
|
382
|
+
report_id: z.number().int().describe("Evaluation pipeline ID to rename"),
|
|
383
|
+
name: z.string().min(1).max(255).optional().describe("New name for the evaluation pipeline. Provide name, tags, or both."),
|
|
384
|
+
tags: z.array(z.string()).optional().describe("Replace the pipeline's tags. Pass an empty array to clear them. Provide name, tags, or both."),
|
|
385
|
+
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
386
|
+
});
|
|
387
|
+
|
|
388
|
+
// ── Add Report Column (POST /report-columns) ─────────────────────────────
|
|
389
|
+
|
|
390
|
+
export const AddReportColumnArgsSchema = z.object({
|
|
391
|
+
report_id: z.number().int().describe("Evaluation pipeline ID to add the column to"),
|
|
392
|
+
column_type: z.string().describe("Column type (e.g. LLM_ASSERTION, CODE_EXECUTION, PROMPT_TEMPLATE). See https://docs.promptlayer.com/features/evaluations/column-types"),
|
|
393
|
+
name: z.string().min(1).describe("Unique column name within the pipeline"),
|
|
394
|
+
configuration: z.record(z.unknown()).describe("Column-type-specific configuration"),
|
|
395
|
+
position: z.number().int().positive().optional().describe("Position in the pipeline (auto-assigned if omitted). Cannot overwrite dataset columns."),
|
|
396
|
+
is_part_of_score: z.boolean().optional().describe("Whether this column contributes to the score (default false)"),
|
|
397
|
+
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
398
|
+
});
|
|
399
|
+
|
|
400
|
+
// ── Edit Report Column (PATCH /report-columns/{report_column_id}) ────────
|
|
401
|
+
|
|
402
|
+
export const EditReportColumnArgsSchema = z.object({
|
|
403
|
+
report_column_id: z.number().int().describe("Report column ID to edit"),
|
|
404
|
+
report_id: z.number().int().describe("Parent evaluation pipeline ID (must match the column's report)"),
|
|
405
|
+
column_type: z.string().describe("Column type (e.g. LLM_ASSERTION, CODE_EXECUTION, PROMPT_TEMPLATE). DATASET is not allowed."),
|
|
406
|
+
configuration: z.record(z.unknown()).optional().describe("Replacement column configuration"),
|
|
407
|
+
name: z.string().min(1).optional().describe("New column name (must be unique within the pipeline)"),
|
|
408
|
+
position: z.number().int().positive().optional().describe("New position. Cannot overwrite dataset columns."),
|
|
409
|
+
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
410
|
+
});
|
|
411
|
+
|
|
412
|
+
// ── Delete Report Column (DELETE /report-columns/{report_column_id}) ─────
|
|
413
|
+
|
|
414
|
+
export const DeleteReportColumnArgsSchema = z.object({
|
|
415
|
+
report_column_id: z.number().int().describe("Report column ID to delete. Cannot be a DATASET column."),
|
|
416
|
+
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
417
|
+
});
|
|
418
|
+
|
|
381
419
|
|
|
382
420
|
// ── List Agents (GET /workflows) ─────────────────────────────────────────
|
|
383
421
|
|
|
@@ -461,7 +499,6 @@ export const GetWorkflowLabelsArgsSchema = z.object({
|
|
|
461
499
|
export const CreateFolderArgsSchema = z.object({
|
|
462
500
|
name: z.string().describe("Folder name (unique within parent)"),
|
|
463
501
|
parent_id: z.number().int().optional().describe("Parent folder ID (root if omitted)"),
|
|
464
|
-
workspace_id: z.number().int().optional().describe("Workspace ID"),
|
|
465
502
|
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
466
503
|
});
|
|
467
504
|
|
|
@@ -493,7 +530,6 @@ export const GetFolderEntitiesArgsSchema = z.object({
|
|
|
493
530
|
tags: z.array(z.string()).optional().describe("Filter entities by tags (AND logic — all must match). Applies to prompts, workflows, datasets, evaluations."),
|
|
494
531
|
flatten: z.boolean().optional().describe("Flatten nested folder hierarchy (default: false)"),
|
|
495
532
|
include_metadata: z.boolean().optional().describe("Include entity metadata like latest_version_number (default: false)"),
|
|
496
|
-
workspace_id: z.number().int().optional().describe("Workspace ID"),
|
|
497
533
|
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
498
534
|
});
|
|
499
535
|
|
|
@@ -507,7 +543,6 @@ export const MoveFolderEntitiesArgsSchema = z.object({
|
|
|
507
543
|
type: EntityTypeEnum.describe("Entity type"),
|
|
508
544
|
})).describe("Entities to move"),
|
|
509
545
|
folder_id: z.number().int().optional().describe("Target folder ID (root if omitted)"),
|
|
510
|
-
workspace_id: z.number().int().optional().describe("Workspace ID"),
|
|
511
546
|
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
512
547
|
});
|
|
513
548
|
|
|
@@ -521,7 +556,6 @@ export const DeleteFolderEntitiesArgsSchema = z.object({
|
|
|
521
556
|
type: EntityTypeEnum.describe("Entity type"),
|
|
522
557
|
})).describe("Entities to delete"),
|
|
523
558
|
cascade: z.boolean().optional().describe("Delete folder contents recursively (default: false)"),
|
|
524
|
-
workspace_id: z.number().int().optional().describe("Workspace ID"),
|
|
525
559
|
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
526
560
|
});
|
|
527
561
|
|
|
@@ -531,7 +565,6 @@ export const DeleteFolderEntitiesArgsSchema = z.object({
|
|
|
531
565
|
|
|
532
566
|
export const ResolveFolderIdArgsSchema = z.object({
|
|
533
567
|
path: z.string().describe("Folder path to resolve (e.g. 'foo/bar')"),
|
|
534
|
-
workspace_id: z.number().int().optional().describe("Workspace ID"),
|
|
535
568
|
api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
|
|
536
569
|
});
|
|
537
570
|
|
|
@@ -820,7 +853,7 @@ export const TOOL_DEFINITIONS = {
|
|
|
820
853
|
// ── Evaluations ─────────────────────────────────────────────────────
|
|
821
854
|
"list-evaluations": {
|
|
822
855
|
name: "list-evaluations",
|
|
823
|
-
description: "List evaluation pipelines (called 'reports' in the API) with pagination. Filter by name, status
|
|
856
|
+
description: "List evaluation pipelines (called 'reports' in the API) with pagination. Filter by name, status. Set include_runs=true to include batch runs nested under each evaluation.",
|
|
824
857
|
inputSchema: ListEvaluationsArgsSchema,
|
|
825
858
|
annotations: { readOnlyHint: true },
|
|
826
859
|
},
|
|
@@ -866,6 +899,36 @@ export const TOOL_DEFINITIONS = {
|
|
|
866
899
|
inputSchema: DeleteReportsByNameArgsSchema,
|
|
867
900
|
annotations: { readOnlyHint: false },
|
|
868
901
|
},
|
|
902
|
+
"delete-report": {
|
|
903
|
+
name: "delete-report",
|
|
904
|
+
description: "Archive a single evaluation pipeline by ID. Prefer this over delete-reports-by-name when you have the report_id, since names can collide.",
|
|
905
|
+
inputSchema: DeleteReportArgsSchema,
|
|
906
|
+
annotations: { readOnlyHint: false },
|
|
907
|
+
},
|
|
908
|
+
"rename-report": {
|
|
909
|
+
name: "rename-report",
|
|
910
|
+
description: "Rename or retag an evaluation pipeline. Provide name, tags, or both. Use this instead of recreating a misnamed pipeline.",
|
|
911
|
+
inputSchema: RenameReportArgsSchema,
|
|
912
|
+
annotations: { readOnlyHint: false },
|
|
913
|
+
},
|
|
914
|
+
"add-report-column": {
|
|
915
|
+
name: "add-report-column",
|
|
916
|
+
description: "Add a single column to an existing evaluation pipeline. Use this to extend a pipeline incrementally instead of recreating the entire report. Column names must be unique within the pipeline. For column types and configuration, see https://docs.promptlayer.com/features/evaluations/column-types.",
|
|
917
|
+
inputSchema: AddReportColumnArgsSchema,
|
|
918
|
+
annotations: { readOnlyHint: false },
|
|
919
|
+
},
|
|
920
|
+
"edit-report-column": {
|
|
921
|
+
name: "edit-report-column",
|
|
922
|
+
description: "Update an existing evaluation column's type, configuration, name, or position. Use this to fix a bug in a CODE_EXECUTION script or change a column's settings without recreating the whole pipeline. Cannot edit DATASET columns.",
|
|
923
|
+
inputSchema: EditReportColumnArgsSchema,
|
|
924
|
+
annotations: { readOnlyHint: false },
|
|
925
|
+
},
|
|
926
|
+
"delete-report-column": {
|
|
927
|
+
name: "delete-report-column",
|
|
928
|
+
description: "Delete a single column from an evaluation pipeline. Cannot delete DATASET columns. Surrounding columns shift left to fill the gap.",
|
|
929
|
+
inputSchema: DeleteReportColumnArgsSchema,
|
|
930
|
+
annotations: { readOnlyHint: false },
|
|
931
|
+
},
|
|
869
932
|
|
|
870
933
|
// ── Agents / Workflows ──────────────────────────────────────────────
|
|
871
934
|
"list-workflows": {
|