@promptlayer/mcp-server 1.15.0 → 1.16.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/build/types.d.ts CHANGED
@@ -1021,6 +1021,163 @@ export declare const GetRequestAnalyticsArgsSchema: z.ZodObject<{
1021
1021
  sort_by?: "status" | "request_start_time" | "input_tokens" | "output_tokens" | "cost" | "latency_ms" | "turn_count" | "tool_call_count" | undefined;
1022
1022
  sort_order?: "asc" | "desc" | undefined;
1023
1023
  }>;
1024
+ export declare const GetRequestAnalyticsCustomAnalyticsArgsSchema: z.ZodObject<{
1025
+ customCharts: z.ZodArray<z.ZodObject<{
1026
+ id: z.ZodString;
1027
+ title: z.ZodOptional<z.ZodString>;
1028
+ chartType: z.ZodEnum<["bar", "line", "area"]>;
1029
+ metric: z.ZodOptional<z.ZodEnum<["count", "sum", "avg", "min", "max", "percentile"]>>;
1030
+ metricField: z.ZodOptional<z.ZodEnum<["input_tokens", "output_tokens", "cost", "latency_ms", "prompt_version_number", "turn_count", "tool_call_count", "cached_tokens", "thinking_tokens"]>>;
1031
+ percentile: z.ZodOptional<z.ZodNumber>;
1032
+ series: z.ZodOptional<z.ZodArray<z.ZodObject<{
1033
+ key: z.ZodString;
1034
+ label: z.ZodString;
1035
+ metric: z.ZodEnum<["sum", "avg", "min", "max", "percentile"]>;
1036
+ metricField: z.ZodEnum<["input_tokens", "output_tokens", "cost", "latency_ms", "prompt_version_number", "turn_count", "tool_call_count", "cached_tokens", "thinking_tokens"]>;
1037
+ percentile: z.ZodOptional<z.ZodNumber>;
1038
+ }, "strip", z.ZodTypeAny, {
1039
+ label: string;
1040
+ key: string;
1041
+ metric: "sum" | "avg" | "min" | "max" | "percentile";
1042
+ metricField: "prompt_version_number" | "input_tokens" | "output_tokens" | "cost" | "latency_ms" | "turn_count" | "tool_call_count" | "cached_tokens" | "thinking_tokens";
1043
+ percentile?: number | undefined;
1044
+ }, {
1045
+ label: string;
1046
+ key: string;
1047
+ metric: "sum" | "avg" | "min" | "max" | "percentile";
1048
+ metricField: "prompt_version_number" | "input_tokens" | "output_tokens" | "cost" | "latency_ms" | "turn_count" | "tool_call_count" | "cached_tokens" | "thinking_tokens";
1049
+ percentile?: number | undefined;
1050
+ }>, "many">>;
1051
+ derivedInsights: z.ZodOptional<z.ZodArray<z.ZodObject<{
1052
+ label: z.ZodString;
1053
+ numeratorSeriesKey: z.ZodString;
1054
+ denominatorSeriesKey: z.ZodString;
1055
+ }, "strip", z.ZodTypeAny, {
1056
+ label: string;
1057
+ numeratorSeriesKey: string;
1058
+ denominatorSeriesKey: string;
1059
+ }, {
1060
+ label: string;
1061
+ numeratorSeriesKey: string;
1062
+ denominatorSeriesKey: string;
1063
+ }>, "many">>;
1064
+ groupByField: z.ZodOptional<z.ZodEnum<["engine", "provider_type", "prompt_id", "prompt_version_number", "status", "error_type", "tags", "metadata_keys", "output_keys", "input_variable_keys", "tool_names"]>>;
1065
+ groupByMetadataKey: z.ZodOptional<z.ZodString>;
1066
+ timeSeries: z.ZodOptional<z.ZodBoolean>;
1067
+ limit: z.ZodOptional<z.ZodNumber>;
1068
+ }, "strip", z.ZodTypeAny, {
1069
+ id: string;
1070
+ chartType: "bar" | "line" | "area";
1071
+ percentile?: number | undefined;
1072
+ metric?: "sum" | "avg" | "min" | "max" | "percentile" | "count" | undefined;
1073
+ metricField?: "prompt_version_number" | "input_tokens" | "output_tokens" | "cost" | "latency_ms" | "turn_count" | "tool_call_count" | "cached_tokens" | "thinking_tokens" | undefined;
1074
+ title?: string | undefined;
1075
+ series?: {
1076
+ label: string;
1077
+ key: string;
1078
+ metric: "sum" | "avg" | "min" | "max" | "percentile";
1079
+ metricField: "prompt_version_number" | "input_tokens" | "output_tokens" | "cost" | "latency_ms" | "turn_count" | "tool_call_count" | "cached_tokens" | "thinking_tokens";
1080
+ percentile?: number | undefined;
1081
+ }[] | undefined;
1082
+ derivedInsights?: {
1083
+ label: string;
1084
+ numeratorSeriesKey: string;
1085
+ denominatorSeriesKey: string;
1086
+ }[] | undefined;
1087
+ groupByField?: "status" | "tags" | "prompt_id" | "prompt_version_number" | "error_type" | "engine" | "provider_type" | "metadata_keys" | "tool_names" | "output_keys" | "input_variable_keys" | undefined;
1088
+ groupByMetadataKey?: string | undefined;
1089
+ timeSeries?: boolean | undefined;
1090
+ limit?: number | undefined;
1091
+ }, {
1092
+ id: string;
1093
+ chartType: "bar" | "line" | "area";
1094
+ percentile?: number | undefined;
1095
+ metric?: "sum" | "avg" | "min" | "max" | "percentile" | "count" | undefined;
1096
+ metricField?: "prompt_version_number" | "input_tokens" | "output_tokens" | "cost" | "latency_ms" | "turn_count" | "tool_call_count" | "cached_tokens" | "thinking_tokens" | undefined;
1097
+ title?: string | undefined;
1098
+ series?: {
1099
+ label: string;
1100
+ key: string;
1101
+ metric: "sum" | "avg" | "min" | "max" | "percentile";
1102
+ metricField: "prompt_version_number" | "input_tokens" | "output_tokens" | "cost" | "latency_ms" | "turn_count" | "tool_call_count" | "cached_tokens" | "thinking_tokens";
1103
+ percentile?: number | undefined;
1104
+ }[] | undefined;
1105
+ derivedInsights?: {
1106
+ label: string;
1107
+ numeratorSeriesKey: string;
1108
+ denominatorSeriesKey: string;
1109
+ }[] | undefined;
1110
+ groupByField?: "status" | "tags" | "prompt_id" | "prompt_version_number" | "error_type" | "engine" | "provider_type" | "metadata_keys" | "tool_names" | "output_keys" | "input_variable_keys" | undefined;
1111
+ groupByMetadataKey?: string | undefined;
1112
+ timeSeries?: boolean | undefined;
1113
+ limit?: number | undefined;
1114
+ }>, "many">;
1115
+ api_key: z.ZodOptional<z.ZodString>;
1116
+ filter_group: z.ZodOptional<z.ZodType<any, z.ZodTypeDef, any>>;
1117
+ q: z.ZodOptional<z.ZodString>;
1118
+ sort_by: z.ZodOptional<z.ZodEnum<["request_start_time", "input_tokens", "output_tokens", "cost", "latency_ms", "status", "turn_count", "tool_call_count"]>>;
1119
+ sort_order: z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
1120
+ }, "strip", z.ZodTypeAny, {
1121
+ customCharts: {
1122
+ id: string;
1123
+ chartType: "bar" | "line" | "area";
1124
+ percentile?: number | undefined;
1125
+ metric?: "sum" | "avg" | "min" | "max" | "percentile" | "count" | undefined;
1126
+ metricField?: "prompt_version_number" | "input_tokens" | "output_tokens" | "cost" | "latency_ms" | "turn_count" | "tool_call_count" | "cached_tokens" | "thinking_tokens" | undefined;
1127
+ title?: string | undefined;
1128
+ series?: {
1129
+ label: string;
1130
+ key: string;
1131
+ metric: "sum" | "avg" | "min" | "max" | "percentile";
1132
+ metricField: "prompt_version_number" | "input_tokens" | "output_tokens" | "cost" | "latency_ms" | "turn_count" | "tool_call_count" | "cached_tokens" | "thinking_tokens";
1133
+ percentile?: number | undefined;
1134
+ }[] | undefined;
1135
+ derivedInsights?: {
1136
+ label: string;
1137
+ numeratorSeriesKey: string;
1138
+ denominatorSeriesKey: string;
1139
+ }[] | undefined;
1140
+ groupByField?: "status" | "tags" | "prompt_id" | "prompt_version_number" | "error_type" | "engine" | "provider_type" | "metadata_keys" | "tool_names" | "output_keys" | "input_variable_keys" | undefined;
1141
+ groupByMetadataKey?: string | undefined;
1142
+ timeSeries?: boolean | undefined;
1143
+ limit?: number | undefined;
1144
+ }[];
1145
+ api_key?: string | undefined;
1146
+ filter_group?: any;
1147
+ q?: string | undefined;
1148
+ sort_by?: "status" | "request_start_time" | "input_tokens" | "output_tokens" | "cost" | "latency_ms" | "turn_count" | "tool_call_count" | undefined;
1149
+ sort_order?: "asc" | "desc" | undefined;
1150
+ }, {
1151
+ customCharts: {
1152
+ id: string;
1153
+ chartType: "bar" | "line" | "area";
1154
+ percentile?: number | undefined;
1155
+ metric?: "sum" | "avg" | "min" | "max" | "percentile" | "count" | undefined;
1156
+ metricField?: "prompt_version_number" | "input_tokens" | "output_tokens" | "cost" | "latency_ms" | "turn_count" | "tool_call_count" | "cached_tokens" | "thinking_tokens" | undefined;
1157
+ title?: string | undefined;
1158
+ series?: {
1159
+ label: string;
1160
+ key: string;
1161
+ metric: "sum" | "avg" | "min" | "max" | "percentile";
1162
+ metricField: "prompt_version_number" | "input_tokens" | "output_tokens" | "cost" | "latency_ms" | "turn_count" | "tool_call_count" | "cached_tokens" | "thinking_tokens";
1163
+ percentile?: number | undefined;
1164
+ }[] | undefined;
1165
+ derivedInsights?: {
1166
+ label: string;
1167
+ numeratorSeriesKey: string;
1168
+ denominatorSeriesKey: string;
1169
+ }[] | undefined;
1170
+ groupByField?: "status" | "tags" | "prompt_id" | "prompt_version_number" | "error_type" | "engine" | "provider_type" | "metadata_keys" | "tool_names" | "output_keys" | "input_variable_keys" | undefined;
1171
+ groupByMetadataKey?: string | undefined;
1172
+ timeSeries?: boolean | undefined;
1173
+ limit?: number | undefined;
1174
+ }[];
1175
+ api_key?: string | undefined;
1176
+ filter_group?: any;
1177
+ q?: string | undefined;
1178
+ sort_by?: "status" | "request_start_time" | "input_tokens" | "output_tokens" | "cost" | "latency_ms" | "turn_count" | "tool_call_count" | undefined;
1179
+ sort_order?: "asc" | "desc" | undefined;
1180
+ }>;
1024
1181
  export declare const GetRequestArgsSchema: z.ZodObject<{
1025
1182
  request_id: z.ZodNumber;
1026
1183
  api_key: z.ZodOptional<z.ZodString>;
@@ -1201,22 +1358,22 @@ export declare const CreateSmartTableSheetArgsSchema: z.ZodObject<{
1201
1358
  q?: string | undefined;
1202
1359
  sort_by?: string | undefined;
1203
1360
  sort_order?: "asc" | "desc" | undefined;
1361
+ limit?: number | undefined;
1204
1362
  request_log_ids?: number[] | undefined;
1205
1363
  metadata_cost_breakdown_key?: string | undefined;
1206
1364
  variables_to_parse?: string[] | undefined;
1207
1365
  include_fields?: string[] | undefined;
1208
- limit?: number | undefined;
1209
1366
  }, {
1210
1367
  type: "request_logs";
1211
1368
  filter_group?: any;
1212
1369
  q?: string | undefined;
1213
1370
  sort_by?: string | undefined;
1214
1371
  sort_order?: "asc" | "desc" | undefined;
1372
+ limit?: number | undefined;
1215
1373
  request_log_ids?: number[] | undefined;
1216
1374
  metadata_cost_breakdown_key?: string | undefined;
1217
1375
  variables_to_parse?: string[] | undefined;
1218
1376
  include_fields?: string[] | undefined;
1219
- limit?: number | undefined;
1220
1377
  }>]>;
