@totalreclaw/mcp-server 3.5.2-rc.1 → 3.5.3-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/README.md +31 -24
  2. package/SKILL.md +1 -1
  3. package/dist/dispatch.d.ts.map +1 -1
  4. package/dist/dispatch.js +9 -10
  5. package/dist/dispatch.js.map +1 -1
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +38 -26
  8. package/dist/index.js.map +1 -1
  9. package/dist/prompts.d.ts +8 -8
  10. package/dist/prompts.d.ts.map +1 -1
  11. package/dist/prompts.js +21 -20
  12. package/dist/prompts.js.map +1 -1
  13. package/dist/server-setup.d.ts +2 -0
  14. package/dist/server-setup.d.ts.map +1 -1
  15. package/dist/server-setup.js +14 -1
  16. package/dist/server-setup.js.map +1 -1
  17. package/dist/subgraph/search.d.ts +14 -0
  18. package/dist/subgraph/search.d.ts.map +1 -1
  19. package/dist/subgraph/search.js +48 -0
  20. package/dist/subgraph/search.js.map +1 -1
  21. package/dist/tools/debrief.d.ts +51 -62
  22. package/dist/tools/debrief.d.ts.map +1 -1
  23. package/dist/tools/debrief.js +32 -39
  24. package/dist/tools/debrief.js.map +1 -1
  25. package/dist/tools/forget.d.ts +23 -0
  26. package/dist/tools/forget.d.ts.map +1 -1
  27. package/dist/tools/forget.js +48 -0
  28. package/dist/tools/forget.js.map +1 -1
  29. package/dist/tools/import-batch.d.ts.map +1 -1
  30. package/dist/tools/import-batch.js +2 -3
  31. package/dist/tools/import-batch.js.map +1 -1
  32. package/dist/tools/pair.js +1 -1
  33. package/dist/tools/pair.js.map +1 -1
  34. package/dist/tools/pin.d.ts.map +1 -1
  35. package/dist/tools/pin.js +4 -1
  36. package/dist/tools/pin.js.map +1 -1
  37. package/dist/tools/recall.d.ts +2 -0
  38. package/dist/tools/recall.d.ts.map +1 -1
  39. package/dist/tools/recall.js +1 -0
  40. package/dist/tools/recall.js.map +1 -1
  41. package/dist/tools/retype.d.ts.map +1 -1
  42. package/dist/tools/retype.js +4 -1
  43. package/dist/tools/retype.js.map +1 -1
  44. package/dist/tools/set-scope.d.ts.map +1 -1
  45. package/dist/tools/set-scope.js +6 -8
  46. package/dist/tools/set-scope.js.map +1 -1
  47. package/dist/tools/status.d.ts.map +1 -1
  48. package/dist/tools/status.js +4 -1
  49. package/dist/tools/status.js.map +1 -1
  50. package/dist/tools/write-errors.d.ts +34 -0
  51. package/dist/tools/write-errors.d.ts.map +1 -0
  52. package/dist/tools/write-errors.js +98 -0
  53. package/dist/tools/write-errors.js.map +1 -0
  54. package/package.json +1 -1
package/README.md CHANGED
@@ -30,19 +30,7 @@ End-to-end encrypted memory vault as an MCP server. Your memories are encrypted
30
30
 
31
31
  ## Quick Start
32
32
 
33
- ### 1. Run the setup wizard
34
-
35
- ```bash
36
- npx @totalreclaw/mcp-server setup
37
- ```
38
-
39
- The wizard generates your 12-word recovery phrase, registers you, and prints a config snippet for your MCP client.
40
-
41
- > **Save your recovery phrase somewhere safe.** It's the only way to recover your encrypted memories.
42
-
43
- > **Note:** The first run downloads a ~600MB embedding model for local inference. This is cached locally and only happens once.
44
-
45
- ### 2. Add to your MCP client
33
+ ### 1. Add the server to your MCP client
46
34
 
47
35
  #### Claude Desktop
48
36
 
@@ -53,10 +41,7 @@ Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS)
53
41
  "mcpServers": {
54
42
  "totalreclaw": {
55
43
  "command": "npx",
56
- "args": ["-y", "@totalreclaw/mcp-server"],
57
- "env": {
58
- "TOTALRECLAW_RECOVERY_PHRASE": "your twelve word recovery phrase goes here"
59
- }
44
+ "args": ["-y", "@totalreclaw/mcp-server"]
60
45
  }
61
46
  }
