vantage-peers-mcp 2.7.0 → 2.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/CHANGELOG.md CHANGED
@@ -1,5 +1,68 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.8.0] — 2026-06-14 — Day 101 CRUD baseline PR-A: search_memories_by_keyword + search_memories_by_semantic (mission k575kc1ryps0n8br95jw3q7d0x88m2v9, task k1735qk9kx6agjjyt3e38rdvvh88mk0p)
4
+
5
+ Mission `mcp-crud-baseline-standard` PR-A under T2 `[CRUD-T2] Implémentation gaps VP MCP`. First of 4 sub-PRs aligning the MCP surface with the Day 101 doctrine `j57dhrmkzjerjtssnr0z9ba57n88n7q7` ("5 ops per entity: get / list / search_by_keyword / search_by_semantic / create-or-upsert"). PR-A handles the convention drift on the `memories` entity — the only entity that already had both keyword + semantic search wired, but under non-canonical names.
6
+
7
+ ### Added (canonical names)
8
+
9
+ - **`search_memories_by_keyword`** — BM25 full-text search over memories, identical wire to `text_search`. Calls `search:textSearch` Convex action 1:1, same params (`query`, `namespace?`, `type?`, `limit?`, `fields?`), same `guardRead` namespace gate, same 20-item default limit + 200 cap, same `mcpConvexError` error surface (2.7.1 sweep). Annotations: `readOnlyHint=true`, `openWorldHint=false`, `destructiveHint=false`, title `"Search memories by keyword (BM25)"`.
10
+ - **`search_memories_by_semantic`** — semantic vector cosine search over memories, identical wire to `recall`. Calls `search:recall` Convex action 1:1, same params, same gate, same defaults. Annotations: `readOnlyHint=true`, `openWorldHint=false`, `destructiveHint=false`, title `"Search memories by semantic (vector cosine)"`.
11
+
12
+ ### Deprecated (alias-only, one minor window)
13
+
14
+ - **`text_search`** — alias of `search_memories_by_keyword`. Description now leads with `DEPRECATED ALIAS`, source comment marks it for removal in `2.9.0`. Wire unchanged — existing callers continue to work for one minor.
15
+ - **`recall`** — alias of `search_memories_by_semantic`. Description now leads with `DEPRECATED ALIAS`, source comment marks it for removal in `2.9.0`. Wire unchanged.
16
+
17
+ ### Why
18
+
19
+ Per mission `k575kc1r` brief + Pi arbitrage `jn77rpx2msfy2v174sdqyjzp6n88m9bw` Q4 (RENAME CLEAN, optional one-minor dual-emit buffer if Sigma judges useful): the legacy `text_search` / `recall` pair predates the Day 101 CRUD baseline naming convention. Other entities will gain `search_<entity>s_by_keyword` / `search_<entity>s_by_semantic` in PR-C (cluster of 13) and PR-D (vectorIndex add for briefing_notes + diary). Aligning the `memories` entity FIRST means PR-C/D ship into a fleet that already understands the new naming, and skill / plugin / docs propagation (T-SKILLS, T-PLUGIN, T-DOC) has a single canonical truth to follow.
20
+
21
+ `hybrid_search` is intentionally NOT renamed — it remains a cross-cutting RRF-fusion tool, not entity-scoped, per the audit `analysis/mcp-crud-baseline-vp-audit-2026-06-14.md` § 4.
22
+
23
+ ### Refs
24
+
25
+ - Mission `k575kc1ryps0n8br95jw3q7d0x88m2v9` (MCP CRUD Baseline Standard, pilot Sigma + agents Sigma + Eta).
26
+ - Task T2 `k1735qk9kx6agjjyt3e38rdvvh88mk0p`.
27
+ - Audit T1 deliverable: `analysis/mcp-crud-baseline-vp-audit-2026-06-14.md` (140 lines, 53 table rows).
28
+ - Doctrine memory: `j57dhrmkzjerjtssnr0z9ba57n88n7q7` (5 ops per entity).
29
+ - Pi Q4 arbitrage: msg `jn77rpx2msfy2v174sdqyjzp6n88m9bw`.
30
+
31
+ ## [2.7.1] — 2026-06-14 — Day 101 FIX-B mcpError() → mcpConvexError() sweep (task k1744wk2gfgqt2gdqh41d4r91h88n410)
32
+
33
+ Patch-level fix to make every tool wrapper surface structured ConvexError
34
+ diagnostics instead of opaque `"Server Error [Request ID: ...]"` strings.
35
+
36
+ **Problem (Day 101):** when a Convex mutation/query threw a `ConvexError`
37
+ (e.g. `TASK_START_BLOCKED`, `COMPLETION_NOTE_REQUIRED`) or an
38
+ `ArgumentValidationError`, the tool wrapper called
39
+ `mcpError(error.message ?? String(error))` which returned a plain
40
+ `Error: <message>` text payload. The MCP client (Claude Code) then often
41
+ re-displayed this as a generic `Server Error [Request ID:...]`, masking the
42
+ actual root cause and triggering misdiagnosis sprees (Pi msg
43
+ `jn7c5tfj0347vaenyqgrezehk188mr11` mistakenly attributed the symptoms to
44
+ a backend regression that did not exist — see Sigma report msg
45
+ `jn773p8qnfp6ycb1f7gajhs8vn88m11a`).
46
+
47
+ **Fix:** sweep all 99 occurrences of
48
+ `return mcpError(error.message ?? String(error))` →
49
+ `return mcpConvexError(error)`. The `mcpConvexError` helper (already
50
+ present at `src/tools.ts:535`, shipped 2.4.x) parses ConvexError messages
51
+ into a structured JSON `{ code, message, path, hint }` payload that
52
+ surfaces the actual error code (`ArgumentValidationError`,
53
+ `ConvexError`, `AuthorizationError`, `SchemaValidationError`, etc.)
54
+ along with a path and a concise hint for ID-table mismatches.
55
+
56
+ Total counts post-sweep: `grep mcpConvexError(` → 102 ; `grep
57
+ mcpError(error.message` → 0.
58
+
59
+ Type check: `npx tsc --noEmit` exits 0.
60
+
61
+ Mission/refs: `k575kc1ryps0n8br95jw3q7d0x88m2v9` MCP CRUD Baseline Standard,
62
+ task FIX-B `k1744wk2gfgqt2gdqh41d4r91h88n410`. Co-shipped with hook
63
+ `enforce-friction-field.py` v1.1.0 STDERR clarification (Day 101 task
64
+ FIX-A `k17ads7kh7qk7yxgfe0dh73ggx88ny9f`).
65
+
3
66
  ## [2.7.0] — 2026-06-13 — Day 100 get_by_id surface Phase 2b (task k172735brsw6bc3j2dkkkfxqrx88kkjq)
4
67
 
5
68
  Phase 2b wires 2 MCP wrappers calling the Phase 2a Convex queries deployed
package/README.md CHANGED
@@ -242,7 +242,7 @@ Example:
242
242
  ### Session (1)
243
243
  `set_summary`
244
244
 
245
- ## Compact payloads and status aliases (v2.3.0)
245
+ ## Compact payloads and status aliases (v2.8.0 — feature since v2.3.0)
246
246
 
247
247
  ### `fields=lite` — reduced token payloads
248
248
 
package/dist/server.js CHANGED
@@ -102,7 +102,7 @@ const convexUrl = loadConvexUrl();
102
102
  const convex = new ConvexHttpClient(convexUrl);
103
103
  const server = new McpServer({
104
104
  name: "vantage-peers",
105
- version: "2.5.0",
105
+ version: "2.8.0",
106
106
  });