1221
1378
  api_key: z.ZodOptional<z.ZodString>;
1222
1379
  }, "strip", z.ZodTypeAny, {
@@ -1231,11 +1388,11 @@ export declare const CreateSmartTableSheetArgsSchema: z.ZodObject<{
1231
1388
  q?: string | undefined;
1232
1389
  sort_by?: string | undefined;
1233
1390
  sort_order?: "asc" | "desc" | undefined;
1391
+ limit?: number | undefined;
1234
1392
  request_log_ids?: number[] | undefined;
1235
1393
  metadata_cost_breakdown_key?: string | undefined;
1236
1394
  variables_to_parse?: string[] | undefined;
1237
1395
  include_fields?: string[] | undefined;
1238
- limit?: number | undefined;
1239
1396
  };
1240
1397
  api_key?: string | undefined;
1241
1398
  title?: string | undefined;
@@ -1253,11 +1410,11 @@ export declare const CreateSmartTableSheetArgsSchema: z.ZodObject<{
1253
1410
  q?: string | undefined;
1254
1411
  sort_by?: string | undefined;
1255
1412
  sort_order?: "asc" | "desc" | undefined;
1413
+ limit?: number | undefined;
1256
1414
  request_log_ids?: number[] | undefined;
1257
1415
  metadata_cost_breakdown_key?: string | undefined;
1258
1416
  variables_to_parse?: string[] | undefined;
1259
1417
  include_fields?: string[] | undefined;
1260
- limit?: number | undefined;
1261
1418
  };
1262
1419
  api_key?: string | undefined;
1263
1420
  title?: string | undefined;
@@ -1353,11 +1510,11 @@ export declare const ImportSmartTableSheetRequestLogsArgsSchema: z.ZodObject<{
1353
1510
  q?: string | undefined;
1354
1511
  sort_by?: string | undefined;
1355
1512
  sort_order?: "asc" | "desc" | undefined;
1513
+ limit?: number | undefined;
1356
1514
  request_log_ids?: number[] | undefined;
1357
1515
  metadata_cost_breakdown_key?: string | undefined;
1358
1516
  variables_to_parse?: string[] | undefined;
1359
1517
  include_fields?: string[] | undefined;
1360
- limit?: number | undefined;
1361
1518
  operation_id?: string | undefined;
1362
1519
  }, {
1363
1520
  table_id: string;
@@ -1367,11 +1524,11 @@ export declare const ImportSmartTableSheetRequestLogsArgsSchema: z.ZodObject<{
1367
1524
  q?: string | undefined;
1368
1525
  sort_by?: string | undefined;
1369
1526
  sort_order?: "asc" | "desc" | undefined;
1527
+ limit?: number | undefined;
1370
1528
  request_log_ids?: number[] | undefined;
1371
1529
  metadata_cost_breakdown_key?: string | undefined;
1372
1530
  variables_to_parse?: string[] | undefined;
1373
1531
  include_fields?: string[] | undefined;
1374
- limit?: number | undefined;
1375
1532
  operation_id?: string | undefined;
1376
1533
  }>;
1377
1534
  export declare const ListSmartTableColumnsArgsSchema: z.ZodObject<{
@@ -2581,22 +2738,22 @@ export declare const TOOL_DEFINITIONS: {
2581
2738
  q?: string | undefined;
2582
2739
  sort_by?: string | undefined;
2583
2740
  sort_order?: "asc" | "desc" | undefined;
2741
+ limit?: number | undefined;
2584
2742
  request_log_ids?: number[] | undefined;
2585
2743
  metadata_cost_breakdown_key?: string | undefined;
2586
2744
  variables_to_parse?: string[] | undefined;
2587
2745
  include_fields?: string[] | undefined;
2588
- limit?: number | undefined;
2589
2746
  }, {
2590
2747
  type: "request_logs";
2591
2748
  filter_group?: any;
2592
2749
  q?: string | undefined;
2593
2750
  sort_by?: string | undefined;
2594
2751
  sort_order?: "asc" | "desc" | undefined;
2752
+ limit?: number | undefined;
2595
2753
  request_log_ids?: number[] | undefined;
2596
2754
  metadata_cost_breakdown_key?: string | undefined;
2597
2755
  variables_to_parse?: string[] | undefined;
2598
2756
  include_fields?: string[] | undefined;
2599
- limit?: number | undefined;
2600
2757
  }>]>;
2601
2758
  api_key: z.ZodOptional<z.ZodString>;
2602
2759
  }, "strip", z.ZodTypeAny, {
@@ -2611,11 +2768,11 @@ export declare const TOOL_DEFINITIONS: {
2611
2768
  q?: string | undefined;
2612
2769
  sort_by?: string | undefined;
2613
2770
  sort_order?: "asc" | "desc" | undefined;
2771
+ limit?: number | undefined;
2614
2772
  request_log_ids?: number[] | undefined;
2615
2773
  metadata_cost_breakdown_key?: string | undefined;
2616
2774
  variables_to_parse?: string[] | undefined;
2617
2775
  include_fields?: string[] | undefined;
2618
- limit?: number | undefined;
2619
2776
  };
2620
2777
  api_key?: string | undefined;
2621
2778
  title?: string | undefined;
@@ -2633,11 +2790,11 @@ export declare const TOOL_DEFINITIONS: {
2633
2790
  q?: string | undefined;
2634
2791
  sort_by?: string | undefined;
2635
2792
  sort_order?: "asc" | "desc" | undefined;
2793
+ limit?: number | undefined;
2636
2794
  request_log_ids?: number[] | undefined;
2637
2795
  metadata_cost_breakdown_key?: string | undefined;
2638
2796
  variables_to_parse?: string[] | undefined;
2639
2797
  include_fields?: string[] | undefined;
2640
- limit?: number | undefined;
2641
2798
  };
2642
2799
  api_key?: string | undefined;
2643
2800
  title?: string | undefined;
@@ -2768,11 +2925,11 @@ export declare const TOOL_DEFINITIONS: {
2768
2925
  q?: string | undefined;
2769
2926
  sort_by?: string | undefined;
2770
2927
  sort_order?: "asc" | "desc" | undefined;
2928
+ limit?: number | undefined;
2771
2929
  request_log_ids?: number[] | undefined;
2772
2930
  metadata_cost_breakdown_key?: string | undefined;
2773
2931
  variables_to_parse?: string[] | undefined;
2774
2932
  include_fields?: string[] | undefined;
2775
- limit?: number | undefined;
2776
2933
  operation_id?: string | undefined;
2777
2934
  }, {
2778
2935
  table_id: string;
@@ -2782,11 +2939,11 @@ export declare const TOOL_DEFINITIONS: {
2782
2939
  q?: string | undefined;
2783
2940
  sort_by?: string | undefined;
2784
2941
  sort_order?: "asc" | "desc" | undefined;
2942
+ limit?: number | undefined;
2785
2943
  request_log_ids?: number[] | undefined;
2786
2944
  metadata_cost_breakdown_key?: string | undefined;
2787
2945
  variables_to_parse?: string[] | undefined;
2788
2946
  include_fields?: string[] | undefined;
2789
- limit?: number | undefined;
2790
2947
  operation_id?: string | undefined;
2791
2948
  }>;
2792
2949
  readonly annotations: {
@@ -4318,6 +4475,170 @@ export declare const TOOL_DEFINITIONS: {
4318
4475
  readonly readOnlyHint: true;
4319
4476
  };
4320
4477
  };
4478
+ readonly "get-request-analytics-custom-analytics": {
4479
+ readonly name: "get-request-analytics-custom-analytics";
4480
+ readonly description: string;
4481
+ readonly inputSchema: z.ZodObject<{
4482
+ customCharts: z.ZodArray<z.ZodObject<{
4483
+ id: z.ZodString;
4484
+ title: z.ZodOptional<z.ZodString>;
4485
+ chartType: z.ZodEnum<["bar", "line", "area"]>;
4486
+ metric: z.ZodOptional<z.ZodEnum<["count", "sum", "avg", "min", "max", "percentile"]>>;
4487
+ metricField: z.ZodOptional<z.ZodEnum<["input_tokens", "output_tokens", "cost", "latency_ms", "prompt_version_number", "turn_count", "tool_call_count", "cached_tokens", "thinking_tokens"]>>;
4488
+ percentile: z.ZodOptional<z.ZodNumber>;
4489
+ series: z.ZodOptional<z.ZodArray<z.ZodObject<{
4490
+ key: z.ZodString;
4491
+ label: z.ZodString;
4492
+ metric: z.ZodEnum<["sum", "avg", "min", "max", "percentile"]>;
4493
+ metricField: z.ZodEnum<["input_tokens", "output_tokens", "cost", "latency_ms", "prompt_version_number", "turn_count", "tool_call_count", "cached_tokens", "thinking_tokens"]>;
4494
+ percentile: z.ZodOptional<z.ZodNumber>;
4495
+ }, "strip", z.ZodTypeAny, {
4496
+ label: string;
4497
+ key: string;
4498
+ metric: "sum" | "avg" | "min" | "max" | "percentile";
4499
+ metricField: "prompt_version_number" | "input_tokens" | "output_tokens" | "cost" | "latency_ms" | "turn_count" | "tool_call_count" | "cached_tokens" | "thinking_tokens";
4500
+ percentile?: number | undefined;
4501
+ }, {
4502
+ label: string;
4503
+ key: string;
4504
+ metric: "sum" | "avg" | "min" | "max" | "percentile";
4505
+ metricField: "prompt_version_number" | "input_tokens" | "output_tokens" | "cost" | "latency_ms" | "turn_count" | "tool_call_count" | "cached_tokens" | "thinking_tokens";
4506
+ percentile?: number | undefined;
4507
+ }>, "many">>;
4508
+ derivedInsights: z.ZodOptional<z.ZodArray<z.ZodObject<{
4509
+ label: z.ZodString;
4510
+ numeratorSeriesKey: z.ZodString;
4511
+ denominatorSeriesKey: z.ZodString;
4512
+ }, "strip", z.ZodTypeAny, {
4513
+ label: string;
4514
+ numeratorSeriesKey: string;
4515
+ denominatorSeriesKey: string;
4516
+ }, {
4517
+ label: string;
4518
+ numeratorSeriesKey: string;
4519
+ denominatorSeriesKey: string;
4520
+ }>, "many">>;
4521
+ groupByField: z.ZodOptional<z.ZodEnum<["engine", "provider_type", "prompt_id", "prompt_version_number", "status", "error_type", "tags", "metadata_keys", "output_keys", "input_variable_keys", "tool_names"]>>;
4522
+ groupByMetadataKey: z.ZodOptional<z.ZodString>;
4523
+ timeSeries: z.ZodOptional<z.ZodBoolean>;
4524
+ limit: z.ZodOptional<z.ZodNumber>;
4525
+ }, "strip", z.ZodTypeAny, {
4526
+ id: string;
4527
+ chartType: "bar" | "line" | "area";
4528
+ percentile?: number | undefined;
4529
+ metric?: "sum" | "avg" | "min" | "max" | "percentile" | "count" | undefined;
4530
+ metricField?: "prompt_version_number" | "input_tokens" | "output_tokens" | "cost" | "latency_ms" | "turn_count" | "tool_call_count" | "cached_tokens" | "thinking_tokens" | undefined;
4531
+ title?: string | undefined;
4532
+ series?: {
4533
+ label: string;
4534
+ key: string;
4535
+ metric: "sum" | "avg" | "min" | "max" | "percentile";
4536
+ metricField: "prompt_version_number" | "input_tokens" | "output_tokens" | "cost" | "latency_ms" | "turn_count" | "tool_call_count" | "cached_tokens" | "thinking_tokens";
4537
+ percentile?: number | undefined;
4538
+ }[] | undefined;
4539
+ derivedInsights?: {
4540
+ label: string;
4541
+ numeratorSeriesKey: string;
4542
+ denominatorSeriesKey: string;
4543
+ }[] | undefined;
4544
+ groupByField?: "status" | "tags" | "prompt_id" | "prompt_version_number" | "error_type" | "engine" | "provider_type" | "metadata_keys" | "tool_names" | "output_keys" | "input_variable_keys" | undefined;
4545
+ groupByMetadataKey?: string | undefined;
4546
+ timeSeries?: boolean | undefined;
4547
+ limit?: number | undefined;
4548
+ }, {
4549
+ id: string;
4550
+ chartType: "bar" | "line" | "area";
4551
+ percentile?: number | undefined;
4552
+ metric?: "sum" | "avg" | "min" | "max" | "percentile" | "count" | undefined;
4553
+ metricField?: "prompt_version_number" | "input_tokens" | "output_tokens" | "cost" | "latency_ms" | "turn_count" | "tool_call_count" | "cached_tokens" | "thinking_tokens" | undefined;
4554
+ title?: string | undefined;
4555
+ series?: {
4556
+ label: string;
4557
+ key: string;
4558
+ metric: "sum" | "avg" | "min" | "max" | "percentile";
4559
+ metricField: "prompt_version_number" | "input_tokens" | "output_tokens" | "cost" | "latency_ms" | "turn_count" | "tool_call_count" | "cached_tokens" | "thinking_tokens";
4560
+ percentile?: number | undefined;
4561
+ }[] | undefined;
4562
+ derivedInsights?: {
4563
+ label: string;
4564
+ numeratorSeriesKey: string;
4565
+ denominatorSeriesKey: string;
4566
+ }[] | undefined;
4567
+ groupByField?: "status" | "tags" | "prompt_id" | "prompt_version_number" | "error_type" | "engine" | "provider_type" | "metadata_keys" | "tool_names" | "output_keys" | "input_variable_keys" | undefined;
4568
+ groupByMetadataKey?: string | undefined;
4569
+ timeSeries?: boolean | undefined;
4570
+ limit?: number | undefined;
4571
+ }>, "many">;
4572
+ api_key: z.ZodOptional<z.ZodString>;
4573
+ filter_group: z.ZodOptional<z.ZodType<any, z.ZodTypeDef, any>>;
4574
+ q: z.ZodOptional<z.ZodString>;
4575
+ sort_by: z.ZodOptional<z.ZodEnum<["request_start_time", "input_tokens", "output_tokens", "cost", "latency_ms", "status", "turn_count", "tool_call_count"]>>;
4576
+ sort_order: z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
4577
+ }, "strip", z.ZodTypeAny, {
4578
+ customCharts: {
4579
+ id: string;
4580
+ chartType: "bar" | "line" | "area";
4581
+ percentile?: number | undefined;
4582
+ metric?: "sum" | "avg" | "min" | "max" | "percentile" | "count" | undefined;
4583
+ metricField?: "prompt_version_number" | "input_tokens" | "output_tokens" | "cost" | "latency_ms" | "turn_count" | "tool_call_count" | "cached_tokens" | "thinking_tokens" | undefined;
4584
+ title?: string | undefined;
4585
+ series?: {
4586
+ label: string;
4587
+ key: string;
4588
+ metric: "sum" | "avg" | "min" | "max" | "percentile";
4589
+ metricField: "prompt_version_number" | "input_tokens" | "output_tokens" | "cost" | "latency_ms" | "turn_count" | "tool_call_count" | "cached_tokens" | "thinking_tokens";
4590
+ percentile?: number | undefined;
4591
+ }[] | undefined;
4592
+ derivedInsights?: {
4593
+ label: string;
4594
+ numeratorSeriesKey: string;
4595
+ denominatorSeriesKey: string;
4596
+ }[] | undefined;
4597
+ groupByField?: "status" | "tags" | "prompt_id" | "prompt_version_number" | "error_type" | "engine" | "provider_type" | "metadata_keys" | "tool_names" | "output_keys" | "input_variable_keys" | undefined;
4598
+ groupByMetadataKey?: string | undefined;
4599
+ timeSeries?: boolean | undefined;
4600
+ limit?: number | undefined;
4601
+ }[];
4602
+ api_key?: string | undefined;
4603
+ filter_group?: any;
4604
+ q?: string | undefined;
4605
+ sort_by?: "status" | "request_start_time" | "input_tokens" | "output_tokens" | "cost" | "latency_ms" | "turn_count" | "tool_call_count" | undefined;
4606
+ sort_order?: "asc" | "desc" | undefined;
4607
+ }, {
4608
+ customCharts: {
4609
+ id: string;
4610
+ chartType: "bar" | "line" | "area";
4611
+ percentile?: number | undefined;
4612
+ metric?: "sum" | "avg" | "min" | "max" | "percentile" | "count" | undefined;
4613
+ metricField?: "prompt_version_number" | "input_tokens" | "output_tokens" | "cost" | "latency_ms" | "turn_count" | "tool_call_count" | "cached_tokens" | "thinking_tokens" | undefined;
4614
+ title?: string | undefined;
4615
+ series?: {
4616
+ label: string;
4617
+ key: string;
4618
+ metric: "sum" | "avg" | "min" | "max" | "percentile";
4619
+ metricField: "prompt_version_number" | "input_tokens" | "output_tokens" | "cost" | "latency_ms" | "turn_count" | "tool_call_count" | "cached_tokens" | "thinking_tokens";
4620
+ percentile?: number | undefined;
4621
+ }[] | undefined;
4622
+ derivedInsights?: {
4623
+ label: string;
4624
+ numeratorSeriesKey: string;
4625
+ denominatorSeriesKey: string;
4626
+ }[] | undefined;
4627
+ groupByField?: "status" | "tags" | "prompt_id" | "prompt_version_number" | "error_type" | "engine" | "provider_type" | "metadata_keys" | "tool_names" | "output_keys" | "input_variable_keys" | undefined;
4628
+ groupByMetadataKey?: string | undefined;
4629
+ timeSeries?: boolean | undefined;
4630
+ limit?: number | undefined;
4631
+ }[];
4632
+ api_key?: string | undefined;
4633
+ filter_group?: any;
4634
+ q?: string | undefined;
4635
+ sort_by?: "status" | "request_start_time" | "input_tokens" | "output_tokens" | "cost" | "latency_ms" | "turn_count" | "tool_call_count" | undefined;
4636
+ sort_order?: "asc" | "desc" | undefined;
4637
+ }>;
4638
+ readonly annotations: {
4639
+ readonly readOnlyHint: true;
4640
+ };
4641
+ };
4321
4642
  readonly "patch-prompt-template-version": {
4322
4643
  readonly name: "patch-prompt-template-version";
4323
4644
  readonly description: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyCtC,CAAC;AAIH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;EAOzC,CAAC;AAIH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;EAQxC,CAAC;AAKH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsB1C,CAAC;AAIH,eAAO,MAAM,kCAAkC;;;;;;;;;EAG7C,CAAC;AAKH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;EAMtC,CAAC;AAKH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;EAKpC,CAAC;AAIH,e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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqnBnB,CAAC"}
package/build/types.js CHANGED
@@ -467,6 +467,53 @@ export const GetRequestAnalyticsArgsSchema = z.object({
467
467
  ...RequestLogQueryShape,
468
468
  api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
469
469
  });
470
+ // ── Get Request Analytics Custom Analytics (POST /api/public/v2/requests/analytics/custom-analytics) ──
471
+ const METRIC_FIELD_VALUES = [
472
+ "input_tokens", "output_tokens", "cost", "latency_ms", "prompt_version_number",
473
+ "turn_count", "tool_call_count", "cached_tokens", "thinking_tokens",
474
+ ];
475
+ const GROUP_BY_FIELD_VALUES = [
476
+ "engine", "provider_type", "prompt_id", "prompt_version_number", "status",
477
+ "error_type", "tags", "metadata_keys", "output_keys", "input_variable_keys", "tool_names",
478
+ ];
479
+ const CustomChartSeriesSpecSchema = z.object({
480
+ key: z.string().min(1).max(64).regex(/^[a-zA-Z0-9_-]+$/).describe("Unique series key within the chart"),
481
+ label: z.string().min(1).max(120).describe("Human-readable series label"),
482
+ metric: z.enum(["sum", "avg", "min", "max", "percentile"]).describe("Aggregation function"),
483
+ metricField: z.enum(METRIC_FIELD_VALUES).describe("Numeric field to aggregate"),
484
+ percentile: z.number().min(0).max(100).optional().describe("Required when metric is percentile (0–100)"),
485
+ });
486
+ const DerivedRatioInsightSchema = z.object({
487
+ label: z.string().min(1).max(200).describe("Display label for this insight"),
488
+ numeratorSeriesKey: z.string().describe("Key of the numerator series"),
489
+ denominatorSeriesKey: z.string().describe("Key of the denominator series"),
490
+ });
491
+ const CustomChartSpecSchema = z.object({
492
+ id: z.string().min(1).max(64).regex(/^[a-zA-Z0-9_-]+$/).describe("Stable chart id (unique within the request)"),
493
+ title: z.string().max(200).optional().describe("Optional display title; defaults to id"),
494
+ chartType: z.enum(["bar", "line", "area"]).describe("Chart type. Overall aggregates (no timeSeries, no groupBy) must use bar"),
495
+ metric: z.enum(["count", "sum", "avg", "min", "max", "percentile"]).optional()
496
+ .describe("Aggregation function. Omit when using series (multi-series mode)"),
497
+ metricField: z.enum(METRIC_FIELD_VALUES).optional()
498
+ .describe("Numeric field to aggregate. Required unless metric is count or using series"),
499
+ percentile: z.number().min(0).max(100).optional().describe("Required when metric is percentile"),
500
+ series: z.array(CustomChartSeriesSpecSchema).min(2).optional()
501
+ .describe("Multi-series mode: two or more series specs. Omit metric/metricField when using this"),
502
+ derivedInsights: z.array(DerivedRatioInsightSchema).optional()
503
+ .describe("Ratio insights computed from series totals. Multi-series only"),
504
+ groupByField: z.enum(GROUP_BY_FIELD_VALUES).optional()
505
+ .describe("Break down by this request log field. Cannot be combined with groupByMetadataKey"),
506
+ groupByMetadataKey: z.string().min(1).max(120).optional()
507
+ .describe("Break down by values of this metadata key. Cannot be combined with groupByField"),
508
+ timeSeries: z.boolean().optional().describe("Bucket results over time when true"),
509
+ limit: z.number().int().min(1).max(100).optional().describe("Max group-by buckets to return (default 25)"),
510
+ });
511
+ export const GetRequestAnalyticsCustomAnalyticsArgsSchema = z.object({
512
+ ...RequestLogQueryShape,
513
+ customCharts: z.array(CustomChartSpecSchema).min(1)
514
+ .describe("One or more analytics queries to compute. IDs must be unique within the request"),
515
+ api_key: z.string().optional().describe("PromptLayer API key (optional, defaults to PROMPTLAYER_API_KEY env var)"),
516
+ });
470
517
  // ── Get Request (GET /api/public/v2/requests/{request_id}) ───────────────
471
518
  export const GetRequestArgsSchema = z.object({
472
519
  request_id: z.number().int().describe("Request ID to retrieve"),
@@ -1372,6 +1419,21 @@ export const TOOL_DEFINITIONS = {
1372
1419
  inputSchema: GetRequestAnalyticsArgsSchema,
1373
1420
  annotations: { readOnlyHint: true },
1374
1421
  },
1422
+ "get-request-analytics-custom-analytics": {
1423
+ name: "get-request-analytics-custom-analytics",
1424
+ description: "Run custom analytics queries over request logs. You define which metrics to compute and how to slice them; the API runs the aggregations and returns structured data rows you can use however you want — charts, analysis, dashboards, or programmatic processing.\n\n" +
1425
+ "Each query spec in `customCharts` controls:\n" +
1426
+ " - `metric`: count | sum | avg | min | max | percentile (with optional `percentile` 0–100)\n" +
1427
+ " - `metricField`: the numeric field to aggregate (input_tokens, output_tokens, cost, latency_ms, turn_count, tool_call_count, cached_tokens, thinking_tokens)\n" +
1428
+ " - `groupByField`: break down by engine, provider_type, prompt_id, status, error_type, tags, etc.\n" +
1429
+ " - `groupByMetadataKey`: break down by values of a specific metadata key\n" +
1430
+ " - `timeSeries: true`: bucket results over time\n" +
1431
+ " - `series`: multi-series mode — define two or more named series instead of a single metric\n\n" +
1432
+ "Use this when get-request-analytics doesn't cover the slice you need. " +
1433
+ "Examples: cost by metadata environment, p95 latency over time by prompt, input vs output token ratio.",
1434
+ inputSchema: GetRequestAnalyticsCustomAnalyticsArgsSchema,
1435
+ annotations: { readOnlyHint: true },
1436
+ },
1375
1437
  // ── Prompt Template Patch ───────────────────────────────────────────
1376
1438
  "patch-prompt-template-version": {
1377
1439
  name: "patch-prompt-template-version",