62
47
  }
@@ -64,6 +49,8 @@ Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS)
64
49
 
65
50
  > **Note:** The server URL defaults to `https://api.totalreclaw.xyz` (the managed service). You only need to set `TOTALRECLAW_SERVER_URL` if you are running a self-hosted server.
66
51
 
52
+ > **Note:** The first run downloads a ~600MB embedding model for local inference. This is cached locally and only happens once.
53
+
67
54
  #### Cursor / Windsurf
68
55
 
69
56
  Add to your MCP settings (Settings > MCP Servers):
@@ -72,10 +59,7 @@ Add to your MCP settings (Settings > MCP Servers):
72
59
  {
73
60
  "totalreclaw": {
74
61
  "command": "npx",
75
- "args": ["-y", "@totalreclaw/mcp-server"],
76
- "env": {
77
- "TOTALRECLAW_RECOVERY_PHRASE": "your twelve word recovery phrase goes here"
78
- }
62
+ "args": ["-y", "@totalreclaw/mcp-server"]
79
63
  }
80
64
  }
81
65
  ```
@@ -89,7 +73,30 @@ Add to your IronClaw MCP configuration (typically `~/.ironclaw/mcp.json` or via
89
73
  "mcpServers": {
90
74
  "totalreclaw": {
91
75
  "command": "npx",
92
- "args": ["@totalreclaw/mcp-server"],
76
+ "args": ["@totalreclaw/mcp-server"]
77
+ }
78
+ }
79
+ }
80
+ ```
81
+
82
+ See the [IronClaw setup guide](../docs/guides/ironclaw-setup.md) for the full walkthrough including background routines.
83
+
84
+ ### 2. Set up your account with `totalreclaw_pair`
85
+
86
+ Restart your app, then ask your agent: *"Set up TotalReclaw."* The agent calls `totalreclaw_pair`, which returns a link and a 6-digit PIN. Open the link in a browser and enter the PIN. The page creates a new 12-word recovery phrase (or lets you enter an existing one); the phrase is encrypted in the browser and never passes through the chat. When the page says "You're all set", fully quit and reopen the app (or start a new session): credentials are read at startup.
87
+
88
+ > **Save your recovery phrase somewhere safe.** It's the only way to recover your encrypted memories.
89
+
90
+ ### Legacy: manual setup (discouraged)
91
+
92
+ Older setups put the recovery phrase in the MCP host config as `TOTALRECLAW_RECOVERY_PHRASE`, or generate it with `npx @totalreclaw/mcp-server setup` (run it yourself in a terminal, never through an agent). Both still work, and self-hosted setups may still need them, but an env var stores the phrase **in plain text in a config file**, so prefer pairing. Example:
93
+
94
+ ```json
95
+ {
96
+ "mcpServers": {
97
+ "totalreclaw": {
98
+ "command": "npx",
99
+ "args": ["-y", "@totalreclaw/mcp-server"],
93
100
  "env": {
94
101
  "TOTALRECLAW_RECOVERY_PHRASE": "your twelve word recovery phrase goes here"
95
102
  }
@@ -98,7 +105,7 @@ Add to your IronClaw MCP configuration (typically `~/.ironclaw/mcp.json` or via
98
105
  }
99
106
  ```
100
107
 
101
- If IronClaw supports a credential vault, store `TOTALRECLAW_RECOVERY_PHRASE` there instead of in the config file. See the [IronClaw setup guide](../docs/guides/ironclaw-setup.md) for the full walkthrough including background routines.
108
+ If your agent supports a credential vault, store `TOTALRECLAW_RECOVERY_PHRASE` there instead of in the config file.
102
109
 
103
110
  ### 3. Verify
104
111
 
@@ -243,7 +250,7 @@ keeps a stale-install downgrade loud rather than a crash.
243
250
  ## Free Tier & Pricing
244
251
 
245
252
  - **Free tier** — 250 memories/month on Gnosis mainnet. Permanent storage. Cosine dedup (paraphrase detection). E2E encrypted. No credit card required.