107
107
  // ─────────────────────────────────────────────────────────────────────────────
108
108
  // Helper: structured error response for MCP tool handlers
package/dist/src/tools.js CHANGED
@@ -849,7 +849,7 @@ export function registerTools(server, convex, oauthCtx) {
849
849
  createdBy,
850
850
  errorMessage: error?.message ?? String(error),
851
851
  });
852
- return mcpError(error.message ?? String(error));
852
+ return mcpConvexError(error);
853
853
  }
854
854
  });
855
855
  // ── soft_delete_memory ──────────────────────────────────────────────────────
@@ -882,7 +882,7 @@ export function registerTools(server, convex, oauthCtx) {
882
882
  };
883
883
  }
884
884
  catch (error) {
885
- return mcpError(error.message ?? String(error));
885
+ return mcpConvexError(error);
886
886
  }
887
887
  });
888
888
  // ── get_memory ──────────────────────────────────────────────────────────────
@@ -912,12 +912,15 @@ export function registerTools(server, convex, oauthCtx) {
912
912
  };
913
913
  }
914
914
  catch (error) {
915
- return mcpError(error.message ?? String(error));
915
+ return mcpConvexError(error);
916
916
  }
917
917
  });
918
918
  // ── recall ──────────────────────────────────────────────────────────────────
919
- server.tool("recall", "Semantic vector search over VantagePeers memories, ranked by cosine similarity. " +
920
- "WHEN: use at session start or before decisions prefer over text_search for intent-based queries. " +
919
+ // DEPRECATED (Day 101 v2.8.0) alias of search_memories_by_semantic. Retained
920
+ // for one minor version as a back-compat shim. New callers should use
921
+ // `search_memories_by_semantic`. To be removed in 2.9.0.
922
+ server.tool("recall", "DEPRECATED ALIAS of search_memories_by_semantic — semantic vector search over VantagePeers memories, ranked by cosine similarity. " +
923
+ "WHEN: use at session start or before decisions — prefer over text_search for intent-based queries. New callers: use search_memories_by_semantic. " +
921
924
  "EXAMPLE: recall query='Pi feedback rules' namespace='global' type='feedback' limit=20.", {
922
925
  query: z
923
926
  .string()
@@ -967,12 +970,15 @@ export function registerTools(server, convex, oauthCtx) {
967
970
  };
968
971
  }
969
972
  catch (error) {
970
- return mcpError(error.message ?? String(error));
973
+ return mcpConvexError(error);
971
974
  }
972
975
  });
973
976
  // ── text_search ─────────────────────────────────────────────────────────────
974
- server.tool("text_search", "BM25 full-text keyword search over VantagePeers memories for exact term matching. " +
975
- "WHEN: use when recall returns too-broad results and you need a specific exact phrase or ID. " +
977
+ // DEPRECATED (Day 101 v2.8.0) alias of search_memories_by_keyword. Retained
978
+ // for one minor version as a back-compat shim. New callers should use
979
+ // `search_memories_by_keyword`. To be removed in 2.9.0.
980
+ server.tool("text_search", "DEPRECATED ALIAS of search_memories_by_keyword — BM25 full-text keyword search over VantagePeers memories for exact term matching. " +
981
+ "WHEN: use when search_memories_by_semantic returns too-broad results and you need a specific exact phrase or ID. New callers: use search_memories_by_keyword. " +
976
982
  "EXAMPLE: text_search query='Day 92 C3 descriptions' namespace='project/vantage-peers' limit=10.", {
977
983
  query: z.string().describe("Search query text"),
978
984
  namespace: z
@@ -1013,7 +1019,114 @@ export function registerTools(server, convex, oauthCtx) {
1013
1019
  };
1014
1020
  }
1015
1021
  catch (error) {
1016
- return mcpError(error.message ?? String(error));
1022
+ return mcpConvexError(error);
1023
+ }
1024
+ });
1025
+ // ── search_memories_by_keyword ─────────────────────────────────────────────
1026
+ // Day 101 v2.8.0 — canonical name under MCP CRUD baseline doctrine.
1027
+ // Mirrors text_search 1:1 (same Convex action `search:textSearch`).
1028
+ // text_search is retained as a deprecated alias until 2.9.0.
1029
+ server.tool("search_memories_by_keyword", "BM25 full-text keyword search over VantagePeers memories for exact term matching. " +
1030
+ "WHEN: use when search_memories_by_semantic returns too-broad results and you need a specific exact phrase or ID. " +
1031
+ "EXAMPLE: search_memories_by_keyword query='Day 92 C3 descriptions' namespace='project/vantage-peers' limit=10.", {
1032
+ query: z.string().describe("Search query text"),
1033
+ namespace: z
1034
+ .string()
1035
+ .optional()
1036
+ .describe("Namespace filter (e.g. 'global', 'project/my-project')"),
1037
+ type: memoryTypeSchema.optional().describe("Filter by memory type"),
1038
+ limit: z
1039
+ .number()
1040
+ .int()
1041
+ .min(1)
1042
+ .max(200)
1043
+ .optional()
1044
+ .describe("Max items to return. Default 20 (envelope-safe). Cap 200."),
1045
+ fields: z
1046
+ .enum(["lite", "full"])
1047
+ .optional()
1048
+ .describe("'lite' returns compact payload (less tokens), 'full' is default. v2.4.9+."),
1049
+ }, {
1050
+ readOnlyHint: true,
1051
+ openWorldHint: false,
1052
+ destructiveHint: false,
1053
+ title: "Search memories by keyword (BM25)",
1054
+ }, async ({ query, namespace, type, limit, fields }) => {
1055
+ try {
1056
+ const nsDenied = guardRead(namespace);
1057
+ if (nsDenied)
1058
+ return nsDenied;
1059
+ const results = await convex.action("search:textSearch", {
1060
+ query,
1061
+ namespace,
1062
+ type,
1063
+ limit: limit ?? 20,
1064
+ fields: fields ?? "lite",
1065
+ });
1066
+ return {
1067
+ content: [{ type: "text", text: JSON.stringify(results, null, 2) }],
1068
+ };
1069
+ }
1070
+ catch (error) {
1071
+ return mcpConvexError(error);
1072
+ }
1073
+ });
1074
+ // ── search_memories_by_semantic ────────────────────────────────────────────
1075
+ // Day 101 v2.8.0 — canonical name under MCP CRUD baseline doctrine.
1076
+ // Mirrors recall 1:1 (same Convex action `search:recall`).
1077
+ // recall is retained as a deprecated alias until 2.9.0.
1078
+ server.tool("search_memories_by_semantic", "Semantic vector search over VantagePeers memories, ranked by cosine similarity. " +
1079
+ "WHEN: use at session start or before decisions — prefer over search_memories_by_keyword for intent-based queries. " +
1080
+ "EXAMPLE: search_memories_by_semantic query='Pi feedback rules' namespace='global' type='feedback' limit=20.", {
1081
+ query: z
1082
+ .string()
1083
+ .describe("Natural language query to search for relevant memories"),
1084
+ namespace: z
1085
+ .string()
1086
+ .optional()
1087
+ .describe("Filter to a specific namespace — omit to search all"),
1088
+ type: memoryTypeSchema
1089
+ .optional()
1090
+ .describe("Filter to a specific memory type — omit to search all"),
1091
+ limit: z
1092
+ .number()
1093
+ .int()
1094
+ .min(1)
1095
+ .max(200)
1096
+ .optional()
1097
+ .describe("Max items to return. Default 20 (envelope-safe). Cap 200."),
1098
+ fields: z
1099
+ .enum(["lite", "full"])
1100
+ .optional()
1101
+ .describe("'lite' returns compact payload (less tokens), 'full' is default. v2.4.9+."),
1102
+ }, {
1103
+ readOnlyHint: true,
1104
+ openWorldHint: false,
1105
+ destructiveHint: false,
1106
+ title: "Search memories by semantic (vector cosine)",
1107
+ }, async ({ query, namespace, type, limit, fields }) => {
1108
+ try {
1109
+ const nsDenied = guardRead(namespace);
1110
+ if (nsDenied)
1111
+ return nsDenied;
1112
+ const results = await convex.action("search:recall", {
1113
+ query,
1114
+ namespace,
1115
+ type,
1116
+ limit: limit ?? 20,
1117
+ fields: fields ?? "lite",
1118
+ });
1119
+ return {
1120
+ content: [
1121
+ {
1122
+ type: "text",
1123
+ text: JSON.stringify(results, null, 2),
1124
+ },
1125
+ ],
1126
+ };
1127
+ }
1128
+ catch (error) {
1129
+ return mcpConvexError(error);
1017
1130
  }
1018
1131
  });
