@argosvix/mcp-server 0.28.3-alpha.1 → 0.30.0-alpha.1

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/dist/tools.js CHANGED
@@ -51,6 +51,7 @@ const TOOL_ARG_ALLOWLIST = {
51
51
  "sleepMinutes",
52
52
  "enabled",
53
53
  "conditions",
54
+ "evalCriterionId",
54
55
  ],
55
56
  // 2026-06-03 v1.6 #13-4 = update_alert / delete_alert tools (= axis 1 強化)。
56
57
  // backend PATCH/DELETE /v1/alerts/:id の wrap。 alertType は immutable (= backend
@@ -200,6 +201,13 @@ const TOOL_ARG_ALLOWLIST = {
200
201
  // 2026-06-02 Codex round 2 🔴 fix = idempotencyKey 必須 path (= AI agent が
201
202
  // retry した時に backend で dedup)、 client が opaque string 64 char で carry。
202
203
  run_eval: ["name", "recentCount", "label", "promptRegistryId", "idempotencyKey"],
204
+ // 2026-06-15 #2 Phase D4 = golden dataset (期待出力つき固定テストセット) ツール。
205
+ // list/get/create は CRUD、 run は対象モデルで実行 → judge → eval_scores (= 回帰 A/B)。
206
+ list_eval_datasets: [],
207
+ get_eval_dataset: ["datasetId"],
208
+ create_eval_dataset: ["name", "description", "items", "frozen"],
209
+ run_eval_dataset: ["datasetId", "targetModel", "judgeModel", "idempotencyKey"],
210
+ delete_eval_dataset: ["datasetId"],
203
211
  // 2026-06-06 axis 4 Tier 2 = 自律 AI ops 第一弾。 mutation 軸なので dryRun 必須、
204
212
  // backend で audit emit + UPDATE 順序 + idempotency carry (= R35 narrative)。
205
213
  purge_expired_plaintext: ["olderThanDays", "dryRun", "approvalId"],
@@ -377,7 +385,8 @@ export const tools = [
377
385
  type: "string",
378
386
  description: "監視する指標。 cost_threshold=単発コスト閾値 (USD) / monthly_budget=月次予算 (USD) / " +
379
387
  "error_rate=エラー率(%) / latency_degradation=レイテンシ劣化 (ms) / " +
380
- "anomaly_cost / anomaly_latency / anomaly_error_rate=異常検知 (= windowMinutes は 60 固定)",
388
+ "anomaly_cost / anomaly_latency / anomaly_error_rate=異常検知 (= windowMinutes は 60 固定) / " +
389
+ "eval_score=eval スコア低下 (= evalCriterionId 必須、 直近 window の平均 score が thresholdValue 未満で発火)",
381
390
  enum: [
382
391
  "cost_threshold",
383
392
  "error_rate",
@@ -386,6 +395,7 @@ export const tools = [
386
395
  "anomaly_cost",
387
396
  "anomaly_latency",
388
397
  "anomaly_error_rate",
398
+ "eval_score",
389
399
  ],
390
400
  },
391
401
  thresholdValue: {
@@ -456,6 +466,11 @@ export const tools = [
456
466
  description: "作成直後に有効化するか。 デフォルト true。",
457
467
  default: true,
458
468
  },
469
+ evalCriterionId: {
470
+ type: "integer",
471
+ description: "alertType=eval_score のとき必須。 監視する eval criterion の id (= list_eval_criteria.criteria[].id)。 直近 window の平均 score が thresholdValue 未満で発火する。",
472
+ minimum: 1,
473
+ },
459
474
  conditions: {
460
475
  type: "object",
461
476
  description: "v1.5 multi-condition alert (= 複合条件)。 指定すると alertType + thresholdValue + " +
@@ -2018,8 +2033,8 @@ export const tools = [
2018
2033
  },
2019
2034
  {
2020
2035
  name: "aggregate_calls",
2021
- description: "calls の 集計 cube を 取得 (= POST /v1/query/aggregate)。 groupBy (= provider / model / day / hour / minute / tag) × metric (= cost / latency / tokens / count / error_rate) で 1 call で AI agent が 「今月の cost を model 別 に集計」 narrative carry。 " +
2022
- "tag mode は tagKey 必須 (= alphanumeric + _ - のみ、 例: 'env' / 'feature')。 hour mode は 168h / minute mode は 60min まで (= 超過 400)。 cost = SUM(cost_usd) / latency = AVG(latency_ms) / tokens = SUM(total_tokens) / count = COUNT(*) / error_rate = error ÷ total。 " +
2036
+ description: "calls の 集計 cube を 取得 (= POST /v1/query/aggregate)。 groupBy (= provider / model / day / hour / minute / tag / error) × metric (= cost / latency / tokens / input_tokens / output_tokens / count / error_rate) で 1 call で AI agent が 「今月の cost を model 別 に集計」 narrative carry。 " +
2037
+ "tag mode は tagKey 必須 (= alphanumeric + _ - のみ、 例: 'env' / 'feature')。 error mode は エラー行のみを error 文字列で種類別集計 (= どのエラーが何件か。 metric=count 推奨)。 hour mode は 168h / minute mode は 60min まで (= 超過 400)。 cost = SUM(cost_usd) / latency = AVG(latency_ms) / tokens = SUM(total_tokens) / input_tokens = SUM(prompt_tokens) / output_tokens = SUM(completion_tokens) / count = COUNT(*) / error_rate = error ÷ total。 " +
2023
2038
  "返却 = { groups: [{key, value, count}], total: {value, count} } 形式。 軸 1 操作系 + 自律 AI ops の 分析 narrative の coverage 拡張。",
2024
2039
  inputSchema: {
2025
2040
  type: "object",
@@ -2035,14 +2050,14 @@ export const tools = [
2035
2050
  },
2036
2051
  groupBy: {
2037
2052
  type: "string",
2038
- description: "集約軸 (= 'provider' / 'model' / 'day' / 'hour' / 'minute' / 'tag')、 default = 'provider'。 hour は 168h / minute は 60min まで",
2039
- enum: ["provider", "model", "day", "hour", "minute", "tag"],
2053
+ description: "集約軸 (= 'provider' / 'model' / 'day' / 'hour' / 'minute' / 'tag' / 'error')、 default = 'provider'。 hour は 168h / minute は 60min まで。 error はエラー行のみを種類別に集計",
2054
+ enum: ["provider", "model", "day", "hour", "minute", "tag", "error"],
2040
2055
  default: "provider",
2041
2056
  },
2042
2057
  metric: {
2043
2058
  type: "string",
2044
- description: "metric 種別 (= 'cost' / 'latency' / 'tokens' / 'count' / 'error_rate')、 default = 'cost'",
2045
- enum: ["cost", "latency", "tokens", "count", "error_rate"],
2059
+ description: "metric 種別 (= 'cost' / 'latency' / 'tokens' / 'input_tokens' / 'output_tokens' / 'count' / 'error_rate')、 default = 'cost'",
2060
+ enum: ["cost", "latency", "tokens", "input_tokens", "output_tokens", "count", "error_rate"],
2046
2061
  default: "cost",
2047
2062
  },
2048
2063
  provider: {
@@ -2307,6 +2322,129 @@ export const tools = [
2307
2322
  },
2308
2323
  },
2309
2324
  },
2325
+ {
2326
+ name: "list_eval_datasets",
2327
+ description: "自 account の golden dataset 一覧 (= GET /v1/eval-datasets)。 各 dataset は name / 説明 / item 件数 / frozen 状態を持つ。 golden dataset = 期待出力つきの固定テストセットで、 run_eval_dataset で対象モデルに通して回帰 A/B を測る母集団。",
2328
+ inputSchema: {
2329
+ type: "object",
2330
+ additionalProperties: false,
2331
+ properties: {},
2332
+ },
2333
+ },
2334
+ {
2335
+ name: "get_eval_dataset",
2336
+ description: "指定 dataset の detail + items 全件を取得 (= GET /v1/eval-datasets/:id)。 datasetId は list_eval_datasets.datasets[].id。",
2337
+ inputSchema: {
2338
+ type: "object",
2339
+ additionalProperties: false,
2340
+ required: ["datasetId"],
2341
+ properties: {
2342
+ datasetId: {
2343
+ type: "integer",
2344
+ description: "対象 dataset の id (= list_eval_datasets.datasets[].id)",
2345
+ minimum: 1,
2346
+ },
2347
+ },
2348
+ },
2349
+ },
2350
+ {
2351
+ name: "create_eval_dataset",
2352
+ description: "golden dataset を新規作成 (= POST /v1/eval-datasets、 Pro+ 限定)。 items に期待出力つきテストケースを最大 20 件渡せる。 dataset は account あたり最大 50 件。 frozen=true で母集団を凍結 (= 以後 item 改変・解凍不可、 回帰判定の比較可能性を固定)。",
2353
+ inputSchema: {
2354
+ type: "object",
2355
+ additionalProperties: false,
2356
+ required: ["name"],
2357
+ properties: {
2358
+ name: {
2359
+ type: "string",
2360
+ description: "dataset 名 (1-100 文字、 account 内で一意)",
2361
+ minLength: 1,
2362
+ maxLength: 100,
2363
+ },
2364
+ description: {
2365
+ type: "string",
2366
+ description: "任意の説明 (<= 500 文字)",
2367
+ maxLength: 500,
2368
+ },
2369
+ items: {
2370
+ type: "array",
2371
+ description: "テストケース (最大 20 件)。 各 inputText を対象モデルに入力し、 expectedOutput を judge の [REFERENCE ANSWER] として採点に使う。",
2372
+ maxItems: 20,
2373
+ items: {
2374
+ type: "object",
2375
+ additionalProperties: false,
2376
+ required: ["inputText"],
2377
+ properties: {
2378
+ inputText: {
2379
+ type: "string",
2380
+ description: "モデルへの入力 (1-4000 文字)",
2381
+ minLength: 1,
2382
+ maxLength: 4000,
2383
+ },
2384
+ expectedOutput: {
2385
+ type: "string",
2386
+ description: "期待する出力 (任意、 <= 4000 文字)。 judge に参照解として渡す。",
2387
+ maxLength: 4000,
2388
+ },
2389
+ },
2390
+ },
2391
+ },
2392
+ frozen: {
2393
+ type: "boolean",
2394
+ description: "true = 母集団凍結 (= 以後 item 改変・解凍不可)。 省略 = false。",
2395
+ },
2396
+ },
2397
+ },
2398
+ },
2399
+ {
2400
+ name: "run_eval_dataset",
2401
+ description: "golden dataset を対象モデルで実行して回帰判定する (= POST /v1/eval-datasets/:id/run、 Pro+ 限定)。 各 item の inputText を targetModel に通し、 出力を既定 criteria + expectedOutput で gpt-4o-mini に採点させて eval_scores に記録する。 結果は compare_eval_runs で run 間比較できる。 実行記録は本番 cost/分析/アラート集計からは除外される。 cost: item 数 × criteria 数の LLM call。 OPENAI_API_KEY 未 provision 環境では 503。",
2402
+ inputSchema: {
2403
+ type: "object",
2404
+ additionalProperties: false,
2405
+ required: ["datasetId", "targetModel"],
2406
+ properties: {
2407
+ datasetId: {
2408
+ type: "integer",
2409
+ description: "実行する dataset の id (= list_eval_datasets.datasets[].id)",
2410
+ minimum: 1,
2411
+ },
2412
+ targetModel: {
2413
+ type: "string",
2414
+ description: "回帰を測りたい対象モデル (= 価格表に載っている OpenAI モデルのみ、 例 'gpt-4o-mini')。 未知モデルは 400。",
2415
+ minLength: 1,
2416
+ maxLength: 128,
2417
+ },
2418
+ judgeModel: {
2419
+ type: "string",
2420
+ description: "採点モデル (省略 = gpt-4o-mini)。 価格表に載っている OpenAI モデルのみ。",
2421
+ maxLength: 128,
2422
+ },
2423
+ idempotencyKey: {
2424
+ type: "string",
2425
+ description: "retry dedup 用の opaque key (= UUID 推奨、 200 char cap)。 同 key の再 POST は既存 run を返す (= 二重課金防止)。",
2426
+ minLength: 1,
2427
+ maxLength: 200,
2428
+ },
2429
+ },
2430
+ },
2431
+ },
2432
+ {
2433
+ name: "delete_eval_dataset",
2434
+ description: "golden dataset を削除 (= DELETE /v1/eval-datasets/:id、 Pro+ 限定)。 items は連鎖削除される。 過去の eval run / score は残る。",
2435
+ inputSchema: {
2436
+ type: "object",
2437
+ additionalProperties: false,
2438
+ required: ["datasetId"],
2439
+ properties: {
2440
+ datasetId: {
2441
+ type: "integer",
2442
+ description: "削除する dataset の id",
2443
+ minimum: 1,
2444
+ },
2445
+ },
2446
+ },
2447
+ },
2310
2448
  ];
2311
2449
  export async function dispatchTool(input) {
2312
2450
  const { name, args, apiKey, apiBase } = input;
@@ -2588,6 +2726,43 @@ export async function dispatchTool(input) {
2588
2726
  }
2589
2727
  return await callApi(apiBase, `/v1/eval-criteria/${encodeURIComponent(criterionId)}`, {}, apiKey, { method: "DELETE" });
2590
2728
  }
2729
+ case "list_eval_datasets": {
2730
+ return await callApi(apiBase, "/v1/eval-datasets", {}, apiKey);
2731
+ }
2732
+ case "get_eval_dataset": {
2733
+ const datasetId = validateAnnotationId(safeArgs["datasetId"]);
2734
+ if (!datasetId) {
2735
+ return errorResponse("datasetId required (positive integer up to 10 digits)");
2736
+ }
2737
+ return await callApi(apiBase, `/v1/eval-datasets/${encodeURIComponent(datasetId)}`, {}, apiKey);
2738
+ }
2739
+ case "create_eval_dataset": {
2740
+ if (typeof safeArgs["name"] !== "string") {
2741
+ return errorResponse("name required (string)");
2742
+ }
2743
+ return await callApi(apiBase, "/v1/eval-datasets", {}, apiKey, {
2744
+ method: "POST",
2745
+ jsonBody: safeArgs,
2746
+ });
2747
+ }
2748
+ case "run_eval_dataset": {
2749
+ const datasetId = validateAnnotationId(safeArgs["datasetId"]);
2750
+ if (!datasetId) {
2751
+ return errorResponse("datasetId required (positive integer up to 10 digits)");
2752
+ }
2753
+ if (typeof safeArgs["targetModel"] !== "string") {
2754
+ return errorResponse("targetModel required (string)");
2755
+ }
2756
+ const { datasetId: _omitDsId, ...body } = safeArgs;
2757
+ return await callApi(apiBase, `/v1/eval-datasets/${encodeURIComponent(datasetId)}/run`, {}, apiKey, { method: "POST", jsonBody: body });
2758
+ }
2759
+ case "delete_eval_dataset": {
2760
+ const datasetId = validateAnnotationId(safeArgs["datasetId"]);
2761
+ if (!datasetId) {
2762
+ return errorResponse("datasetId required (positive integer up to 10 digits)");
2763
+ }
2764
+ return await callApi(apiBase, `/v1/eval-datasets/${encodeURIComponent(datasetId)}`, {}, apiKey, { method: "DELETE" });
2765
+ }
2591
2766
  case "test_webhook": {
2592
2767
  if (typeof safeArgs["url"] !== "string") {
2593
2768
  return errorResponse("url required (https://...)");