246
- - **Pro tier** — 1,500 memories/month on Gnosis mainnet. Permanent. LLM-guided dedup (catches contradictions). Custom extraction interval. Pay via the `totalreclaw_upgrade` tool or visit <https://totalreclaw.xyz/pricing>.
253
+ - **Pro tier** — 3,000 memories/month on Gnosis mainnet. Permanent. LLM-guided dedup (catches contradictions). Custom extraction interval. Pay via the `totalreclaw_upgrade` tool or visit <https://totalreclaw.xyz/pricing>.
247
254
 
248
255
  Pay with card via Stripe. Use `totalreclaw_status` to check current pricing. Counter resets monthly.
249
256
 
package/SKILL.md CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: totalreclaw
3
3
  description: "End-to-end encrypted, decentralized memory for OpenClaw via the totalreclaw MCP server. Set up an account once, then call totalreclaw__totalreclaw_remember and totalreclaw__totalreclaw_recall instead of writing to MEMORY.md / USER.md / local files. Trigger on 'install TotalReclaw', 'set up TotalReclaw', 'restore my recovery phrase', or any user statement that contains a preference / fact / decision / commitment about themselves."
4
- version: 3.5.2
4
+ version: 3.5.3
5
5
  author: TotalReclaw Team
6
6
  license: MIT
7
7
  homepage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FAAgF;AAChF,wBAAgB,oBAAoB,IAAI,YAAY,CAenD;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,kBAAkB,GAAG,iBAAiB,CAAC;IAC/C,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,sEAAsE;AACtE,wBAAgB,qBAAqB,CAAC,QAAQ,CAAC,EAAE,mBAAmB,GAAG,YAAY,CA8BlF;AAED,mEAAmE;AACnE,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAK9D;AAED,6EAA6E;AAC7E,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY,CAQjE;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,YAAY,GACjB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,YAAY,CAAC,CA+CxD"}
package/dist/dispatch.js CHANGED
@@ -30,6 +30,7 @@ exports.notConfiguredResponse = notConfiguredResponse;
30
30
  exports.unknownToolResponse = unknownToolResponse;
31
31
  exports.genericErrorResponse = genericErrorResponse;
32
32
  exports.createCallToolHandler = createCallToolHandler;
33
+ const write_errors_js_1 = require("./tools/write-errors.js");
33
34
  const index_js_1 = require("./tools/index.js");
34
35
  const pin_js_1 = require("./tools/pin.js");
35
36
  const retype_js_1 = require("./tools/retype.js");
@@ -87,11 +88,9 @@ function setupRemovedResponse() {
87
88
  text: JSON.stringify({
88
89
  error: 'tool_removed',
89
90
  message: 'The totalreclaw_setup tool was removed in @totalreclaw/mcp-server@3.2.1 ' +
90
- 'for phrase-safety. Follow the URL-driven install flow at ' +
91
- 'https://github.com/graphprotocol/totalreclaw/blob/main/docs/guides/claude-code-setup.md. ' +
92
- 'The user sources their recovery phrase out-of-band (OpenClaw or Hermes ' +
93
- 'browser pair flow, or an offline BIP-39 generator) and pastes it directly ' +
94
- 'into TOTALRECLAW_RECOVERY_PHRASE in the MCP host config — never into chat.',
91
+ 'for phrase-safety. To set up an account, call totalreclaw_pair: it returns a link and a ' +
92
+ 'PIN, and the user creates or enters their recovery phrase in the browser only — ' +
93
+ 'never in chat.',
95
94
  }),
96
95
  }],
97
96
  isError: true,
@@ -118,10 +117,10 @@ function notConfiguredResponse(unusable) {
118
117
  type: 'text',
119
118
  text: JSON.stringify({
120
119
  error: 'not_configured',
121
- message: 'TotalReclaw is not configured yet. Follow the URL-driven install flow ' +
122
- 'at https://github.com/graphprotocol/totalreclaw/blob/main/docs/guides/claude-code-setup.md — ' +
123
- 'the user pastes their recovery phrase directly into the MCP host config (TOTALRECLAW_RECOVERY_PHRASE), ' +
124
- 'never into chat.',
120
+ message: 'TotalReclaw is not set up yet. Call totalreclaw_pair now: it returns a link and a PIN. ' +
121
+ 'Give both to the user; they open the link in a browser and create or enter their recovery ' +
122
+ 'phrase there, never in chat. When the page says it is done, ask them to fully quit and ' +
123
+ 'reopen this app (or start a new session), because credentials load at startup.',
125
124
  }),
126
125
  }],