1019
1132
  // ── hybrid_search ───────────────────────────────────────────────────────────
@@ -1070,7 +1183,7 @@ export function registerTools(server, convex, oauthCtx) {
1070
1183
  };
1071
1184
  }
1072
1185
  catch (error) {
1073
- return mcpError(error.message ?? String(error));
1186
+ return mcpConvexError(error);
1074
1187
  }
1075
1188
  });
1076
1189
  // ── store_episode ───────────────────────────────────────────────────────────
@@ -1124,7 +1237,7 @@ export function registerTools(server, convex, oauthCtx) {
1124
1237
  };
1125
1238
  }
1126
1239
  catch (error) {
1127
- return mcpError(error.message ?? String(error));
1240
+ return mcpConvexError(error);
1128
1241
  }
1129
1242
  });
1130
1243
  // ── get_profile ─────────────────────────────────────────────────────────────
@@ -1157,7 +1270,7 @@ export function registerTools(server, convex, oauthCtx) {
1157
1270
  };
1158
1271
  }
1159
1272
  catch (error) {
1160
- return mcpError(error.message ?? String(error));
1273
+ return mcpConvexError(error);
1161
1274
  }
1162
1275
  });
1163
1276
  // ── update_profile ──────────────────────────────────────────────────────────
@@ -1215,7 +1328,7 @@ export function registerTools(server, convex, oauthCtx) {
1215
1328
  };
1216
1329
  }
1217
1330
  catch (error) {
1218
- return mcpError(error.message ?? String(error));
1331
+ return mcpConvexError(error);
1219
1332
  }
1220
1333
  });
1221
1334
  // ── list_memories ───────────────────────────────────────────────────────────
@@ -1316,7 +1429,7 @@ export function registerTools(server, convex, oauthCtx) {
1316
1429
  };
1317
1430
  }
1318
1431
  catch (error) {
1319
- return mcpError(error.message ?? String(error));
1432
+ return mcpConvexError(error);
1320
1433
  }
1321
1434
  });
1322
1435
  // ── send_message ────────────────────────────────────────────────────────────
@@ -1394,7 +1507,7 @@ export function registerTools(server, convex, oauthCtx) {
1394
1507
  channel,
1395
1508
  errorMessage: error?.message ?? String(error),
1396
1509
  });
1397
- return mcpError(error.message ?? String(error));
1510
+ return mcpConvexError(error);
1398
1511
  }
1399
1512
  });
1400
1513
  // ── check_messages ──────────────────────────────────────────────────────────
@@ -1473,7 +1586,7 @@ export function registerTools(server, convex, oauthCtx) {
1473
1586
  };
1474
1587
  }
1475
1588
  catch (error) {
1476
- return mcpError(error.message ?? String(error));
1589
+ return mcpConvexError(error);
1477
1590
  }
1478
1591
  });
1479
1592
  // ── mark_as_read ────────────────────────────────────────────────────────────
@@ -1519,7 +1632,7 @@ export function registerTools(server, convex, oauthCtx) {
1519
1632
  };
1520
1633
  }
1521
1634
  catch (error) {
1522
- return mcpError(error.message ?? String(error));
1635
+ return mcpConvexError(error);
1523
1636
  }
1524
1637
  });
1525
1638
  // ── delete_message ──────────────────────────────────────────────────────────
@@ -1558,7 +1671,7 @@ export function registerTools(server, convex, oauthCtx) {
1558
1671
  };
1559
1672
  }
1560
1673
  catch (error) {
1561
- return mcpError(error.message ?? String(error));
1674
+ return mcpConvexError(error);
1562
1675
  }
1563
1676
  });
1564
1677
  // ── set_summary ─────────────────────────────────────────────────────────────
@@ -1597,7 +1710,7 @@ export function registerTools(server, convex, oauthCtx) {
1597
1710
  };
1598
1711
  }
1599
1712
  catch (error) {
1600
- return mcpError(error.message ?? String(error));
1713
+ return mcpConvexError(error);
1601
1714
  }
1602
1715
  });
1603
1716
  // ── list_peers ──────────────────────────────────────────────────────────────
@@ -1683,7 +1796,7 @@ export function registerTools(server, convex, oauthCtx) {
1683
1796
  };
1684
1797
  }
1685
1798
  catch (error) {
1686
- return mcpError(error.message ?? String(error));
1799
+ return mcpConvexError(error);
1687
1800
  }
1688
1801
  });
1689
1802
  // ── list_messages ───────────────────────────────────────────────────────────
@@ -1774,7 +1887,7 @@ export function registerTools(server, convex, oauthCtx) {
1774
1887
  };
1775
1888
  }
1776
1889
  catch (error) {
1777
- return mcpError(error.message ?? String(error));
1890
+ return mcpConvexError(error);
1778
1891
  }
1779
1892
  });
1780
1893
  // ── list_broadcast_status ───────────────────────────────────────────────────
@@ -1826,7 +1939,7 @@ export function registerTools(server, convex, oauthCtx) {
1826
1939
  };
1827
1940
  }
1828
1941
  catch (error) {
1829
- return mcpError(error.message ?? String(error));
1942
+ return mcpConvexError(error);
1830
1943
  }
1831
1944
  });
1832
1945
  // ── create_task ─────────────────────────────────────────────────────────────
@@ -1903,7 +2016,7 @@ export function registerTools(server, convex, oauthCtx) {
1903
2016
  };
1904
2017
  }
1905
2018
  catch (error) {
1906
- return mcpError(error.message ?? String(error));
2019
+ return mcpConvexError(error);
1907
2020
  }
1908
2021
  });
1909
2022
  // ── list_tasks ──────────────────────────────────────────────────────────────
@@ -2014,7 +2127,7 @@ export function registerTools(server, convex, oauthCtx) {
2014
2127
  };
2015
2128
  }
2016
2129
  catch (error) {
2017
- return mcpError(error.message ?? String(error));
2130
+ return mcpConvexError(error);
2018
2131
  }
2019
2132
  });
2020
2133
  // ── update_task ─────────────────────────────────────────────────────────────
@@ -2099,7 +2212,7 @@ export function registerTools(server, convex, oauthCtx) {
2099
2212
  };
2100
2213
  }
2101
2214
  catch (error) {
2102
- return mcpError(error.message ?? String(error));
2215
+ return mcpConvexError(error);
2103
2216
  }
2104
2217
  });
2105
2218
  // ── complete_task ───────────────────────────────────────────────────────────
@@ -2140,7 +2253,7 @@ export function registerTools(server, convex, oauthCtx) {
2140
2253
  };
2141
2254
  }
