vantage-peers-mcp 2.15.0 → 2.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.
@@ -30,6 +30,18 @@ export declare function capListResponseBytes(items: unknown, rawText: string, to
30
30
  export declare const convexIdPattern: RegExp;
31
31
  export declare const receiptIdSchema: z.ZodString;
32
32
  export declare const memoryIdSchema: z.ZodString;
33
+ export declare const taskIdSchema: z.ZodString;
34
+ export declare const missionIdSchema: z.ZodString;
35
+ export declare const messageIdSchema: z.ZodString;
36
+ export declare const noteIdSchema: z.ZodString;
37
+ export declare const componentIdSchema: z.ZodString;
38
+ export declare const mandateIdSchema: z.ZodString;
39
+ export declare const patternIdSchema: z.ZodString;
40
+ export declare const errorIdSchema: z.ZodString;
41
+ export declare const recurringTaskIdSchema: z.ZodString;
42
+ export declare const buIdSchema: z.ZodString;
43
+ export declare const episodeIdSchema: z.ZodString;
44
+ export declare const diaryIdSchema: z.ZodString;
33
45
  export declare const creatorSchema: z.ZodString;
34
46
  export declare const severitySchema: z.ZodEnum<{
35
47
  critical: "critical";
package/dist/src/tools.js CHANGED
@@ -143,6 +143,20 @@ export const receiptIdSchema = z
143
143
  export const memoryIdSchema = z
144
144
  .string()
145
145
  .regex(convexIdPattern, "Invalid memory ID format (expected 32-char Convex ID)");
146
+ /** Build a strict Convex document-ID schema with a field-named error message. */
147
+ const convexIdSchema = (field) => z.string().regex(convexIdPattern, `${field} must be a 32-char lowercase alphanumeric Convex ID`);
148
+ export const taskIdSchema = convexIdSchema("taskId");
149
+ export const missionIdSchema = convexIdSchema("missionId");
150
+ export const messageIdSchema = convexIdSchema("messageId");
151
+ export const noteIdSchema = convexIdSchema("noteId");
152
+ export const componentIdSchema = convexIdSchema("componentId");
153
+ export const mandateIdSchema = convexIdSchema("mandateId");
154
+ export const patternIdSchema = convexIdSchema("patternId");
155
+ export const errorIdSchema = convexIdSchema("errorId");
156
+ export const recurringTaskIdSchema = convexIdSchema("recurringTaskId");
157
+ export const buIdSchema = convexIdSchema("buId");
158
+ export const episodeIdSchema = convexIdSchema("episodeId");
159
+ export const diaryIdSchema = convexIdSchema("diaryId");
146
160
  const memoryTypeSchema = z
147
161
  .enum(["user", "feedback", "project", "reference", "episode"])
148
162
  .describe("Memory classification type");
@@ -347,9 +361,7 @@ export const updateBriefingNoteDescription = "Update an existing briefing note;
347
361
  "WHEN: use to add decisions, fix content, or relink memories — RBAC: caller must be createdBy or system. " +
348
362
  "EXAMPLE: update_briefing_note noteId='j57aaaaa...' callerOrchestrator='alpha' decisions=['Use hybrid_search first'].";
349
363
  export const updateBriefingNoteSchema = z.object({
350
- noteId: z
351
- .string()
352
- .describe("Convex document ID of the briefing note to update"),
364
+ noteId: noteIdSchema.describe("Convex document ID of the briefing note to update"),
353
365
  callerOrchestrator: creatorSchema.describe("Orchestrator role making the update — must match createdBy or be 'system' (RBAC deny-by-default)"),
354
366
  title: z.string().optional().describe("Optional new title — full replace"),
355
367
  topic: z.string().optional().describe("Optional new topic — full replace"),
@@ -597,7 +609,21 @@ export function parseConvexError(rawMessage) {
597
609
  * used by `mcpError`.
598
610
  */
599
611
  export function mcpConvexError(error) {
600
- const rawMessage = error instanceof Error ? error.message : String(error);
612
+ // Empirical probe (Day 127, 2026-07-10 — Sigma): Convex redacts
613
+ // `error.message` to a bare "[Request ID: ...] Server Error" string for
614
+ // ConvexError throws, but the ACTUAL actionable payload passed to
615
+ // `throw new ConvexError(...)` server-side survives on `error.data`
616
+ // (string or arbitrary JSON-serialisable value). Prefer `.data` when
617
+ // present so callers see e.g. "TASK_START_BLOCKED: ..." instead of the
618
+ // opaque redacted message.
619
+ const data = error?.data;
620
+ const rawMessage = data !== undefined && data !== null
621
+ ? typeof data === "string"
622
+ ? data
623
+ : JSON.stringify(data)
624
+ : error instanceof Error
625
+ ? error.message
626
+ : String(error);
601
627
  const parsed = parseConvexError(rawMessage);
602
628
  // For ArgumentValidationError and other known Convex codes, return structured JSON
603
629
  if (parsed.code !== "ServerError") {
@@ -1179,9 +1205,7 @@ export function registerTools(server, convex, oauthCtx) {
1179
1205
  createdBy: creatorSchema,
1180
1206
  relatesTo: z
1181
1207
  .object({
1182
- targetId: z
1183
- .string()
1184
- .describe("ID of the memory this relates to (Convex document ID)"),
1208
+ targetId: memoryIdSchema.describe("ID of the memory this relates to (Convex document ID)"),
1185
1209
  type: z
1186
1210
  .enum(["updates", "extends", "derives"])
1187
1211
  .describe("Relation type: updates=supersedes, extends=adds detail, derives=inference"),
@@ -1244,9 +1268,7 @@ export function registerTools(server, convex, oauthCtx) {
1244
1268
  server.tool("soft_delete_memory", "Soft-delete a memory so it stops appearing in recall results while remaining in the audit log. " +
1245
1269
  "WHEN: use to retire an outdated fact or superseded rule without permanent data loss. " +
1246
1270
  "EXAMPLE: soft_delete_memory memoryId='j57dy3049btafda9m2f5d2ggk987ph3f'.", {
1247
- memoryId: z
1248
- .string()
1249
- .describe("Convex document ID of the memory to soft-delete"),
1271
+ memoryId: memoryIdSchema.describe("Convex document ID of the memory to soft-delete"),
1250
1272
  }, {
1251
1273
  readOnlyHint: false,
1252
1274
  openWorldHint: false,
@@ -1277,7 +1299,7 @@ export function registerTools(server, convex, oauthCtx) {
1277
1299
  server.tool("get_memory", "Fetch a single memory by its Convex document ID, including relations and episode metadata. " +
1278
1300
  "WHEN: use when you have a specific memoryId from a prior recall/store and need the full record. " +
1279
1301
  "EXAMPLE: get_memory memoryId='j57dy3049btafda9m2f5d2ggk987ph3f'.", {
1280
- memoryId: z.string().describe("Memory document ID"),
1302
+ memoryId: memoryIdSchema.describe("Memory document ID"),
1281
1303
  }, {
1282
1304
  readOnlyHint: true,
1283
1305
  openWorldHint: false,
@@ -1632,7 +1654,7 @@ export function registerTools(server, convex, oauthCtx) {
1632
1654
  server.tool("get_episode", "Fetch a single episode by its memory document ID. Episodes are memories with type='episode' carrying context/goal/action/outcome/insight + severity. " +
1633
1655
  "WHEN: use when you have an episodeId from store_episode or a prior search and need the full record. " +
1634
1656
  "EXAMPLE: get_episode episodeId='j57dy3049btafda9m2f5d2ggk987ph3f'.", {
1635
- episodeId: z.string().describe("Episode (memory) document ID"),
1657
+ episodeId: episodeIdSchema.describe("Episode (memory) document ID"),
1636
1658
  }, {
1637
1659
  readOnlyHint: true,
1638
1660
  openWorldHint: false,
@@ -2266,9 +2288,7 @@ export function registerTools(server, convex, oauthCtx) {
2266
2288
  server.tool("delete_message", "Delete a message and all its receipts; only the original sender or system may delete. " +
2267
2289
  "WHEN: use to retract a mistaken broadcast or sensitive content before recipients read it. " +
2268
2290
  "EXAMPLE: delete_message messageId='j57dy3049btafda9m2f5d2ggk987ph3f' callerOrchestrator='alpha'.", {
2269
- messageId: z
2270
- .string()
2271
- .describe("Convex document ID of the message to delete"),
2291
+ messageId: messageIdSchema.describe("Convex document ID of the message to delete"),
2272
2292
  callerOrchestrator: creatorSchema
2273
2293
  .optional()
2274
2294
  .describe("Optional RBAC — must be the sender or system"),
@@ -2586,9 +2606,7 @@ export function registerTools(server, convex, oauthCtx) {
2586
2606
  "WHEN: use after send_message to confirm all recipients acknowledged a critical announcement. " +
2587
2607
  "EXAMPLE: list_broadcast_status messageId='j57dy3049btafda9m2f5d2ggk987ph3f'. " +
2588
2608
  "Default limit 20. cap 200.", {
2589
- messageId: z
2590
- .string()
2591
- .describe("Convex document ID of the broadcast message"),
2609
+ messageId: messageIdSchema.describe("Convex document ID of the broadcast message"),
2592
2610
  limit: z
2593
2611
  .number()
2594
2612
  .int()
@@ -2646,11 +2664,10 @@ export function registerTools(server, convex, oauthCtx) {
2646
2664
  priority: prioritySchema,
2647
2665
  status: taskStatusSchema.default("todo"),
2648
2666
  dependsOn: z
2649
- .array(z.string())
2667
+ .array(taskIdSchema)
2650
2668
  .optional()
2651
2669
  .describe("Task IDs that must be completed before this task can start"),
2652
- missionId: z
2653
- .string()
2670
+ missionId: missionIdSchema
2654
2671
  .optional()
2655
2672
  .describe("Convex document ID of the parent mission"),
2656
2673
  estimatedMinutes: z
@@ -2821,7 +2838,7 @@ export function registerTools(server, convex, oauthCtx) {
2821
2838
  .optional()
2822
2839
  .describe("Filter by status"),
2823
2840
  project: z.string().optional().describe("Filter by project name"),
2824
- missionId: z.string().optional().describe("Filter by mission Convex ID"),
2841
+ missionId: missionIdSchema.optional().describe("Filter by mission Convex ID"),
2825
2842
  limit: z
2826
2843
  .number()
2827
2844
  .int()
@@ -2861,7 +2878,7 @@ export function registerTools(server, convex, oauthCtx) {
2861
2878
  server.tool("update_task", "Update any mutable field on a task; only provided fields are patched, updatedAt auto-set. " +
2862
2879
  "WHEN: use to reassign, reprioritize, or add context to an existing task without recreating it. " +
2863
2880
  "EXAMPLE: update_task taskId='k178d3ns...' status='review' callerOrchestrator='alpha'.", {
2864
- taskId: z.string().describe("Convex document ID of the task to update"),
2881
+ taskId: taskIdSchema.describe("Convex document ID of the task to update"),
2865
2882
  title: z.string().optional().describe("New title"),
2866
2883
  description: z.string().optional().describe("New description"),
2867
2884
  project: z.string().optional().describe("New project"),
@@ -2870,11 +2887,10 @@ export function registerTools(server, convex, oauthCtx) {
2870
2887
  priority: prioritySchema.optional().describe("New priority"),
2871
2888
  status: taskStatusSchema.optional().describe("New status"),
2872
2889
  dependsOn: z
2873
- .array(z.string())
2890
+ .array(taskIdSchema)
2874
2891
  .optional()
2875
2892
  .describe("Task IDs that must be completed before this task can start"),
2876
- missionId: z
2877
- .string()
2893
+ missionId: missionIdSchema
2878
2894
  .optional()
2879
2895
  .describe("Link to a mission (Convex document ID)"),
2880
2896
  estimatedMinutes: z
@@ -2946,7 +2962,7 @@ export function registerTools(server, convex, oauthCtx) {
2946
2962
  server.tool("complete_task", "Mark a task as done with a mandatory completionNote; always notify the creator via send_message after. " +
2947
2963
  "WHEN: call when all deliverables are committed or verified — never complete without a proof token in the note. " +
2948
2964
  "EXAMPLE: complete_task taskId='k178d3ns...' completionNote='PR #667 merged, 86 descriptions updated' callerOrchestrator='beta'.", {
2949
- taskId: z.string().describe("Convex document ID of the task to complete"),
2965
+ taskId: taskIdSchema.describe("Convex document ID of the task to complete"),
2950
2966
  completionNote: z
2951
2967
  .string()
2952
2968
  .describe("What was actually done — summary of work completed"),
@@ -2987,7 +3003,7 @@ export function registerTools(server, convex, oauthCtx) {
2987
3003
  server.tool("start_task", "Set a task to in_progress and record the startedAt timestamp for duration tracking. " +
2988
3004
  "WHEN: call as the first action when picking up a task to signal activity and enable metrics. " +
2989
3005
  "EXAMPLE: start_task taskId='k178d3ns...' callerOrchestrator='gamma'.", {
2990
- taskId: z.string().describe("Convex document ID of the task to start"),
3006
+ taskId: taskIdSchema.describe("Convex document ID of the task to start"),
2991
3007
  callerOrchestrator: creatorSchema
2992
3008
  .optional()
2993
3009
  .describe("Optional RBAC — if provided, must be creator or assignee"),
@@ -3024,7 +3040,7 @@ export function registerTools(server, convex, oauthCtx) {
3024
3040
  server.tool("checkout_task", "Atomically claim a todo task, preventing race conditions when multiple orchestrators compete. " +
3025
3041
  "WHEN: use before start_task in multi-orchestrator queues to ensure exclusive ownership. " +
3026
3042
  "EXAMPLE: checkout_task taskId='k178d3ns...' callerOrchestrator='alpha' callerInstance='alpha-vps'.", {
3027
- taskId: z.string().describe("Convex document ID of the task to claim"),
3043
+ taskId: taskIdSchema.describe("Convex document ID of the task to claim"),
3028
3044
  callerOrchestrator: creatorSchema.describe("Orchestrator claiming the task (e.g. sigma, pi)"),
3029
3045
  callerInstance: z
3030
3046
  .string()
@@ -3062,7 +3078,7 @@ export function registerTools(server, convex, oauthCtx) {
3062
3078
  server.tool("delete_task", "Permanently delete a task; only the creator or system role may delete. " +
3063
3079
  "WHEN: use to remove erroneously created tasks or test artifacts — prefer complete_task for real work. " +
3064
3080
  "EXAMPLE: delete_task taskId='k178d3ns...' callerOrchestrator='alpha'.", {
3065
- taskId: z.string().describe("Convex document ID of the task to delete"),
3081
+ taskId: taskIdSchema.describe("Convex document ID of the task to delete"),
3066
3082
  callerOrchestrator: creatorSchema
3067
3083
  .optional()
3068
3084
  .describe("Optional RBAC — must be creator or system"),
@@ -3099,10 +3115,10 @@ export function registerTools(server, convex, oauthCtx) {
3099
3115
  server.tool("block_task", "Mark a task as blocked with an optional reason and blocking task IDs, setting status to blocked. " +
3100
3116
  "WHEN: use when external dependency or missing input prevents progress — record the specific blocker. " +
3101
3117
  "EXAMPLE: block_task taskId='k178d3ns...' reason='Waiting for B2 PR#667 merge' callerOrchestrator='beta'.", {
3102
- taskId: z.string().describe("Convex document ID of the task to block"),
3118
+ taskId: taskIdSchema.describe("Convex document ID of the task to block"),
3103
3119
  reason: z.string().optional().describe("Why the task is blocked"),
3104
3120
  blockedBy: z
3105
- .array(z.string())
3121
+ .array(taskIdSchema)
3106
3122
  .optional()
3107
3123
  .describe("Task IDs that are blocking this task"),
3108
3124
  callerOrchestrator: creatorSchema
@@ -3148,11 +3164,9 @@ export function registerTools(server, convex, oauthCtx) {
3148
3164
  server.tool("add_task_dependency", "Add dependency task IDs to a task so it cannot start until all listed tasks complete. " +
3149
3165
  "WHEN: use when creating a task that depends on prior work not yet captured in dependsOn. " +
3150
3166
  "EXAMPLE: create_task_dependency taskId='k178d3ns...' dependsOn=['k17bbbbb...'] callerOrchestrator='alpha'.", {
3151
- taskId: z
3152
- .string()
3153
- .describe("Convex document ID of the task that depends on others"),
3167
+ taskId: taskIdSchema.describe("Convex document ID of the task that depends on others"),
3154
3168
  dependsOn: z
3155
- .array(z.string())
3169
+ .array(taskIdSchema)
3156
3170
  .describe("Task IDs that must complete first"),
3157
3171
  callerOrchestrator: creatorSchema
3158
3172
  .optional()
@@ -3194,7 +3208,7 @@ export function registerTools(server, convex, oauthCtx) {
3194
3208
  "WHEN: use to review mission progress or find blocked/open tasks within a specific mission. " +
3195
3209
  "EXAMPLE: list_tasks_by_mission missionId='k57a36y8...' status='in_progress' limit=20. " +
3196
3210
  "Default limit 20. cap 200.", {
3197
- missionId: z.string().describe("Convex document ID of the mission"),
3211
+ missionId: missionIdSchema.describe("Convex document ID of the mission"),
3198
3212
  status: taskStatusFilterSchema
3199
3213
  .optional()
3200
3214
  .describe("Filter by task status (single, alias, or array)"),
@@ -3435,7 +3449,7 @@ export function registerTools(server, convex, oauthCtx) {
3435
3449
  server.tool("get_mission", "Fetch a single mission by Convex ID with full details: status, pilot, agents, progress, and dates. " +
3436
3450
  "WHEN: use before assigning tasks or reporting to get the canonical mission state. " +
3437
3451
  "EXAMPLE: get_mission missionId='k57a36y8w5t085bqr23dsmvb2d882506'.", {
3438
- missionId: z.string().describe("Convex document ID of the mission"),
3452
+ missionId: missionIdSchema.describe("Convex document ID of the mission"),
3439
3453
  }, {
3440
3454
  readOnlyHint: true,
3441
3455
  openWorldHint: false,
@@ -3465,9 +3479,7 @@ export function registerTools(server, convex, oauthCtx) {
3465
3479
  server.tool("update_mission", "Update any mutable field on a mission; only provided fields are patched, updatedAt auto-set. " +
3466
3480
  "WHEN: use to advance status, update progress percentage, or change pilot/agents mid-flight. " +
3467
3481
  "EXAMPLE: update_mission missionId='k57a36y8...' progress=75 status='validate'.", {
3468
- missionId: z
3469
- .string()
3470
- .describe("Convex document ID of the mission to update"),
3482
+ missionId: missionIdSchema.describe("Convex document ID of the mission to update"),
3471
3483
  name: z.string().optional().describe("New name"),
3472
3484
  description: z.string().optional().describe("New description"),
3473
3485
  project: z.string().optional().describe("New project"),
@@ -3522,7 +3534,7 @@ export function registerTools(server, convex, oauthCtx) {
3522
3534
  server.tool("update_mission_status", "Change a mission's lifecycle status in a single call without touching other fields. " +
3523
3535
  "WHEN: use as a lightweight alternative to update_mission when only the status changes. " +
3524
3536
  "EXAMPLE: update_mission_status missionId='k57a36y8...' status='complete'.", {
3525
- missionId: z.string().describe("Convex document ID of the mission"),
3537
+ missionId: missionIdSchema.describe("Convex document ID of the mission"),
3526
3538
  status: missionStatusSchema.describe("New status"),
3527
3539
  }, {
3528
3540
  readOnlyHint: false,
@@ -3860,7 +3872,7 @@ export function registerTools(server, convex, oauthCtx) {
3860
3872
  server.tool("get_briefing_note", "Fetch a single briefing note by ID with all fields: title, topic, participants, content, decisions, and links. " +
3861
3873
  "WHEN: use when you have a specific noteId and need the full structured record for a handoff or recap. " +
3862
3874
  "EXAMPLE: get_briefing_note noteId='j57dy3049btafda9m2f5d2ggk987ph3f'.", {
3863
- noteId: z.string().describe("Briefing note document ID"),
3875
+ noteId: noteIdSchema.describe("Briefing note document ID"),
3864
3876
  }, {
3865
3877
  readOnlyHint: true,
3866
3878
  openWorldHint: false,
@@ -4213,7 +4225,7 @@ export function registerTools(server, convex, oauthCtx) {
4213
4225
  server.tool("update_component", "Update a component's content, version, or team; only provided fields are patched. " +
4214
4226
  "WHEN: use to bump a skill version or fix content without re-registering from scratch. " +
4215
4227
  "EXAMPLE: update_component componentId='j57aaaaa...' version='1.3.0' content='...'.", {
4216
- componentId: z.string().describe("Convex document ID of the component"),
4228
+ componentId: componentIdSchema.describe("Convex document ID of the component"),
4217
4229
  name: z.string().optional().describe("New component name"),
4218
4230
  team: z.string().optional().describe("New team name"),
4219
4231
  content: z.string().optional().describe("New content/source code"),
@@ -4262,9 +4274,7 @@ export function registerTools(server, convex, oauthCtx) {
4262
4274
  server.tool("delete_component", "Permanently delete a component from the registry by Convex document ID. " +
4263
4275
  "WHEN: use to remove deprecated or test components that should no longer be discoverable. " +
4264
4276
  "EXAMPLE: delete_component componentId='j57aaaaa...'.", {
4265
- componentId: z
4266
- .string()
4267
- .describe("Convex document ID of the component to delete"),
4277
+ componentId: componentIdSchema.describe("Convex document ID of the component to delete"),
4268
4278
  }, {
4269
4279
  readOnlyHint: false,
4270
4280
  openWorldHint: false,
@@ -4529,7 +4539,7 @@ export function registerTools(server, convex, oauthCtx) {
4529
4539
  server.tool("pause_recurring_task", "Pause a recurring task template to stop auto-creating tasks until explicitly resumed. " +
4530
4540
  "WHEN: use during holidays, freezes, or when the assignee is unavailable for a period. " +
4531
4541
  "EXAMPLE: pause_recurring_task taskId='j57aaaaa...'.", {
4532
- taskId: z.string().describe("Recurring task ID"),
4542
+ taskId: recurringTaskIdSchema.describe("Recurring task ID"),
4533
4543
  }, {
4534
4544
  readOnlyHint: false,
4535
4545
  openWorldHint: false,
@@ -4556,7 +4566,7 @@ export function registerTools(server, convex, oauthCtx) {
4556
4566
  server.tool("resume_recurring_task", "Resume a paused recurring task template and recalculate its next scheduled run time. " +
4557
4567
  "WHEN: use after a pause period ends to re-enable automatic task generation. " +
4558
4568
  "EXAMPLE: resume_recurring_task taskId='j57aaaaa...'.", {
4559
- taskId: z.string().describe("Recurring task ID"),
4569
+ taskId: recurringTaskIdSchema.describe("Recurring task ID"),
4560
4570
  }, {
4561
4571
  readOnlyHint: false,
4562
4572
  openWorldHint: false,
@@ -4583,7 +4593,7 @@ export function registerTools(server, convex, oauthCtx) {
4583
4593
  server.tool("delete_recurring_task", "Permanently delete a recurring task template, stopping all future scheduled task generation. " +
4584
4594
  "WHEN: use when a recurring process is retired and should never generate tasks again. " +
4585
4595
  "EXAMPLE: delete_recurring_task taskId='j57aaaaa...'.", {
4586
- taskId: z.string().describe("Recurring task ID"),
4596
+ taskId: recurringTaskIdSchema.describe("Recurring task ID"),
4587
4597
  }, {
4588
4598
  readOnlyHint: false,
4589
4599
  openWorldHint: false,
@@ -4610,9 +4620,7 @@ export function registerTools(server, convex, oauthCtx) {
4610
4620
  server.tool("update_recurring_task", "Update a recurring task template's fields; cronExpression change auto-recalculates nextRunAt. " +
4611
4621
  "WHEN: use to change assignee, schedule, or priority of an active recurring template. " +
4612
4622
  "EXAMPLE: update_recurring_task recurringTaskId='j57aaaaa...' cronExpression='0 10 * * 1' priority='high'.", {
4613
- recurringTaskId: z
4614
- .string()
4615
- .describe("Convex document ID of the recurring task"),
4623
+ recurringTaskId: recurringTaskIdSchema.describe("Convex document ID of the recurring task"),
4616
4624
  title: z.string().optional().describe("New title"),
4617
4625
  description: z.string().optional().describe("New description"),
4618
4626
  assignedTo: creatorSchema.optional().describe("New assignee"),
@@ -4715,9 +4723,7 @@ export function registerTools(server, convex, oauthCtx) {
4715
4723
  server.tool("accept_mandate", "Accept a mandate by the fulfilledBy orchestrator, advancing status from requested to accepted. " +
4716
4724
  "WHEN: call when the fulfiller confirms they can deliver the service within the agreed budget. " +
4717
4725
  "EXAMPLE: accept_mandate mandateId='j57aaaaa...' callerOrchestrator='beta'.", {
4718
- mandateId: z
4719
- .string()
4720
- .describe("Convex document ID of the mandate to accept"),
4726
+ mandateId: mandateIdSchema.describe("Convex document ID of the mandate to accept"),
4721
4727
  callerOrchestrator: creatorSchema.describe("Must be the fulfilledBy orchestrator or system"),
4722
4728
  }, {
4723
4729
  readOnlyHint: false,
@@ -4750,9 +4756,7 @@ export function registerTools(server, convex, oauthCtx) {
4750
4756
  server.tool("update_mandate", "Update a mandate's status, tokensCost, or linkedTaskIds; only fulfilledBy or system may update. " +
4751
4757
  "WHEN: use to record spend progress, link created tasks, or advance status to delivered. " +
4752
4758
  "EXAMPLE: update_mandate mandateId='j57aaaaa...' callerOrchestrator='beta' tokensCost=1200 status='delivered'.", {
4753
- mandateId: z
4754
- .string()
4755
- .describe("Convex document ID of the mandate to update"),
4759
+ mandateId: mandateIdSchema.describe("Convex document ID of the mandate to update"),
4756
4760
  callerOrchestrator: creatorSchema.describe("Must be the fulfilledBy orchestrator or system"),
4757
4761
  status: mandateStatusSchema.optional().describe("New status"),
4758
4762
  tokensCost: z.number().optional().describe("Tokens consumed so far"),
@@ -4794,9 +4798,7 @@ export function registerTools(server, convex, oauthCtx) {
4794
4798
  server.tool("settle_mandate", "Settle a mandate by confirming delivery and recording the final token cost; sets status to settled. " +
4795
4799
  "WHEN: call after verifying the delivered work meets the mandate scope — closes the billing cycle. " +
4796
4800
  "EXAMPLE: settle_mandate mandateId='j57aaaaa...' callerOrchestrator='alpha' finalCost=4800.", {
4797
- mandateId: z
4798
- .string()
4799
- .describe("Convex document ID of the mandate to settle"),
4801
+ mandateId: mandateIdSchema.describe("Convex document ID of the mandate to settle"),
4800
4802
  callerOrchestrator: creatorSchema.describe("Must be the requestedBy orchestrator or system"),
4801
4803
  finalCost: z.number().describe("Final actual token cost to record"),
4802
4804
  }, {
@@ -4831,7 +4833,7 @@ export function registerTools(server, convex, oauthCtx) {
4831
4833
  server.tool("validate_mandate_spending", "Check whether a proposed token spend is within a mandate's AP2 spending limits. " +
4832
4834
  "WHEN: call before each service transaction to prevent over-spend and get within/exceeded status. " +
4833
4835
  "EXAMPLE: check_mandate_spending mandateId='j57aaaaa...' proposedAmount=500.", {
4834
- mandateId: z.string().describe("Mandate ID to validate against"),
4836
+ mandateId: mandateIdSchema.describe("Mandate ID to validate against"),
4835
4837
  proposedAmount: z
4836
4838
  .number()
4837
4839
  .describe("Proposed token spend amount to validate"),
@@ -5015,9 +5017,7 @@ export function registerTools(server, convex, oauthCtx) {
5015
5017
  server.tool("update_bu", "Update any mutable field on a business unit; only provided fields are patched, updatedAt auto-set. " +
5016
5018
  "WHEN: use to update status, revenue projections, or team composition as the BU evolves. " +
5017
5019
  "EXAMPLE: update_bu buId='j57aaaaa...' status='live' revenueProjections={y1:10000,y2:80000,y3:300000}.", {
5018
- buId: z
5019
- .string()
5020
- .describe("Convex document ID of the business unit to update"),
5020
+ buId: buIdSchema.describe("Convex document ID of the business unit to update"),
5021
5021
  name: z.string().optional().describe("New name"),
5022
5022
  description: z.string().optional().describe("New description"),
5023
5023
  purpose: z.string().optional().describe("New purpose"),
@@ -5084,7 +5084,7 @@ export function registerTools(server, convex, oauthCtx) {
5084
5084
  server.tool("get_bu", "Fetch a single business unit by Convex document ID, returning null if not found. " +
5085
5085
  "WHEN: use before updating or reporting on a BU to get the current canonical state. " +
5086
5086
  "EXAMPLE: get_bu buId='j57dy3049btafda9m2f5d2ggk987ph3f'.", {
5087
- buId: z.string().describe("Convex document ID of the business unit"),
5087
+ buId: buIdSchema.describe("Convex document ID of the business unit"),
5088
5088
  }, {
5089
5089
  readOnlyHint: true,
5090
5090
  openWorldHint: false,
@@ -5204,9 +5204,7 @@ export function registerTools(server, convex, oauthCtx) {
5204
5204
  server.tool("delete_bu", "Permanently delete a business unit by Convex document ID — this action is irreversible. " +
5205
5205
  "WHEN: use only for test BUs or entities created in error; prefer status update for real BUs. " +
5206
5206
  "EXAMPLE: delete_bu buId='j57aaaaa...'.", {
5207
- buId: z
5208
- .string()
5209
- .describe("Convex document ID of the business unit to delete"),
5207
+ buId: buIdSchema.describe("Convex document ID of the business unit to delete"),
5210
5208
  }, {
5211
5209
  readOnlyHint: false,
5212
5210
  openWorldHint: false,
@@ -5773,7 +5771,7 @@ export function registerTools(server, convex, oauthCtx) {
5773
5771
  server.tool("add_fix_attempt", "Add a fix attempt record to a pattern with description, outcome, and optional commit reference. " +
5774
5772
  "WHEN: use after each fix attempt (successful or not) to build a complete fix history. " +
5775
5773
  "EXAMPLE: create_fix_attempt patternId='j57aaaaa...' description='Added suppressHydrationWarning' worked=true why='Prevents mismatches' createdBy='beta'.", {
5776
- patternId: z.string().describe("ID of the fix pattern"),
5774
+ patternId: patternIdSchema.describe("ID of the fix pattern"),
5777
5775
  description: z.string().describe("What was tried — the fix approach"),
5778
5776
  worked: z.boolean().describe("Did this fix the issue?"),
5779
5777
  why: z.string().describe("Why it worked or didn't — the reasoning"),
@@ -5814,7 +5812,7 @@ export function registerTools(server, convex, oauthCtx) {
5814
5812
  server.tool("validate_fix", "Set or update the validated fix description on a fix pattern after confirming it works. " +
5815
5813
  "WHEN: use after a fix attempt succeeds to promote it as the canonical solution on the pattern. " +
5816
5814
  "EXAMPLE: check_fix patternId='j57aaaaa...' validatedFix='Add suppressHydrationWarning to date elements'.", {
5817
- patternId: z.string().describe("ID of the fix pattern"),
5815
+ patternId: patternIdSchema.describe("ID of the fix pattern"),
5818
5816
  validatedFix: z.string().describe("Description of the validated fix"),
5819
5817
  }, {
5820
5818
  readOnlyHint: false,
@@ -6046,7 +6044,7 @@ export function registerTools(server, convex, oauthCtx) {
6046
6044
  server.tool("link_issue_to_pattern", "Link a VantagePeers issue to a fix pattern creating a bidirectional reference. " +
6047
6045
  "WHEN: use after creating a fix pattern for an issue to connect the symptom record with the bug tracker. " +
6048
6046
  "EXAMPLE: link_issue_to_pattern patternId='j57aaaaa...' issueId='j57bbbbb...'.", {
6049
- patternId: z.string().describe("ID of the fix pattern"),
6047
+ patternId: patternIdSchema.describe("ID of the fix pattern"),
6050
6048
  issueId: z.string().describe("VantagePeers issue ID to link"),
6051
6049
  }, {
6052
6050
  readOnlyHint: false,
@@ -6179,9 +6177,7 @@ export function registerTools(server, convex, oauthCtx) {
6179
6177
  templateName: z
6180
6178
  .string()
6181
6179
  .describe("Name of the mission template to instantiate"),
6182
- missionId: z
6183
- .string()
6184
- .describe("Convex document ID of the target mission"),
6180
+ missionId: missionIdSchema.describe("Convex document ID of the target mission"),
6185
6181
  context: z
6186
6182
  .record(z.string(), z.string())
6187
6183
  .optional()
@@ -6399,7 +6395,7 @@ export function registerTools(server, convex, oauthCtx) {
6399
6395
  server.tool("get_error", "Fetch a single error log entry by Convex document ID, including full stack trace and issue linkage. " +
6400
6396
  "WHEN: use after list_errors to retrieve the full stack trace for a specific error entry. " +
6401
6397
  "EXAMPLE: get_error errorId='j57dy3049btafda9m2f5d2ggk987ph3f'.", {
6402
- errorId: z.string().describe("Convex document ID of the errorLogs entry"),
6398
+ errorId: errorIdSchema.describe("Convex document ID of the errorLogs entry"),
6403
6399
  }, {
6404
6400
  readOnlyHint: true,
6405
6401
  openWorldHint: false,
@@ -6668,7 +6664,7 @@ export function registerTools(server, convex, oauthCtx) {
6668
6664
  server.tool("check_mandate_spending", "[ALIAS of validate_mandate_spending] Check whether a proposed token spend is within a mandate's AP2 spending limits. " +
6669
6665
  "WHEN: call before each service transaction to prevent over-spend and get within/exceeded status. " +
6670
6666
  "EXAMPLE: check_mandate_spending mandateId='j57aaaaa...' proposedAmount=500.", {
6671
- mandateId: z.string(),
6667
+ mandateId: mandateIdSchema,
6672
6668
  proposedAmount: z.number(),
6673
6669
  }, {
6674
6670
  readOnlyHint: true,
@@ -6693,7 +6689,7 @@ export function registerTools(server, convex, oauthCtx) {
6693
6689
  server.tool("check_fix", "[ALIAS of validate_fix] Set or update the validated fix description on a fix pattern after confirming it works. " +
6694
6690
  "WHEN: use after a fix attempt succeeds to promote it as the canonical solution on the pattern. " +
6695
6691
  "EXAMPLE: check_fix patternId='j57aaaaa...' validatedFix='Add suppressHydrationWarning to date elements'.", {
6696
- patternId: z.string(),
6692
+ patternId: patternIdSchema,
6697
6693
  validatedFix: z.string(),
6698
6694
  }, {
6699
6695
  readOnlyHint: false,
@@ -6721,7 +6717,7 @@ export function registerTools(server, convex, oauthCtx) {
6721
6717
  server.tool("create_fix_attempt", "[ALIAS of add_fix_attempt] Add a fix attempt record to a pattern with description, outcome, and optional commit reference. " +
6722
6718
  "WHEN: use after each fix attempt (successful or not) to build a complete fix history. " +
6723
6719
  "EXAMPLE: create_fix_attempt patternId='j57aaaaa...' description='Added suppressHydrationWarning' worked=true why='Prevents mismatches' createdBy='beta'.", {
6724
- patternId: z.string(),
6720
+ patternId: patternIdSchema,
6725
6721
  description: z.string(),
6726
6722
  worked: z.boolean(),
6727
6723
  why: z.string().optional(),
@@ -6757,8 +6753,8 @@ export function registerTools(server, convex, oauthCtx) {
6757
6753
  server.tool("create_task_dependency", "[ALIAS of add_task_dependency] Add dependency task IDs to a task so it cannot start until all listed tasks complete. " +
6758
6754
  "WHEN: use when creating a task that depends on prior work not yet captured in dependsOn. " +
6759
6755
  "EXAMPLE: create_task_dependency taskId='k178d3ns...' dependsOn=['k17bbbbb...'] callerOrchestrator='alpha'.", {
6760
- taskId: z.string(),
6761
- dependsOn: z.array(z.string()),
6756
+ taskId: taskIdSchema,
6757
+ dependsOn: z.array(taskIdSchema),
6762
6758
  callerOrchestrator: z.string(),
6763
6759
  }, {
6764
6760
  readOnlyHint: false,
@@ -6848,7 +6844,7 @@ export function registerTools(server, convex, oauthCtx) {
6848
6844
  server.tool("get_task", "Fetch a single task by its Convex document ID with all fields: title, description, status, priority, assignment, dependencies, mission link, completion note. " +
6849
6845
  "WHEN: use when you have a specific taskId from list_tasks/create_task and need the full record (brief, VERIFICATION block, completionNote). " +
6850
6846
  "EXAMPLE: get_task taskId='k172735brsw6bc3j2dkkkfxqrx88kkjq'.", {
6851
- taskId: z.string().describe("Task document ID"),
6847
+ taskId: taskIdSchema.describe("Task document ID"),
6852
6848
  }, {
6853
6849
  readOnlyHint: true,
6854
6850
  openWorldHint: false,
@@ -6874,7 +6870,7 @@ export function registerTools(server, convex, oauthCtx) {
6874
6870
  server.tool("get_fix_pattern", "Fetch a single fix pattern by its Convex document ID, including all linked fix attempts. " +
6875
6871
  "WHEN: use when you have a patternId from list_fix_patterns/search_fix_patterns and need the full record with attempts history. " +
6876
6872
  "EXAMPLE: get_fix_pattern patternId='m9748paffd0emrbwyskj868e1x88kvhj'.", {
6877
- patternId: z.string().describe("Fix pattern document ID"),
6873
+ patternId: patternIdSchema.describe("Fix pattern document ID"),
6878
6874
  }, {
6879
6875
  readOnlyHint: true,
6880
6876
  openWorldHint: false,
@@ -6900,7 +6896,7 @@ export function registerTools(server, convex, oauthCtx) {
6900
6896
  server.tool("get_mandate", "Fetch a single spending mandate by its Convex document ID with limits, current spend, and approver chain. " +
6901
6897
  "WHEN: use when you have a mandateId from list_mandates and need the full record before validateSpending/settleMandate. " +
6902
6898
  "EXAMPLE: get_mandate mandateId='k57dy3049btafda9m2f5d2ggk987ph3f'.", {
6903
- mandateId: z.string().describe("Mandate document ID"),
6899
+ mandateId: mandateIdSchema.describe("Mandate document ID"),
6904
6900
  }, {
6905
6901
  readOnlyHint: true,
6906
6902
  openWorldHint: false,
@@ -6960,7 +6956,7 @@ export function registerTools(server, convex, oauthCtx) {
6960
6956
  server.tool("get_message", "Fetch a single peer message by its Convex document ID with full body, channel, sender, sessionDay, and tenant scope. " +
6961
6957
  "WHEN: use when you have a messageId from list_messages/check_messages and need the raw row (e.g. for read-receipt audit, delete confirmation, or referencing in a fix pattern). " +
6962
6958
  "EXAMPLE: get_message messageId='jn7eg21wdaxzdcpdxwkvhaxqnh88jqg2'.", {
6963
- messageId: z.string().describe("Message document ID"),
6959
+ messageId: messageIdSchema.describe("Message document ID"),
6964
6960
  }, {
6965
6961
  readOnlyHint: true,
6966
6962
  openWorldHint: false,
@@ -6989,7 +6985,7 @@ export function registerTools(server, convex, oauthCtx) {
6989
6985
  server.tool("get_recurring_task", "Fetch a single recurring task definition by its Convex document ID with cron schedule, prompt, assignee, and last-fire metadata. " +
6990
6986
  "WHEN: use when you have a recurringTaskId from list_recurring_tasks and need the full row before pause_recurring_task / update_recurring_task / delete_recurring_task. " +
6991
6987
  "EXAMPLE: get_recurring_task recurringTaskId='k57dy3049btafda9m2f5d2ggk987ph3f'.", {
6992
- recurringTaskId: z.string().describe("Recurring task document ID"),
6988
+ recurringTaskId: recurringTaskIdSchema.describe("Recurring task document ID"),
6993
6989
  }, {
6994
6990
  readOnlyHint: true,
6995
6991
  openWorldHint: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vantage-peers-mcp",
3
- "version": "2.15.0",
3
+ "version": "2.16.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",
@@ -89,7 +89,6 @@
89
89
  "node": ">=20"
90
90
  },
91
91
  "publishConfig": {
92
- "access": "public",
93
- "provenance": true
92
+ "access": "public"
94
93
  }
95
94
  }