127
126
  isError: true,
@@ -139,7 +138,7 @@ function genericErrorResponse(error) {
139
138
  return {
140
139
  content: [{
141
140
  type: 'text',
142
- text: JSON.stringify({ error: error instanceof Error ? error.message : 'Unknown error' }),
141
+ text: JSON.stringify({ error: (0, write_errors_js_1.shortErrorMessage)(error) }),
143
142
  }],
144
143
  isError: true,
145
144
  };
@@ -1 +1 @@
1
- {"version":3,"file":"dispatch.js","sourceRoot":"","sources":["../src/dispatch.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;;;AAiIH,oDAiBC;AAaD,sDA8BC;AAGD,kDAKC;AAGD,oDAQC;AAMD,sDAiDC;AAnQD,+CAe0B;AAC1B,2CAAwE;AACxE,iDAAyD;AACzD,uDAA8D;AAI9D;;;;GAIG;AACU,QAAA,aAAa,GAAG;IAC3B,iCAAsB;IACtB,+BAAoB;IACpB,+BAAoB;IACpB,+BAAoB;IACpB,+BAAoB;IACpB,mCAAwB;IACxB,oCA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YAEjF,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;gBACtB,IAAI,CAAC;oBACH,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;oBACnC,IAAI,MAAM,CAAC,eAAe;wBAAE,IAAI,CAAC,QAAQ,EAAE,CAAC;oBAC5C,OAAO,MAAM,CAAC;gBAChB,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,IAAI,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC;wBAAE,OAAO,IAAI,CAAC,qBAAqB,EAAE,CAAC;oBAC1E,MAAM,KAAK,CAAC;gBACd,CAAC;YACH,CAAC;YAED,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;YACnC,IAAI,MAAM,CAAC,eAAe;gBAAE,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC5C,OAAO,MAAM,CAAC;QAChB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC;gBAAE,OAAO,IAAI,CAAC,qBAAqB,EAAE,CAAC;YAC1E,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;gBAAE,OAAO,IAAI,CAAC,gBAAgB,EAAE,CAAC;YAC5D,OAAO,oBAAoB,CAAC,KAAK,CAAC,CAAC;QACrC,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAwLA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AA2LA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,CAAC"}
package/dist/index.js CHANGED
@@ -42,6 +42,9 @@ const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
42
42
  const client_1 = require("@totalreclaw/client");
43
43
  const index_js_1 = require("./tools/index.js");
44
44
  const status_js_1 = require("./tools/status.js");
45
+ const write_errors_js_1 = require("./tools/write-errors.js");
46
+ const helpers_js_1 = require("./tools/helpers.js");
47
+ const forget_js_1 = require("./tools/forget.js");
45
48
  const consolidation_js_1 = require("./consolidation.js");
46
49
  const index_js_2 = require("./resources/index.js");
47
50
  const server_setup_js_1 = require("./server-setup.js");
@@ -934,12 +937,13 @@ async function handleRememberSubgraph(state, args) {
934
937
  console.error(`Batch submitted ${batchResult.batchSize} payloads in 1 UserOp (tx=${batchResult.txHash.slice(0, 10)}...)`);
935
938
  }
936
939
  catch (error) {
937
- const message = error instanceof Error ? error.message : 'Unknown error';
940
+ (0, write_errors_js_1.rethrowIfQuota)(error);
941
+ const message = (0, write_errors_js_1.shortErrorMessage)(error);
938
942
  batchError = message;
939
943
  for (const meta of pendingFactMeta) {
940
944
  results.push({ success: false, fact_id: meta.factId, tx_hash: undefined, error: message });
941
945
  }
942
- console.error(`Batch submission failed: ${message}`);
946
+ (0, write_errors_js_1.logWriteError)('Batch submission failed', error);
943
947
  }
944
948
  }
945
949
  const created = results.filter(r => r.success && r.action !== 'skipped_dedup').length;
@@ -1030,8 +1034,10 @@ async function handleDebriefSubgraph(state, args) {
1030
1034
  };
1031
1035
  }