2142
2255
  catch (error) {
2143
- return mcpError(error.message ?? String(error));
2256
+ return mcpConvexError(error);
2144
2257
  }
2145
2258
  });
2146
2259
  // ── start_task ──────────────────────────────────────────────────────────────
@@ -2177,7 +2290,7 @@ export function registerTools(server, convex, oauthCtx) {
2177
2290
  };
2178
2291
  }
2179
2292
  catch (error) {
2180
- return mcpError(error.message ?? String(error));
2293
+ return mcpConvexError(error);
2181
2294
  }
2182
2295
  });
2183
2296
  // ── checkout_task ───────────────────────────────────────────────────────────
@@ -2215,7 +2328,7 @@ export function registerTools(server, convex, oauthCtx) {
2215
2328
  };
2216
2329
  }
2217
2330
  catch (error) {
2218
- return mcpError(error.message ?? String(error));
2331
+ return mcpConvexError(error);
2219
2332
  }
2220
2333
  });
2221
2334
  // ── delete_task ─────────────────────────────────────────────────────────────
@@ -2252,7 +2365,7 @@ export function registerTools(server, convex, oauthCtx) {
2252
2365
  };
2253
2366
  }
2254
2367
  catch (error) {
2255
- return mcpError(error.message ?? String(error));
2368
+ return mcpConvexError(error);
2256
2369
  }
2257
2370
  });
2258
2371
  // ── block_task ──────────────────────────────────────────────────────────────
@@ -2301,7 +2414,7 @@ export function registerTools(server, convex, oauthCtx) {
2301
2414
  };
2302
2415
  }
2303
2416
  catch (error) {
2304
- return mcpError(error.message ?? String(error));
2417
+ return mcpConvexError(error);
2305
2418
  }
2306
2419
  });
2307
2420
  // ── add_task_dependency ─────────────────────────────────────────────────────
@@ -2346,7 +2459,7 @@ export function registerTools(server, convex, oauthCtx) {
2346
2459
  };
2347
2460
  }
2348
2461
  catch (error) {
2349
- return mcpError(error.message ?? String(error));
2462
+ return mcpConvexError(error);
2350
2463
  }
2351
2464
  });
2352
2465
  // ── list_tasks_by_mission ───────────────────────────────────────────────────
@@ -2429,7 +2542,7 @@ export function registerTools(server, convex, oauthCtx) {
2429
2542
  };
2430
2543
  }
2431
2544
  catch (error) {
2432
- return mcpError(error.message ?? String(error));
2545
+ return mcpConvexError(error);
2433
2546
  }
2434
2547
  });
2435
2548
  // ── create_mission ──────────────────────────────────────────────────────────
@@ -2490,7 +2603,7 @@ export function registerTools(server, convex, oauthCtx) {
2490
2603
  };
2491
2604
  }
2492
2605
  catch (error) {
2493
- return mcpError(error.message ?? String(error));
2606
+ return mcpConvexError(error);
2494
2607
  }
2495
2608
  });
2496
2609
  // ── list_missions ───────────────────────────────────────────────────────────
@@ -2588,7 +2701,7 @@ export function registerTools(server, convex, oauthCtx) {
2588
2701
  };
2589
2702
  }
2590
2703
  catch (error) {
2591
- return mcpError(error.message ?? String(error));
2704
+ return mcpConvexError(error);
2592
2705
  }
2593
2706
  });
2594
2707
  // ── get_mission ─────────────────────────────────────────────────────────────
@@ -2618,7 +2731,7 @@ export function registerTools(server, convex, oauthCtx) {
2618
2731
  };
2619
2732
  }
2620
2733
  catch (error) {
2621
- return mcpError(error.message ?? String(error));
2734
+ return mcpConvexError(error);
2622
2735
  }
2623
2736
  });
2624
2737
  // ── update_mission ──────────────────────────────────────────────────────────
@@ -2675,7 +2788,7 @@ export function registerTools(server, convex, oauthCtx) {
2675
2788
  };
2676
2789
  }
2677
2790
  catch (error) {
2678
- return mcpError(error.message ?? String(error));
2791
+ return mcpConvexError(error);
2679
2792
  }
2680
2793
  });
2681
2794
  // ── update_mission_status ───────────────────────────────────────────────────
@@ -2710,7 +2823,7 @@ export function registerTools(server, convex, oauthCtx) {
2710
2823
  };
2711
2824
  }
2712
2825
  catch (error) {
2713
- return mcpError(error.message ?? String(error));
2826
+ return mcpConvexError(error);
2714
2827
  }
2715
2828
  });
2716
2829
  // ── write_diary ─────────────────────────────────────────────────────────────
@@ -2766,7 +2879,7 @@ export function registerTools(server, convex, oauthCtx) {
2766
2879
  orchestrator,
2767
2880
  errorMessage: error?.message ?? String(error),
2768
2881
  });
2769
- return mcpError(error.message ?? String(error));
2882
+ return mcpConvexError(error);
2770
2883
  }
2771
2884
  });
2772
2885
  // ── get_diary ───────────────────────────────────────────────────────────────
@@ -2809,7 +2922,7 @@ export function registerTools(server, convex, oauthCtx) {
2809
2922
  };
2810
2923
  }
2811
2924
  catch (error) {
2812
- return mcpError(error.message ?? String(error));
2925
+ return mcpConvexError(error);
2813
2926
  }
2814
2927
  });
2815
2928
  // ── list_diaries ────────────────────────────────────────────────────────────
@@ -2902,7 +3015,7 @@ export function registerTools(server, convex, oauthCtx) {
2902
3015
  };
2903
3016
  }
2904
3017
  catch (error) {
2905
- return mcpError(error.message ?? String(error));
3018
+ return mcpConvexError(error);
2906
3019
  }
2907
3020
  });
2908
3021
  // ── create_briefing_note ────────────────────────────────────────────────────
@@ -3041,7 +3154,7 @@ export function registerTools(server, convex, oauthCtx) {
3041
3154
  };
3042
3155
  }
3043
3156
  catch (error) {
3044
- return mcpError(error.message ?? String(error));
3157
+ return mcpConvexError(error);
3045
3158
  }
3046
3159
  });
3047
3160
  // ── list_briefing_notes ─────────────────────────────────────────────────────
@@ -3140,7 +3253,7 @@ export function registerTools(server, convex, oauthCtx) {
3140
3253
  };
3141
3254
  }
3142
3255
  catch (error) {
3143
- return mcpError(error.message ?? String(error));
3256
+ return mcpConvexError(error);
3144
3257
  }
3145
3258
  });
3146
3259
  // ── register_component ──────────────────────────────────────────────────────
@@ -3202,7 +3315,7 @@ export function registerTools(server, convex, oauthCtx) {
3202
3315
  createdBy,
3203
3316
  errorMessage: error?.message ?? String(error),
3204
3317
  });
3205
- return mcpError(error.message ?? String(error));
3318
+ return mcpConvexError(error);
3206
3319
  }
3207
3320
  });
3208
3321
  // ── list_components ─────────────────────────────────────────────────────────
@@ -3280,7 +3393,7 @@ export function registerTools(server, convex, oauthCtx) {
3280
3393
  };
3281
3394
  }
3282
3395
  catch (error) {
3283
- return mcpError(error.message ?? String(error));
3396
+ return mcpConvexError(error);
3284
3397
  }
3285
3398
  });
3286
3399
  // ── get_component ───────────────────────────────────────────────────────────
@@ -3312,7 +3425,7 @@ export function registerTools(server, convex, oauthCtx) {
3312
3425
  };
3313
3426
  }
