You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: server/src/cli/mcp/server.ts
+17-1Lines changed: 17 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,7 @@ import { z } from 'zod';
4
4
import{CrystalClient}from'../client.js';
5
5
import{
6
6
RecallForTaskRequestShape,
7
+
ValidateTaskMemoryRequestShape,
7
8
WriteTaskMemoryRequestShape,
8
9
}from'../../services/memory/schemas.js';
9
10
@@ -106,9 +107,24 @@ export async function startMcpServer(baseUrl: string) {
106
107
},
107
108
);
108
109
110
+
server.tool(
111
+
'validate_task_memory',
112
+
'Preflight a task memory candidate without side effects. Use this before write_task_memory when available. Returns materialized ChatCrystal note fields, acceptance, reason, and warnings.',
113
+
ValidateTaskMemoryRequestShape,
114
+
async(input)=>{
115
+
constdata=awaitclient.validateTaskMemory(input);
116
+
return{
117
+
content: [{
118
+
type: 'text'asconst,
119
+
text: JSON.stringify(data,null,2),
120
+
}],
121
+
};
122
+
},
123
+
);
124
+
109
125
server.tool(
110
126
'write_task_memory',
111
-
'Persist a task memory with idempotent auto-writeback semantics.',
127
+
'Persist a task memory only when it can become a high-quality ChatCrystal note: specific title, concrete summary, meaningful key conclusions, and a durable reusable lesson such as a pitfall, fix, decision, pattern, or symptom-to-resolution mapping. Do not write one-time environment checks, version/status reports, ordinary progress logs, or vague robustness claims. Weak auto writebacks are skipped by core validation and recorded only as receipts.',
0 commit comments