1032
1036
  catch (error) {
1033
- console.error(`Crystal debrief failed: ${error instanceof Error ? error.message : String(error)}`);
1034
- return { content: [{ type: 'text', text: JSON.stringify({ success: false, error: String(error) }) }] };
1037
+ (0, write_errors_js_1.rethrowIfQuota)(error);
1038
+ const message = (0, write_errors_js_1.shortErrorMessage)(error);
1039
+ (0, write_errors_js_1.logWriteError)('Crystal debrief failed', error);
1040
+ return { content: [{ type: 'text', text: JSON.stringify({ success: false, error: message }) }] };
1035
1041
  }
1036
1042
  }
1037
1043
  // ── Legacy facts array path (backward compat) ────────────────────────────
@@ -1099,11 +1105,12 @@ async function handleDebriefSubgraph(state, args) {
1099
1105
  console.error(`Debrief: submitted ${batchResult.batchSize} items (tx=${batchResult.txHash.slice(0, 10)}...)`);
1100
1106
  }
1101
1107
  catch (error) {
1102
- batchError = error instanceof Error ? error.message : String(error);
1108
+ (0, write_errors_js_1.rethrowIfQuota)(error);
1109
+ batchError = (0, write_errors_js_1.shortErrorMessage)(error);
1103
1110
  for (const meta of pendingFactMeta) {
1104
1111
  results.push({ success: false, fact_id: meta.factId, error: batchError });
1105
1112
  }
1106
- console.error(`Debrief batch submission failed: ${batchError}`);
1113
+ (0, write_errors_js_1.logWriteError)('Debrief batch submission failed', error);
1107
1114
  }
1108
1115
  }
1109
1116
  const stored = results.filter((r) => r.success).length;