3314
3427
  catch (error) {
3315
- return mcpError(error.message ?? String(error));
3428
+ return mcpConvexError(error);
3316
3429
  }
3317
3430
  });
3318
3431
  // ── update_component ────────────────────────────────────────────────────────
@@ -3361,7 +3474,7 @@ export function registerTools(server, convex, oauthCtx) {
3361
3474
  componentId,
3362
3475
  errorMessage: error?.message ?? String(error),
3363
3476
  });
3364
- return mcpError(error.message ?? String(error));
3477
+ return mcpConvexError(error);
3365
3478
  }
3366
3479
  });
3367
3480
  // ── delete_component ────────────────────────────────────────────────────────
@@ -3390,7 +3503,7 @@ export function registerTools(server, convex, oauthCtx) {
3390
3503
  };
3391
3504
  }
3392
3505
  catch (error) {
3393
- return mcpError(error.message ?? String(error));
3506
+ return mcpConvexError(error);
3394
3507
  }
3395
3508
  });
3396
3509
  // ── search_components ───────────────────────────────────────────────────────
@@ -3441,7 +3554,7 @@ export function registerTools(server, convex, oauthCtx) {
3441
3554
  };
3442
3555
  }
3443
3556
  catch (error) {
3444
- return mcpError(error.message ?? String(error));
3557
+ return mcpConvexError(error);
3445
3558
  }
3446
3559
  });
3447
3560
  // ── create_recurring_task ───────────────────────────────────────────────────
@@ -3500,7 +3613,7 @@ export function registerTools(server, convex, oauthCtx) {
3500
3613
  };
3501
3614
  }
3502
3615
  catch (error) {
3503
- return mcpError(error.message ?? String(error));
3616
+ return mcpConvexError(error);
3504
3617
  }
3505
3618
  });
3506
3619
  // ── list_recurring_tasks ────────────────────────────────────────────────────
@@ -3573,7 +3686,7 @@ export function registerTools(server, convex, oauthCtx) {
3573
3686
  };
3574
3687
  }
3575
3688
  catch (error) {
3576
- return mcpError(error.message ?? String(error));
3689
+ return mcpConvexError(error);
3577
3690
  }
3578
3691
  });
3579
3692
  // ── pause_recurring_task ────────────────────────────────────────────────────
@@ -3600,7 +3713,7 @@ export function registerTools(server, convex, oauthCtx) {
3600
3713
  };
3601
3714
  }
3602
3715
  catch (error) {
3603
- return mcpError(error.message ?? String(error));
3716
+ return mcpConvexError(error);
3604
3717
  }
3605
3718
  });
3606
3719
  // ── resume_recurring_task ───────────────────────────────────────────────────
@@ -3627,7 +3740,7 @@ export function registerTools(server, convex, oauthCtx) {
3627
3740
  };
3628
3741
  }
3629
3742
  catch (error) {
3630
- return mcpError(error.message ?? String(error));
3743
+ return mcpConvexError(error);
3631
3744
  }
3632
3745
  });
3633
3746
  // ── delete_recurring_task ───────────────────────────────────────────────────
@@ -3654,7 +3767,7 @@ export function registerTools(server, convex, oauthCtx) {
3654
3767
  };
3655
3768
  }
3656
3769
  catch (error) {
3657
- return mcpError(error.message ?? String(error));
3770
+ return mcpConvexError(error);
3658
3771
  }
3659
3772
  });
3660
3773
  // ── update_recurring_task ───────────────────────────────────────────────────
@@ -3700,7 +3813,7 @@ export function registerTools(server, convex, oauthCtx) {
3700
3813
  };
3701
3814
  }
3702
3815
  catch (error) {
3703
- return mcpError(error.message ?? String(error));
3816
+ return mcpConvexError(error);
3704
3817
  }
3705
3818
  });
3706
3819
  // ── create_mandate ──────────────────────────────────────────────────────────
@@ -3759,7 +3872,7 @@ export function registerTools(server, convex, oauthCtx) {
3759
3872
  };
3760
3873
  }
3761
3874
  catch (error) {
3762
- return mcpError(error.message ?? String(error));
3875
+ return mcpConvexError(error);
3763
3876
  }
3764
3877
  });
3765
3878
  // ── accept_mandate ──────────────────────────────────────────────────────────
@@ -3794,7 +3907,7 @@ export function registerTools(server, convex, oauthCtx) {
3794
3907
  };
3795
3908
  }
3796
3909
  catch (error) {
3797
- return mcpError(error.message ?? String(error));
3910
+ return mcpConvexError(error);
3798
3911
  }
3799
3912
  });
3800
3913
  // ── update_mandate ──────────────────────────────────────────────────────────
@@ -3838,7 +3951,7 @@ export function registerTools(server, convex, oauthCtx) {
3838
3951
  };
3839
3952
  }
3840
3953
  catch (error) {
3841
- return mcpError(error.message ?? String(error));
3954
+ return mcpConvexError(error);
3842
3955
  }
3843
3956
  });
3844
3957
  // ── settle_mandate ──────────────────────────────────────────────────────────
@@ -3875,7 +3988,7 @@ export function registerTools(server, convex, oauthCtx) {
3875
3988
  };
3876
3989
  }
3877
3990
  catch (error) {
3878
- return mcpError(error.message ?? String(error));
3991
+ return mcpConvexError(error);
3879
3992
  }
3880
3993
  });
3881
3994
  // ── validate_mandate_spending ───────────────────────────────────────────────
@@ -3902,7 +4015,7 @@ export function registerTools(server, convex, oauthCtx) {
3902
4015
  };
3903
4016
  }
3904
4017
  catch (error) {
3905
- return mcpError(error.message ?? String(error));
4018
+ return mcpConvexError(error);
3906
4019
  }
3907
4020
  });
3908
4021
  // ── list_mandates ───────────────────────────────────────────────────────────
@@ -3988,7 +4101,7 @@ export function registerTools(server, convex, oauthCtx) {
3988
4101
  };
3989
4102
  }
3990
4103
  catch (error) {
3991
- return mcpError(error.message ?? String(error));
4104
+ return mcpConvexError(error);
3992
4105
  }
3993
4106
  });
3994
4107
  // ── create_bu ───────────────────────────────────────────────────────────────
@@ -4058,7 +4171,7 @@ export function registerTools(server, convex, oauthCtx) {
4058
4171
  };
4059
4172
  }
4060
4173
  catch (error) {
4061
- return mcpError(error.message ?? String(error));
4174
+ return mcpConvexError(error);
4062
4175
  }
4063
4176
  });
4064
4177
  // ── update_bu ───────────────────────────────────────────────────────────────
@@ -4127,7 +4240,7 @@ export function registerTools(server, convex, oauthCtx) {
4127
4240
  };
4128
4241
  }
4129
4242
  catch (error) {
4130
- return mcpError(error.message ?? String(error));
4243
+ return mcpConvexError(error);
4131
4244
  }
4132
4245
  });
4133
4246
  // ── get_bu ──────────────────────────────────────────────────────────────────
@@ -4157,7 +4270,7 @@ export function registerTools(server, convex, oauthCtx) {
4157
4270
  };
4158
4271
  }
4159
4272
  catch (error) {
4160
- return mcpError(error.message ?? String(error));
4273
+ return mcpConvexError(error);
4161
4274
  }
4162
4275
  });
4163
4276
  // ── list_bus ────────────────────────────────────────────────────────────────
@@ -4237,7 +4350,7 @@ export function registerTools(server, convex, oauthCtx) {
4237
4350
  };
4238
4351
  }
4239
4352
  catch (error) {
4240
- return mcpError(error.message ?? String(error));
4353
+ return mcpConvexError(error);
4241
4354
  }
