@argosvix/mcp-server 0.28.2-alpha.1 → 0.29.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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @argosvix/mcp-server
2
2
 
3
- **v0.28.2-alpha.1** — Argosvix MCP server lets AI agents (Claude Desktop, Cursor, Codex CLI, custom MCP clients) query, manage, and operate their LLM observability data directly from the conversation. Supports both **stdio** (subprocess) and **HTTP** (remote / self-host) transports.
3
+ **v0.28.3-alpha.1** — Argosvix MCP server lets AI agents (Claude Desktop, Cursor, Codex CLI, custom MCP clients) query, manage, and operate their LLM observability data directly from the conversation. Supports both **stdio** (subprocess) and **HTTP** (remote / self-host) transports.
4
4
 
5
5
  **Surface:** 71 tools (67 generally available + 4 founder-ops scoped) / 3 resources / 8 resource templates / 3 prompts. Autonomous-AI-ops endpoints (`get_account_health` / `detect_anomaly` / `propose_alert_rules` / `classify_calls_batch` / `propose_eval_criteria`) plus runtime control plane (budget gates / policy gates / human-approval gates) complete the "agent that can both observe AND act" narrative. See [CHANGELOG.md](./CHANGELOG.md) for release history.
6
6
 
@@ -1 +1 @@
1
- {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AA0M/D,eAAO,MAAM,KAAK,EAAE,IAAI,EA0nEvB,CAAC;AAEF,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAsB,YAAY,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC;IAChE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/C,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC,CAy5DD"}
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAmN/D,eAAO,MAAM,KAAK,EAAE,IAAI,EA+wEvB,CAAC;AAEF,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAsB,YAAY,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC;IAChE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/C,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC,CAo9DD"}
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
@@ -73,7 +74,8 @@ const TOOL_ARG_ALLOWLIST = {
73
74
  // Phase 3 read tools = alertId は path 直前置換 (= GET /v1/alerts/:id)。
74
75
  // list_alert_events は query param (limit / alertId) のみ allowlist。
75
76
  get_alert: ["alertId"],
76
- list_alert_events: ["limit", "alertId"],
77
+ // 2026-06-12 発火履歴深掘り = keyset cursor (beforeTriggeredAt + beforeId) パリティ。
78
+ list_alert_events: ["limit", "alertId", "beforeTriggeredAt", "beforeId"],
77
79
  // 2026-05-31 Phase 3 = acknowledge_alert tool。 eventId は path 直前置換、 body は空
78
80
  // (= source は MCP server 側で 強制的に "mcp" carry、 LLM から override させない)。
79
81
  acknowledge_alert: ["eventId"],
@@ -199,6 +201,13 @@ const TOOL_ARG_ALLOWLIST = {
199
201
  // 2026-06-02 Codex round 2 🔴 fix = idempotencyKey 必須 path (= AI agent が
200
202
  // retry した時に backend で dedup)、 client が opaque string 64 char で carry。
201
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"],
202
211
  // 2026-06-06 axis 4 Tier 2 = 自律 AI ops 第一弾。 mutation 軸なので dryRun 必須、
203
212
  // backend で audit emit + UPDATE 順序 + idempotency carry (= R35 narrative)。
204
213
  purge_expired_plaintext: ["olderThanDays", "dryRun", "approvalId"],
@@ -376,7 +385,8 @@ export const tools = [
376
385
  type: "string",
377
386
  description: "監視する指標。 cost_threshold=単発コスト閾値 (USD) / monthly_budget=月次予算 (USD) / " +
378
387
  "error_rate=エラー率(%) / latency_degradation=レイテンシ劣化 (ms) / " +
379
- "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 未満で発火)",
380
390
  enum: [
381
391
  "cost_threshold",
382
392
  "error_rate",
@@ -385,6 +395,7 @@ export const tools = [
385
395
  "anomaly_cost",
386
396
  "anomaly_latency",
387
397
  "anomaly_error_rate",
398
+ "eval_score",
388
399
  ],
389
400
  },
390
401
  thresholdValue: {
@@ -455,6 +466,11 @@ export const tools = [
455
466
  description: "作成直後に有効化するか。 デフォルト true。",
456
467
  default: true,
457
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
+ },
458
474
  conditions: {
459
475
  type: "object",
460
476
  description: "v1.5 multi-condition alert (= 複合条件)。 指定すると alertType + thresholdValue + " +
@@ -648,7 +664,10 @@ export const tools = [
648
664
  description: "alert の発火 (trigger) 履歴を新しい順で返す。 account 横断 (= 全 alert の最近の発火) が " +
649
665
  "デフォルト。 alertId を指定すると その alert のみに絞る。 「最近どの alert が何回発火したか」 " +
650
666
  "「コスト超過アラートはいつ鳴ったか」 等の確認に使う。 各 event の id は acknowledge_alert " +
651
- "tool に そのまま渡せる。 acknowledgedAt / acknowledgedBy は 未 ack なら null。",
667
+ "tool に そのまま渡せる。 acknowledgedAt / acknowledgedBy は 未 ack なら null。 " +
668
+ "各 event は発火時点の thresholdValue / windowMinutes / alertType snapshot を含む " +
669
+ "(= 後から rule を編集しても発火当時の条件が分かる)。 次ページは最終 event の " +
670
+ "triggeredAt + id を beforeTriggeredAt + beforeId に渡す (= keyset cursor)。",
652
671
  inputSchema: {
653
672
  type: "object",
654
673
  additionalProperties: false,
@@ -665,6 +684,16 @@ export const tools = [
665
684
  description: "特定 alert に絞る場合の ID。 省略で全 alert の発火履歴",
666
685
  pattern: "^[A-Za-z0-9_-]{1,64}$",
667
686
  },
687
+ beforeTriggeredAt: {
688
+ type: "string",
689
+ description: "ページング cursor (= 前ページ最終 event の triggeredAt)。 beforeId と必ず同時指定",
690
+ format: "date-time",
691
+ },
692
+ beforeId: {
693
+ type: "string",
694
+ description: "ページング cursor (= 前ページ最終 event の id)。 beforeTriggeredAt と必ず同時指定",
695
+ pattern: "^[A-Za-z0-9_-]{1,64}$",
696
+ },
668
697
  },
669
698
  },
670
699
  },
@@ -1727,7 +1756,7 @@ export const tools = [
1727
1756
  {
1728
1757
  name: "purge_expired_plaintext",
1729
1758
  description: "(axis 4 Tier 2 = 自律 AI ops 第一弾) 自 account の 平文 record のうち olderThanDays 経過したものを 一括 purge (= POST /v1/tier2/plaintext/purge-expired)。 利用規約 v2.1 narrative の 「90 日 まで 保管可能」 と整合 (= 自動 retention narrative)、 AI agent が 「30 日 経過の 平文 data を 自動 purge」 narrative で 1 prompt 完結。 " +
1730
- "dryRun=true (= safety default narrative) で count + sample 5 件の call_id を 返す、 dryRun=false で 実 UPDATE。 emit → UPDATE 順序 + deterministic idempotencyId (= sha1(endpoint+accountId+olderThanDays+cutoff_date)) で webhook retry 同等 narrative。 founder dogfood scope = account のみ purge、 「全 account purge pathv1.8 carry。 " +
1759
+ "dryRun=true (= safety default narrative) で count + sample 5 件の call_id を 返す、 dryRun=false で 実 UPDATE。 emit → UPDATE 順序 + deterministic idempotencyId (= sha1(endpoint+accountId+olderThanDays+cutoff_date)) で webhook retry 同等 narrative。 **Pro+ プラン限定 (= 2026-06-12 解放、 Free 403)。 purge (dryRun=false)approvalId 必須** = request_approval (action: 'purge_expired_plaintext') で人間承認を取ってから実行する (= 平文 NULL 化は不可逆のため)自 account のみ purge。 " +
1731
1760
  "返却 dryRun=true = { dryRun: true, targetCount, cutoffTimestamp, olderThanDays, sampleTargetCallIds }、 dryRun=false = { dryRun: false, purgedCount, cutoffTimestamp, olderThanDays, purgedAt }。 audit = tier2.purge_expired_plaintext を emit。",
1732
1761
  inputSchema: {
1733
1762
  type: "object",
@@ -1757,7 +1786,7 @@ export const tools = [
1757
1786
  name: "retry_failed_webhook",
1758
1787
  description: "(axis 4 Tier 2 = 自律 AI ops 第一弾) 失敗した Stripe webhook event (= billing_dead_letter テーブル) を 再処理 marker として audit log に carry (= POST /v1/tier2/webhook-events/retry)。 「先週 Stripe webhook が 一時失敗してた件を 全部 retry して」 narrative で 1 prompt 完結。 " +
1759
1788
  "eventIds (= 特定 event 単体、 最大 100 件) ま た は fromTimestamp/toTimestamp (= range、 7 日 cap) で 対象 select。 dryRun=true で list preview、 dryRun=false で 各 event を audit log に 「marked_for_manual_redispatch」 narrative で 残す (= founder が wrangler / Stripe dashboard 経由で 実 retry を carry する 軸、 完全 auto re-dispatch は v1.8 carry)。 " +
1760
- "emit は deterministic idempotencyId (= sha1(endpoint+accountId+eventId)) で carry、 同 args の 二重実行は silent skip。 founder dogfood scope = billing_dead_letter には account_id 列が 無いので dead-letter 走査、 v1.8 account_id scoping carry。 " +
1789
+ "emit は deterministic idempotencyId (= sha1(endpoint+accountId+eventId)) で carry、 同 args の 二重実行は silent skip。 **founder 運用限定 (= 内部の決済 webhook 復旧ツール、 一般 account 403)**。 billing_dead_letter account 横断の内部 table で、 re-dispatch も手動運用前提のため一般開放の予定はない。 " +
1761
1790
  "返却 dryRun=true = { dryRun: true, targetCount, events: [{eventId, eventType, reason, receivedAt}] }、 dryRun=false = { dryRun: false, targetCount, succeeded: string[], failed: [{eventId, reason}], skipped: string[], narrative, retriedAt }。 audit = tier2.retry_failed_webhook を 各 event 毎に emit。",
1762
1791
  inputSchema: {
1763
1792
  type: "object",
@@ -1848,7 +1877,7 @@ export const tools = [
1848
1877
  },
1849
1878
  {
1850
1879
  name: "extend_customer_trial",
1851
- description: "(axis 4 Tier 2 = 自律 AI ops 第三弾) 自 account の Stripe subscription trial 期間を 1-30 日 延長 (= POST /v1/tier2/trial/extend)。 founder dogfood scope = 当面 account のみ、 paid Pro+ user は 403。 累計 60 日 上限 (= 過去 30 日 audit 集計)、 status='trialing' でなければ 409。 " +
1880
+ description: "(axis 4 Tier 2 = 自律 AI ops 第三弾) 自 account の Stripe subscription trial 期間を 1-30 日 延長 (= POST /v1/tier2/trial/extend)。 **founder 運用限定 (= サポート用の内部ツール、 一般 account 403)**。 trial 延長は収益に直結するため一般開放の予定はない。 累計 60 日 上限 (= 過去 30 日 audit 集計)、 status='trialing' でなければ 409。 " +
1852
1881
  "R39 carry = dryRun は 必須明示 (= 暗黙 false で mutation する事故 防御)、 dryRun=false 時 は idempotencyKey も 必須 (16-128 alphanumeric+'_-')。 同 key 再呼び出しは tier2_idempotency table 経由で cached result 返却 (= retry double-extend を 構造防御)。 " +
1853
1882
  "dryRun=true で previousTrialEnd / newTrialEnd / 累計 narrative preview のみ (= Stripe call なし)。 dryRun=false で 実 Stripe mutation + accounts_subscription 同期 update。",
1854
1883
  inputSchema: {
@@ -1895,7 +1924,7 @@ export const tools = [
1895
1924
  },
1896
1925
  {
1897
1926
  name: "apply_promo_code_to_customer",
1898
- description: "(axis 4 Tier 2 = 自律 AI ops 第三弾) 自 account の Stripe subscription に user-facing promotion code (= 既 Stripe で 登録済の 「LAUNCH50」 等) を 適用 (= POST /v1/tier2/promo/apply)。 founder dogfood scope = 当面 account のみ、 paid Pro+ user は 403。 既 active discount があれば 409 (= 重ね掛け 構造防御)、 status が canceled / incomplete_expired は 409。 " +
1927
+ description: "(axis 4 Tier 2 = 自律 AI ops 第三弾) 自 account の Stripe subscription に user-facing promotion code (= 既 Stripe で 登録済の 「LAUNCH50」 等) を 適用 (= POST /v1/tier2/promo/apply)。 **founder 運用限定 (= サポート用の内部ツール、 一般 account 403)**。 経済影響のある操作の規約整備とセットでないと開放しない方針 (= 解放未定)。 既 active discount があれば 409 (= 重ね掛け 構造防御)、 status が canceled / incomplete_expired は 409。 " +
1899
1928
  "R39 carry = promotion_code 経由で Stripe redeem 判定を委ねる構造 (= coupon 直接適用は 制約 bypass で禁止)、 dryRun 必須明示 + dryRun=false 時 idempotencyKey 必須。 同 key 再呼び出しは tier2_idempotency table 経由で cached result 返却、 concurrent apply を 構造直列化。 " +
1900
1929
  "dryRun=true で resolve + 既 active 判定 + 推定 割引 narrative preview のみ (= Stripe mutation なし)。 dryRun=false で 実 promotion_code 適用。",
1901
1930
  inputSchema: {
@@ -2293,6 +2322,129 @@ export const tools = [
2293
2322
  },
2294
2323
  },
2295
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
+ },
2296
2448
  ];
2297
2449
  export async function dispatchTool(input) {
2298
2450
  const { name, args, apiKey, apiBase } = input;
@@ -2451,8 +2603,13 @@ export async function dispatchTool(input) {
2451
2603
  return await callApi(apiBase, `/v1/alerts/${encodeURIComponent(alertId)}`, {}, apiKey);
2452
2604
  }
2453
2605
  case "list_alert_events": {
2454
- // limit / alertId は query param で /v1/alerts/events へ。 alertId は backend
2455
- // 側でも [A-Za-z0-9_-]+ で再 validate されるが、 schema pattern で先弾き済。
2606
+ // limit / alertId / cursor は query param で /v1/alerts/events へ。 alertId は
2607
+ // backend 側でも [A-Za-z0-9_-]+ で再 validate されるが、 schema pattern で先弾き済。
2608
+ // cursor 2 つの同時指定契約は backend が 400 で enforce (= R77 と同型)。
2609
+ const beforeTs = safeArgs["beforeTriggeredAt"];
2610
+ if (beforeTs !== undefined && (typeof beforeTs !== "string" || Number.isNaN(Date.parse(beforeTs)))) {
2611
+ return errorResponse("beforeTriggeredAt must be ISO-8601 string");
2612
+ }
2456
2613
  return await callApi(apiBase, "/v1/alerts/events", safeArgs, apiKey);
2457
2614
  }
2458
2615
  case "acknowledge_alert": {
@@ -2569,6 +2726,43 @@ export async function dispatchTool(input) {
2569
2726
  }
2570
2727
  return await callApi(apiBase, `/v1/eval-criteria/${encodeURIComponent(criterionId)}`, {}, apiKey, { method: "DELETE" });
2571
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
+ }
2572
2766
  case "test_webhook": {
2573
2767
  if (typeof safeArgs["url"] !== "string") {
2574
2768
  return errorResponse("url required (https://...)");