@@ -1244,6 +1251,7 @@ async function handleRecallSubgraph(state, args) {
1244
1251
  const subgraphCore = require('@totalreclaw/core');
1245
1252
  const memories = reranked.map((r) => ({
1246
1253
  fact_id: r.id,
1254
+ memory_id: r.id,
1247
1255
  fact_text: r.text,
1248
1256
  type: categoryMap.get(r.id) ?? 'fact',
1249
1257
  source: sourceMap.get(r.id),
@@ -1297,20 +1305,32 @@ async function handleRecallSubgraph(state, args) {
1297
1305
  */
1298
1306
  async function handleForgetSubgraph(state, args) {
1299
1307
  const input = args;
1300
- const factId = input?.fact_id;
1301
- if (!factId || typeof factId !== 'string') {
1308
+ const factId = (0, helpers_js_1.pickMemoryId)(input);
1309
+ if (!factId) {
1302
1310
  return {
1303
1311
  content: [{
1304
1312
  type: 'text',
1305
1313
  text: JSON.stringify({
1306
1314
  deleted_count: 0,
1307
1315
  fact_ids: [],
1308
- error: 'fact_id is required for forget (query-based forget is not supported with the managed service)',
1316
+ error: 'memory_id (or its alias fact_id, from a recall result) is required for forget; query-based forget is not supported with the managed service',
1309
1317
  }),
1310
1318
  }],
1311
1319
  };
1312
1320
  }
1313
1321
  try {
1322
+ // Existence check first: never tombstone (or report deleted_count: 1 for)
1323
+ // an id that isn't an active fact of this owner.
1324
+ let lookup;
1325
+ try {
1326
+ lookup = await (0, forget_js_1.classifyForgetTarget)(() => (0, search_js_1.fetchFactForForget)(state.smartAccountAddress, factId, state.serverUrl, Buffer.from(state.authKey).toString('hex')));
1327
+ }
1328
+ catch (lookupErr) {
1329
+ (0, write_errors_js_1.logWriteError)('Forget existence check failed', lookupErr);
1330
+ return (0, forget_js_1.forgetLookupFailedResponse)();
1331
+ }
1332
+ if (lookup !== 'exists')
1333
+ return (0, forget_js_1.forgetNotFoundResponse)(factId, lookup);
1314
1334
  // Build a tombstone payload: same fact ID with isActive=false
1315
1335
  // The protobuf encoder always sets isActive=true, so we build a minimal
1316
1336
  // tombstone payload manually. For now, we re-encode the fact with
@@ -1362,7 +1382,9 @@ async function handleForgetSubgraph(state, args) {
1362
1382
  };
1363
1383
  }
1364
1384
  catch (error) {
1365
- const message = error instanceof Error ? error.message : 'Unknown error';
1385
+ (0, write_errors_js_1.rethrowIfQuota)(error);
1386
+ (0, write_errors_js_1.logWriteError)('Forget failed', error);
1387
+ const message = (0, write_errors_js_1.shortErrorMessage)(error);
1366
1388
  return {
1367
1389
  content: [{
1368
1390
  type: 'text',
@@ -1469,23 +1491,13 @@ function isAuthError(error) {
1469
1491
  return false;
1470
1492
  }
1471
1493
  // ── Quota error helper ──────────────────────────────────────────────────────
1472
- /**
1473
- * Check if an error is a quota exceeded error (HTTP 403 with error_code: QUOTA_EXCEEDED).
1474
- */
1475
- function isQuotaExceededError(error) {
1476
- if (error instanceof Error) {
1477
- const msg = error.message.toLowerCase();
1478
- return msg.includes('quota_exceeded') || msg.includes('quota exceeded');
1479
- }
1480
- return false;
1481
- }
1482
1494
  function quotaExceededResponse() {
1483
1495
  return {
1484
1496
  content: [{
1485
1497
  type: 'text',
1486
1498
  text: JSON.stringify({
1487
1499
  error: 'quota_exceeded',
1488
- message: 'Free tier monthly limit reached (250 memories). Upgrade to Pro for 1,500 memories/month on Gnosis mainnet.',
1500
+ message: 'You have reached your monthly memory limit. The counter resets on the 1st of the month. Upgrade to Pro for a higher monthly limit (Free is 250 writes a month, Pro is 3,000).',
1489
1501
  upgrade_url: 'Use totalreclaw_upgrade tool to get a checkout link',
1490
1502
  }),
1491
1503
  }],
@@ -1588,9 +1600,8 @@ const commonHandlers = {
1588
1600
  };
1589
1601
  // ── Managed-service (subgraph) tool bundle ───────────────────────────────────
1590
1602
  // Tools with no managed-service equivalent return an explicit "use self-hosted
1591
- // mode" envelope; `totalreclaw_import_batch` is intentionally absent so it
1592
- // falls through to the standard unknown-tool error, matching pre-refactor
1593
- // behaviour.
1603
+ // mode" envelope (including `totalreclaw_import_batch`, so every listed tool
1604
+ // is callable and tells the host plainly why it refuses).
1594
1605
  function unsupportedInSubgraph(message) {
1595
1606
  return { content: [{ type: 'text', text: JSON.stringify({ error: message }) }], isError: true };
1596
1607
  }
@@ -1607,6 +1618,7 @@ function subgraphBundle(state) {
1607
1618
  totalreclaw_export: async () => unsupportedInSubgraph('Export is not yet supported with the managed service. Use self-hosted mode for export.'),
1608
1619
  totalreclaw_import: async () => unsupportedInSubgraph('Import is not yet supported with the managed service. Use self-hosted mode for import.'),
1609
1620
  totalreclaw_import_from: async () => unsupportedInSubgraph('Import from external sources is not yet supported with the managed service. Use self-hosted mode for import.'),
1621
+ totalreclaw_import_batch: async () => unsupportedInSubgraph('Batch import is not yet supported with the managed service. Use self-hosted mode for import.'),
1610
1622
  totalreclaw_consolidate: async () => unsupportedInSubgraph('Consolidation is not supported with the managed service. On-chain facts require tombstone-based dedup which is handled automatically at store time.'),
1611
1623
  };
1612
1624
  }
@@ -1645,7 +1657,7 @@ const callToolHandler = (0, dispatch_js_1.createCallToolHandler)({
1645
1657
  }),
1646
1658
  common: commonHandlers,
1647
1659
  resolveBundle,
1648
- isQuotaExceededError,
1660
+ isQuotaExceededError: write_errors_js_1.isQuotaExceededError,
1649
1661
  quotaExceededResponse,
1650
1662
  isAuthError,
1651
1663
  authHintResponse,
@@ -1716,7 +1728,7 @@ async function main() {
1716
1728
  'self-hosted mode with its own master password / credentials.');
1717
1729
  }
1718
1730
  else {
1719
- console.error('TotalReclaw MCP server started (unconfigured — set TOTALRECLAW_RECOVERY_PHRASE in the MCP host config; see docs/guides/claude-code-setup.md)');
1731
+ console.error('TotalReclaw MCP server started (unconfigured — ask the assistant to run totalreclaw_pair to set up an account)');
1720
1732
  }
1721
1733
  }
1722
1734
  else {