4242
4355
  });
4243
4356
  // ── delete_bu ───────────────────────────────────────────────────────────────
@@ -4271,7 +4384,7 @@ export function registerTools(server, convex, oauthCtx) {
4271
4384
  };
4272
4385
  }
4273
4386
  catch (error) {
4274
- return mcpError(error.message ?? String(error));
4387
+ return mcpConvexError(error);
4275
4388
  }
4276
4389
  });
4277
4390
  // ── add_repo_mapping ────────────────────────────────────────────────────────
@@ -4319,7 +4432,7 @@ export function registerTools(server, convex, oauthCtx) {
4319
4432
  };
4320
4433
  }
4321
4434
  catch (error) {
4322
- return mcpError(error.message ?? String(error));
4435
+ return mcpConvexError(error);
4323
4436
  }
4324
4437
  });
4325
4438
  // ── list_repo_mappings ──────────────────────────────────────────────────────
@@ -4393,7 +4506,7 @@ export function registerTools(server, convex, oauthCtx) {
4393
4506
  };
4394
4507
  }
4395
4508
  catch (error) {
4396
- return mcpError(error.message ?? String(error));
4509
+ return mcpConvexError(error);
4397
4510
  }
4398
4511
  });
4399
4512
  // ── remove_repo_mapping ─────────────────────────────────────────────────────
@@ -4427,7 +4540,7 @@ export function registerTools(server, convex, oauthCtx) {
4427
4540
  };
4428
4541
  }
4429
4542
  catch (error) {
4430
- return mcpError(error.message ?? String(error));
4543
+ return mcpConvexError(error);
4431
4544
  }
4432
4545
  });
4433
4546
  // ── list_issues ─────────────────────────────────────────────────────────────
@@ -4547,7 +4660,7 @@ export function registerTools(server, convex, oauthCtx) {
4547
4660
  };
4548
4661
  }
4549
4662
  catch (error) {
4550
- return mcpError(error.message ?? String(error));
4663
+ return mcpConvexError(error);
4551
4664
  }
4552
4665
  });
4553
4666
  // ── get_issue ───────────────────────────────────────────────────────────────
@@ -4581,7 +4694,7 @@ export function registerTools(server, convex, oauthCtx) {
4581
4694
  };
4582
4695
  }
4583
4696
  catch (error) {
4584
- return mcpError(error.message ?? String(error));
4697
+ return mcpConvexError(error);
4585
4698
  }
4586
4699
  });
4587
4700
  // ── update_issue_status ─────────────────────────────────────────────────────
@@ -4621,7 +4734,7 @@ export function registerTools(server, convex, oauthCtx) {
4621
4734
  };
4622
4735
  }
4623
4736
  catch (error) {
4624
- return mcpError(error.message ?? String(error));
4737
+ return mcpConvexError(error);
4625
4738
  }
4626
4739
  });
4627
4740
  // ── link_commit_to_issue ────────────────────────────────────────────────────
@@ -4659,7 +4772,7 @@ export function registerTools(server, convex, oauthCtx) {
4659
4772
  };
4660
4773
  }
4661
4774
  catch (error) {
4662
- return mcpError(error.message ?? String(error));
4775
+ return mcpConvexError(error);
4663
4776
  }
4664
4777
  });
4665
4778
  // ── verify_issue ────────────────────────────────────────────────────────────
@@ -4695,7 +4808,7 @@ export function registerTools(server, convex, oauthCtx) {
4695
4808
  };
4696
4809
  }
4697
4810
  catch (error) {
4698
- return mcpError(error.message ?? String(error));
4811
+ return mcpConvexError(error);
4699
4812
  }
4700
4813
  });
4701
4814
  // ── issue_stats ─────────────────────────────────────────────────────────────
@@ -4728,7 +4841,7 @@ export function registerTools(server, convex, oauthCtx) {
4728
4841
  };
4729
4842
  }
4730
4843
  catch (error) {
4731
- return mcpError(error.message ?? String(error));
4844
+ return mcpConvexError(error);
4732
4845
  }
4733
4846
  });
4734
4847
  // ── create_fix_pattern ──────────────────────────────────────────────────────
@@ -4786,7 +4899,7 @@ export function registerTools(server, convex, oauthCtx) {
4786
4899
  };
4787
4900
  }
4788
4901
  catch (error) {
4789
- return mcpError(error.message ?? String(error));
4902
+ return mcpConvexError(error);
4790
4903
  }
4791
4904
  });
4792
4905
  // ── add_fix_attempt ─────────────────────────────────────────────────────────
@@ -4827,7 +4940,7 @@ export function registerTools(server, convex, oauthCtx) {
4827
4940
  };
4828
4941
  }
4829
4942
  catch (error) {
4830
- return mcpError(error.message ?? String(error));
4943
+ return mcpConvexError(error);
4831
4944
  }
4832
4945
  });
4833
4946
  // ── validate_fix ────────────────────────────────────────────────────────────
@@ -4861,7 +4974,7 @@ export function registerTools(server, convex, oauthCtx) {
4861
4974
  };
4862
4975
  }
4863
4976
  catch (error) {
4864
- return mcpError(error.message ?? String(error));
4977
+ return mcpConvexError(error);
4865
4978
  }
4866
4979
  });
4867
4980
  // ── search_fix_patterns ─────────────────────────────────────────────────────
@@ -4912,7 +5025,7 @@ export function registerTools(server, convex, oauthCtx) {
4912
5025
  };
4913
5026
  }
4914
5027
  catch (error) {
4915
- return mcpError(error.message ?? String(error));
5028
+ return mcpConvexError(error);
4916
5029
  }
4917
5030
  });
4918
5031
  // ── list_fix_patterns ───────────────────────────────────────────────────────
@@ -5001,7 +5114,7 @@ export function registerTools(server, convex, oauthCtx) {
5001
5114
  };
5002
5115
  }
5003
5116
  catch (error) {
5004
- return mcpError(error.message ?? String(error));
5117
+ return mcpConvexError(error);
5005
5118
  }
5006
5119
  });
5007
5120
  // ── link_issue_to_pattern ───────────────────────────────────────────────────
@@ -5035,7 +5148,7 @@ export function registerTools(server, convex, oauthCtx) {
5035
5148
  };
5036
5149
  }
5037
5150
  catch (error) {
5038
- return mcpError(error.message ?? String(error));
5151
+ return mcpConvexError(error);
5039
5152
  }
5040
5153
  });
5041
5154
  // ── get_mission_template ────────────────────────────────────────────────────
@@ -5063,7 +5176,7 @@ export function registerTools(server, convex, oauthCtx) {
5063
5176
  };
5064
5177
  }
5065
5178
  catch (error) {
5066
- return mcpError(error.message ?? String(error));
5179
+ return mcpConvexError(error);
5067
5180
  }
5068
5181
  });
5069
5182
  // ── update_mission_template ─────────────────────────────────────────────────
@@ -5131,7 +5244,7 @@ export function registerTools(server, convex, oauthCtx) {
5131
5244
  };
5132
5245
  }
5133
5246
  catch (error) {
5134
- return mcpError(error.message ?? String(error));
5247
+ return mcpConvexError(error);
5135
5248
  }
5136
5249
  });
5137
5250
  // ── instantiate_template_into_mission ───────────────────────────────────────
@@ -5192,7 +5305,7 @@ export function registerTools(server, convex, oauthCtx) {
5192
5305
  };
5193
5306
  }
5194
5307
  catch (error) {
5195
- return mcpError(error.message ?? String(error));
5308
+ return mcpConvexError(error);
5196
5309
  }
5197
5310
  });
5198
5311
  // ── add_deployment ──────────────────────────────────────────────────────────
@@ -5242,7 +5355,7 @@ export function registerTools(server, convex, oauthCtx) {
5242
5355
  };
5243
5356
  }
5244
5357
  catch (error) {
5245
- return mcpError(error.message ?? String(error));
5358
+ return mcpConvexError(error);
5246
5359
  }
5247
5360
  });
5248
5361
  // ── remove_deployment ───────────────────────────────────────────────────────
@@ -5274,7 +5387,7 @@ export function registerTools(server, convex, oauthCtx) {
5274
5387
  };
5275
5388
  }
5276
5389
  catch (error) {
5277
- return mcpError(error.message ?? String(error));
5390
+ return mcpConvexError(error);
5278
5391
  }
5279
5392
  });
5280
5393
  // ── list_errors ─────────────────────────────────────────────────────────────
@@ -5353,7 +5466,7 @@ export function registerTools(server, convex, oauthCtx) {
5353
5466
  };
5354
5467
  }
5355
5468
  catch (error) {
5356
- return mcpError(error.message ?? String(error));
5469
+ return mcpConvexError(error);
5357
5470
  }
5358
5471
  });
5359
5472
  // ── get_error ───────────────────────────────────────────────────────────────
@@ -5383,7 +5496,7 @@ export function registerTools(server, convex, oauthCtx) {
5383
5496
  };
5384
5497
  }
5385
5498
  catch (error) {
5386
- return mcpError(error.message ?? String(error));
5499
+ return mcpConvexError(error);
5387
5500
  }
5388
5501
  });
5389
5502
  // ── whoami ──────────────────────────────────────────────────────────────────
@@ -5512,7 +5625,7 @@ export function registerTools(server, convex, oauthCtx) {
5512
5625
  repo: z.string(),
5513
5626
  orchestrator: z.string(),
5514
5627
  project: z.string().optional(),
5515
- }, async ({ repo, orchestrator, project }) => {
5628
+ }, { readOnlyHint: false, openWorldHint: false, destructiveHint: false, title: "Register repo mapping (alias)" }, async ({ repo, orchestrator, project }) => {
5516
5629
  const masterDenied = guardMasterOnly("register_repo_mapping");
5517
5630
  if (masterDenied)
5518
5631
  return masterDenied;
@@ -5525,7 +5638,7 @@ export function registerTools(server, convex, oauthCtx) {
5525
5638
  return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
5526
5639
  }
5527
5640
  catch (error) {
5528
- return mcpError(error.message ?? String(error));
5641
+ return mcpConvexError(error);
5529
5642
  }
5530
5643
  });
5531
5644
  // delete_repo_mapping → was remove_repo_mapping [ALIAS of remove_repo_mapping — C0.3 master-only]
@@ -5533,7 +5646,7 @@ export function registerTools(server, convex, oauthCtx) {
5533
5646
  "WHEN: use when a repo is archived or its events should no longer generate VP notifications. " +
5534
5647
  "EXAMPLE: delete_repo_mapping repo='vantageos-agency/vantage-peers'.", {
5535
5648
  repo: z.string(),
5536
- }, async ({ repo }) => {
5649
+ }, { readOnlyHint: false, openWorldHint: false, destructiveHint: true, title: "Delete repo mapping (alias)" }, async ({ repo }) => {
5537
5650
  const masterDenied = guardMasterOnly("delete_repo_mapping");
5538
5651
  if (masterDenied)
5539
5652
  return masterDenied;
@@ -5542,7 +5655,7 @@ export function registerTools(server, convex, oauthCtx) {
5542
5655
  return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
5543
5656
  }
5544
5657
  catch (error) {
5545
- return mcpError(error.message ?? String(error));
5658
+ return mcpConvexError(error);
5546
5659
  }
5547
5660
  });
5548
5661
  // register_deployment → was add_deployment [ALIAS of add_deployment — C0.1 master-only]
@@ -5554,7 +5667,7 @@ export function registerTools(server, convex, oauthCtx) {
5554
5667
  deployKeyEnvVar: z.string(),
5555
5668
  githubRepo: z.string(),
5556
5669
  orchestrator: z.string(),
5557
- }, async ({ name, deploymentUrl, deployKeyEnvVar, githubRepo, orchestrator }) => {
5670
+ }, { readOnlyHint: false, openWorldHint: false, destructiveHint: false, title: "Register deployment (alias)" }, async ({ name, deploymentUrl, deployKeyEnvVar, githubRepo, orchestrator }) => {
5558
5671
  const masterDenied = guardMasterOnly("register_deployment");
5559
5672
  if (masterDenied)
5560
5673
  return masterDenied;
@@ -5569,7 +5682,7 @@ export function registerTools(server, convex, oauthCtx) {
5569
5682
  return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
5570
5683
  }
5571
5684
  catch (error) {
5572
- return mcpError(error.message ?? String(error));
5685
+ return mcpConvexError(error);
5573
5686
  }
5574
5687
  });
5575
5688
  // delete_deployment → was remove_deployment [ALIAS of remove_deployment — C0.1 master-only]
@@ -5577,7 +5690,7 @@ export function registerTools(server, convex, oauthCtx) {
5577
5690
  "WHEN: use when a deployment is retired or moved to a different monitoring config. " +
5578
5691
  "EXAMPLE: delete_deployment name='vantage-prod'.", {
5579
5692
  name: z.string(),
5580
- }, async ({ name }) => {
5693
+ }, { readOnlyHint: false, openWorldHint: false, destructiveHint: true, title: "Delete deployment (alias)" }, async ({ name }) => {
5581
5694
  const masterDenied = guardMasterOnly("delete_deployment");
5582
5695
  if (masterDenied)
5583
5696
  return masterDenied;
@@ -5586,7 +5699,7 @@ export function registerTools(server, convex, oauthCtx) {
5586
5699
  return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
5587
5700
  }
5588
5701
  catch (error) {
5589
- return mcpError(error.message ?? String(error));
5702
+ return mcpConvexError(error);
5590
5703
  }
5591
5704
  });
5592
5705
  // check_mandate_spending → was validate_mandate_spending (not C0-gated — read-only check)
@@ -5595,7 +5708,7 @@ export function registerTools(server, convex, oauthCtx) {
5595
5708
  "EXAMPLE: check_mandate_spending mandateId='j57aaaaa...' proposedAmount=500.", {
5596
5709
  mandateId: z.string(),
5597
5710
  proposedAmount: z.number(),
5598
- }, async ({ mandateId, proposedAmount }) => {
5711
+ }, { readOnlyHint: true, openWorldHint: false, destructiveHint: false, title: "Check mandate spending (alias)" }, async ({ mandateId, proposedAmount }) => {
5599
5712
  try {
5600
5713
  const result = await convex.query("mandates:validateSpending", {
5601
5714
  mandateId,
@@ -5604,7 +5717,7 @@ export function registerTools(server, convex, oauthCtx) {
5604
5717
  return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
5605
5718
  }
5606
5719
  catch (error) {
5607
- return mcpError(error.message ?? String(error));
5720
+ return mcpConvexError(error);
5608
5721
  }
5609
5722
  });
5610
5723
  // check_fix → was validate_fix [ALIAS of validate_fix — C0.5 master-only]
@@ -5613,7 +5726,7 @@ export function registerTools(server, convex, oauthCtx) {
5613
5726
  "EXAMPLE: check_fix patternId='j57aaaaa...' validatedFix='Add suppressHydrationWarning to date elements'.", {
5614
5727
  patternId: z.string(),
5615
5728
  validatedFix: z.string(),
5616
- }, async ({ patternId, validatedFix }) => {
5729
+ }, { readOnlyHint: false, openWorldHint: false, destructiveHint: false, title: "Check/validate fix (alias)" }, async ({ patternId, validatedFix }) => {
5617
5730
  const masterDenied = guardMasterOnly("check_fix");
5618
5731
  if (masterDenied)
5619
5732
  return masterDenied;
@@ -5625,7 +5738,7 @@ export function registerTools(server, convex, oauthCtx) {
5625
5738
  return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
5626
5739
  }
5627
5740
  catch (error) {
5628
- return mcpError(error.message ?? String(error));
5741
+ return mcpConvexError(error);
5629
5742
  }
5630
5743
  });
5631
5744
  // create_fix_attempt → was add_fix_attempt (not C0-gated — uses guardFrom(createdBy))
@@ -5638,7 +5751,7 @@ export function registerTools(server, convex, oauthCtx) {
5638
5751
  why: z.string().optional(),
5639
5752
  commitSha: z.string().optional(),
5640
5753
  createdBy: z.string(),
5641
- }, async ({ patternId, description, worked, why, commitSha, createdBy }) => {
5754
+ }, { readOnlyHint: false, openWorldHint: false, destructiveHint: false, title: "Create fix attempt (alias)" }, async ({ patternId, description, worked, why, commitSha, createdBy }) => {
5642
5755
  const fromDenied = guardFrom(createdBy);
5643
5756
  if (fromDenied)
5644
5757
  return fromDenied;
@@ -5654,7 +5767,7 @@ export function registerTools(server, convex, oauthCtx) {
5654
5767
  return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
5655
5768
  }
5656
5769
  catch (error) {
5657
- return mcpError(error.message ?? String(error));
5770
+ return mcpConvexError(error);
5658
5771
  }
5659
5772
  });
5660
5773
  // create_task_dependency → was add_task_dependency (not C0-gated — uses callerOrchestrator auth)
@@ -5664,7 +5777,7 @@ export function registerTools(server, convex, oauthCtx) {
5664
5777
  taskId: z.string(),
5665
5778
  dependsOn: z.array(z.string()),
5666
5779
  callerOrchestrator: z.string(),
5667
- }, async ({ taskId, dependsOn, callerOrchestrator }) => {
5780
+ }, { readOnlyHint: false, openWorldHint: false, destructiveHint: false, title: "Create task dependency (alias)" }, async ({ taskId, dependsOn, callerOrchestrator }) => {
5668
5781
  try {
5669
5782
  const result = await convex.mutation("tasks:update", {
5670
5783
  taskId,
@@ -5674,7 +5787,7 @@ export function registerTools(server, convex, oauthCtx) {
5674
5787
  return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
5675
5788
  }
5676
5789
  catch (error) {
5677
- return mcpError(error.message ?? String(error));
5790
+ return mcpConvexError(error);
5678
5791
  }
5679
5792
  });
5680
5793
  // update_summary → was set_summary (not C0-gated — uses orchestratorId auth)
@@ -5684,7 +5797,7 @@ export function registerTools(server, convex, oauthCtx) {
5684
5797
  orchestratorId: z.string(),
5685
5798
  instanceId: z.string().optional(),
5686
5799
  summary: z.string(),
5687
- }, async ({ orchestratorId, instanceId, summary }) => {
5800
+ }, { readOnlyHint: false, openWorldHint: false, destructiveHint: false, title: "Update summary (alias)" }, async ({ orchestratorId, instanceId, summary }) => {
5688
5801
  try {
5689
5802
  const result = await convex.mutation("profiles:updateDynamic", {
5690
5803
  orchestratorId,
@@ -5694,7 +5807,7 @@ export function registerTools(server, convex, oauthCtx) {
5694
5807
  return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
5695
5808
  }
5696
5809
  catch (error) {
5697
- return mcpError(error.message ?? String(error));
5810
+ return mcpConvexError(error);
5698
5811
  }
5699
5812
  });
5700
5813
  // create_diary → was write_diary (not C0-gated — uses guardFrom(author) when present)
@@ -5705,7 +5818,7 @@ export function registerTools(server, convex, oauthCtx) {
5705
5818
  orchestrator: z.string(),
5706
5819
  content: z.string(),
5707
5820
  author: z.string().optional(),
5708
- }, async ({ date, orchestrator, content, author }) => {
5821
+ }, { readOnlyHint: false, openWorldHint: false, destructiveHint: false, title: "Create diary entry (alias)" }, async ({ date, orchestrator, content, author }) => {
5709
5822
  assertContentSize(content, "content");
5710
5823
  if (author !== undefined) {
5711
5824
  const fromDenied = guardFrom(author);
@@ -5722,7 +5835,7 @@ export function registerTools(server, convex, oauthCtx) {
5722
5835
  return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
5723
5836
  }
5724
5837
  catch (error) {
5725
- return mcpError(error.message ?? String(error));
5838
+ return mcpConvexError(error);
5726
5839
  }
5727
5840
  });
5728
5841
  // ── get_task ────────────────────────────────────────────────────────────────
@@ -5749,7 +5862,7 @@ export function registerTools(server, convex, oauthCtx) {
5749
5862
  };
5750
5863
  }
5751
5864
  catch (error) {
5752
- return mcpError(error.message ?? String(error));
5865
+ return mcpConvexError(error);
5753
5866
  }
5754
5867
  });
5755
5868
  // ── get_fix_pattern ─────────────────────────────────────────────────────────
@@ -5775,7 +5888,7 @@ export function registerTools(server, convex, oauthCtx) {
5775
5888
  };
5776
5889
  }
5777
5890
  catch (error) {
5778
- return mcpError(error.message ?? String(error));
5891
+ return mcpConvexError(error);
5779
5892
  }
5780
5893
  });
5781
5894
  // ── get_mandate ─────────────────────────────────────────────────────────────
@@ -5801,7 +5914,7 @@ export function registerTools(server, convex, oauthCtx) {
5801
5914
  };
5802
5915
  }
5803
5916
  catch (error) {
5804
- return mcpError(error.message ?? String(error));
5917
+ return mcpConvexError(error);
5805
5918
  }
5806
5919
  });
5807
5920
  // ── get_repo_mapping ────────────────────────────────────────────────────────
@@ -5832,7 +5945,7 @@ export function registerTools(server, convex, oauthCtx) {
5832
5945
  };
5833
5946
  }
5834
5947
  catch (error) {
5835
- return mcpError(error.message ?? String(error));
5948
+ return mcpConvexError(error);
5836
5949
  }
5837
5950
  });
5838
5951
  // ── get_message ─────────────────────────────────────────────────────────────
@@ -5861,7 +5974,7 @@ export function registerTools(server, convex, oauthCtx) {
5861
5974
  };
5862
5975
  }
5863
5976
  catch (error) {
5864
- return mcpError(error.message ?? String(error));
5977
+ return mcpConvexError(error);
5865
5978
  }
5866
5979
  });
5867
5980
  // ── get_recurring_task ──────────────────────────────────────────────────────
@@ -5890,7 +6003,7 @@ export function registerTools(server, convex, oauthCtx) {
5890
6003
  };
5891
6004
  }
5892
6005
  catch (error) {
5893
- return mcpError(error.message ?? String(error));
6006
+ return mcpConvexError(error);
5894
6007
  }
5895
6008
  });
5896
6009
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vantage-peers-mcp",
3
- "version": "2.7.0",
3
+ "version": "2.8.0",
4
4
  "description": "MCP server for VantagePeers — shared memory, messaging, and task coordination for AI agent teams",
5
5
  "type": "module",
6
6
  "main": "./dist/server.js",