@intangle/mcp-server 1.0.7 → 1.0.9
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/dist/index.js +237 -131
- package/index.ts +248 -139
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -22,7 +22,7 @@ if (!MCP_API_KEY) {
|
|
|
22
22
|
console.log("Intangle MCP Server starting - connecting to", API_BASE_URL);
|
|
23
23
|
// Version checking
|
|
24
24
|
// IMPORTANT: Update BOTH package.json version AND this constant when bumping version
|
|
25
|
-
const CURRENT_VERSION = "1.0.
|
|
25
|
+
const CURRENT_VERSION = "1.0.8";
|
|
26
26
|
let latestVersion = null;
|
|
27
27
|
let versionCheckDone = false;
|
|
28
28
|
async function checkVersion() {
|
|
@@ -75,45 +75,73 @@ const server = new Server({
|
|
|
75
75
|
const TOOLS = [
|
|
76
76
|
{
|
|
77
77
|
name: "add_memory",
|
|
78
|
-
description: "Store
|
|
78
|
+
description: "Store one or more memories in the user's memory graph with flexible topics. Accepts a single memory object or an array of memory objects for batch creation. REQUIRES space_id parameter.",
|
|
79
79
|
inputSchema: {
|
|
80
80
|
type: "object",
|
|
81
81
|
properties: {
|
|
82
82
|
space_id: {
|
|
83
83
|
type: "string",
|
|
84
|
-
description: "REQUIRED: Space to store memory in (use list_spaces to see available options)",
|
|
85
|
-
},
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
84
|
+
description: "REQUIRED: Space to store memory/memories in (use list_spaces to see available options)",
|
|
85
|
+
},
|
|
86
|
+
memories: {
|
|
87
|
+
oneOf: [
|
|
88
|
+
{
|
|
89
|
+
type: "object",
|
|
90
|
+
properties: {
|
|
91
|
+
title: {
|
|
92
|
+
type: "string",
|
|
93
|
+
description: "Title/summary of the memory",
|
|
94
|
+
},
|
|
95
|
+
content: {
|
|
96
|
+
type: "string",
|
|
97
|
+
description: "Detailed content of the memory",
|
|
98
|
+
},
|
|
99
|
+
topics: {
|
|
100
|
+
type: "array",
|
|
101
|
+
items: { type: "string" },
|
|
102
|
+
description: "Flexible topics/tags for organization (e.g., ['coding', 'react'])",
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
required: ["title", "content"],
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
type: "array",
|
|
109
|
+
items: {
|
|
110
|
+
type: "object",
|
|
111
|
+
properties: {
|
|
112
|
+
title: {
|
|
113
|
+
type: "string",
|
|
114
|
+
description: "Title/summary of the memory",
|
|
115
|
+
},
|
|
116
|
+
content: {
|
|
117
|
+
type: "string",
|
|
118
|
+
description: "Detailed content of the memory",
|
|
119
|
+
},
|
|
120
|
+
topics: {
|
|
121
|
+
type: "array",
|
|
122
|
+
items: { type: "string" },
|
|
123
|
+
description: "Flexible topics/tags for organization (e.g., ['coding', 'react'])",
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
required: ["title", "content"],
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
],
|
|
130
|
+
description: "Single memory object or array of memory objects to create",
|
|
98
131
|
},
|
|
99
132
|
},
|
|
100
|
-
required: ["space_id", "
|
|
133
|
+
required: ["space_id", "memories"],
|
|
101
134
|
},
|
|
102
135
|
},
|
|
103
136
|
{
|
|
104
137
|
name: "search_memories",
|
|
105
|
-
description: "Search through stored memories using advanced hybrid search (semantic + text + entity relationships). ALWAYS provide
|
|
138
|
+
description: "Search through stored memories using advanced hybrid search (semantic + text + entity relationships). ALWAYS provide space_id parameter - this is mandatory for all searches.",
|
|
106
139
|
inputSchema: {
|
|
107
140
|
type: "object",
|
|
108
141
|
properties: {
|
|
109
142
|
space_id: {
|
|
110
143
|
type: "string",
|
|
111
|
-
description: "REQUIRED
|
|
112
|
-
},
|
|
113
|
-
space_ids: {
|
|
114
|
-
type: "array",
|
|
115
|
-
items: { type: "string" },
|
|
116
|
-
description: "REQUIRED (or use space_id): Multiple spaces to search across",
|
|
144
|
+
description: "REQUIRED: Space to search in (use list_spaces to see available options)",
|
|
117
145
|
},
|
|
118
146
|
query: {
|
|
119
147
|
type: "string",
|
|
@@ -172,28 +200,23 @@ const TOOLS = [
|
|
|
172
200
|
},
|
|
173
201
|
{
|
|
174
202
|
name: "delete_memory",
|
|
175
|
-
description: "Delete a
|
|
176
|
-
inputSchema: {
|
|
177
|
-
type: "object",
|
|
178
|
-
properties: {
|
|
179
|
-
memory_id: {
|
|
180
|
-
type: "string",
|
|
181
|
-
description: "ID of the memory to delete",
|
|
182
|
-
},
|
|
183
|
-
},
|
|
184
|
-
required: ["memory_id"],
|
|
185
|
-
},
|
|
186
|
-
},
|
|
187
|
-
{
|
|
188
|
-
name: "batch_delete_memories",
|
|
189
|
-
description: "Delete multiple memories in a single transaction. All-or-nothing operation.",
|
|
203
|
+
description: "Delete one or more memories in a single transaction. Accepts a single memory ID or an array of memory IDs for batch deletion.",
|
|
190
204
|
inputSchema: {
|
|
191
205
|
type: "object",
|
|
192
206
|
properties: {
|
|
193
207
|
memory_ids: {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
208
|
+
oneOf: [
|
|
209
|
+
{
|
|
210
|
+
type: "string",
|
|
211
|
+
description: "Single memory ID to delete",
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
type: "array",
|
|
215
|
+
items: { type: "string" },
|
|
216
|
+
description: "Array of memory IDs to delete",
|
|
217
|
+
},
|
|
218
|
+
],
|
|
219
|
+
description: "Single memory ID or array of memory IDs to delete",
|
|
197
220
|
},
|
|
198
221
|
},
|
|
199
222
|
required: ["memory_ids"],
|
|
@@ -276,39 +299,82 @@ const TOOLS = [
|
|
|
276
299
|
},
|
|
277
300
|
{
|
|
278
301
|
name: "add_task",
|
|
279
|
-
description: "Create
|
|
302
|
+
description: "Create one or more tasks in your space with status tracking. Accepts a single task object or an array of task objects for batch creation. Tasks have graph relationships like memories (entities, topics, temporal). REQUIRES space_id parameter.",
|
|
280
303
|
inputSchema: {
|
|
281
304
|
type: "object",
|
|
282
305
|
properties: {
|
|
283
306
|
space_id: {
|
|
284
307
|
type: "string",
|
|
285
|
-
description: "REQUIRED: Space to create task in (use list_spaces to see available options)",
|
|
286
|
-
},
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
308
|
+
description: "REQUIRED: Space to create task/tasks in (use list_spaces to see available options)",
|
|
309
|
+
},
|
|
310
|
+
tasks: {
|
|
311
|
+
oneOf: [
|
|
312
|
+
{
|
|
313
|
+
type: "object",
|
|
314
|
+
properties: {
|
|
315
|
+
title: {
|
|
316
|
+
type: "string",
|
|
317
|
+
description: "Task title/summary",
|
|
318
|
+
},
|
|
319
|
+
content: {
|
|
320
|
+
type: "string",
|
|
321
|
+
description: "Detailed task description",
|
|
322
|
+
},
|
|
323
|
+
topics: {
|
|
324
|
+
type: "array",
|
|
325
|
+
items: { type: "string" },
|
|
326
|
+
description: "Optional topics/tags for organization",
|
|
327
|
+
},
|
|
328
|
+
status: {
|
|
329
|
+
type: "string",
|
|
330
|
+
enum: ["pending", "in_progress", "completed", "invalidated"],
|
|
331
|
+
description: "Task status (default: pending)",
|
|
332
|
+
default: "pending",
|
|
333
|
+
},
|
|
334
|
+
parent_id: {
|
|
335
|
+
type: "string",
|
|
336
|
+
description: "Optional parent task ID to create this as a subtask",
|
|
337
|
+
},
|
|
338
|
+
},
|
|
339
|
+
required: ["title", "content"],
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
type: "array",
|
|
343
|
+
items: {
|
|
344
|
+
type: "object",
|
|
345
|
+
properties: {
|
|
346
|
+
title: {
|
|
347
|
+
type: "string",
|
|
348
|
+
description: "Task title/summary",
|
|
349
|
+
},
|
|
350
|
+
content: {
|
|
351
|
+
type: "string",
|
|
352
|
+
description: "Detailed task description",
|
|
353
|
+
},
|
|
354
|
+
topics: {
|
|
355
|
+
type: "array",
|
|
356
|
+
items: { type: "string" },
|
|
357
|
+
description: "Optional topics/tags for organization",
|
|
358
|
+
},
|
|
359
|
+
status: {
|
|
360
|
+
type: "string",
|
|
361
|
+
enum: ["pending", "in_progress", "completed", "invalidated"],
|
|
362
|
+
description: "Task status (default: pending)",
|
|
363
|
+
default: "pending",
|
|
364
|
+
},
|
|
365
|
+
parent_id: {
|
|
366
|
+
type: "string",
|
|
367
|
+
description: "Optional parent task ID to create this as a subtask",
|
|
368
|
+
},
|
|
369
|
+
},
|
|
370
|
+
required: ["title", "content"],
|
|
371
|
+
},
|
|
372
|
+
},
|
|
373
|
+
],
|
|
374
|
+
description: "Single task object or array of task objects to create",
|
|
309
375
|
},
|
|
310
376
|
},
|
|
311
|
-
required: ["space_id", "
|
|
377
|
+
required: ["space_id", "tasks"],
|
|
312
378
|
},
|
|
313
379
|
},
|
|
314
380
|
{
|
|
@@ -332,29 +398,66 @@ const TOOLS = [
|
|
|
332
398
|
},
|
|
333
399
|
{
|
|
334
400
|
name: "update_task",
|
|
335
|
-
description: "Update
|
|
401
|
+
description: "Update one or more tasks. Accepts a single update object or an array of update objects for batch updates. Each update must include task_id.",
|
|
336
402
|
inputSchema: {
|
|
337
403
|
type: "object",
|
|
338
404
|
properties: {
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
405
|
+
updates: {
|
|
406
|
+
oneOf: [
|
|
407
|
+
{
|
|
408
|
+
type: "object",
|
|
409
|
+
properties: {
|
|
410
|
+
task_id: {
|
|
411
|
+
type: "string",
|
|
412
|
+
description: "Task ID to update",
|
|
413
|
+
},
|
|
414
|
+
title: {
|
|
415
|
+
type: "string",
|
|
416
|
+
description: "New title (optional)",
|
|
417
|
+
},
|
|
418
|
+
content: {
|
|
419
|
+
type: "string",
|
|
420
|
+
description: "New content (optional)",
|
|
421
|
+
},
|
|
422
|
+
topics: {
|
|
423
|
+
type: "array",
|
|
424
|
+
items: { type: "string" },
|
|
425
|
+
description: "New topics array (optional)",
|
|
426
|
+
},
|
|
427
|
+
},
|
|
428
|
+
required: ["task_id"],
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
type: "array",
|
|
432
|
+
items: {
|
|
433
|
+
type: "object",
|
|
434
|
+
properties: {
|
|
435
|
+
task_id: {
|
|
436
|
+
type: "string",
|
|
437
|
+
description: "Task ID to update",
|
|
438
|
+
},
|
|
439
|
+
title: {
|
|
440
|
+
type: "string",
|
|
441
|
+
description: "New title (optional)",
|
|
442
|
+
},
|
|
443
|
+
content: {
|
|
444
|
+
type: "string",
|
|
445
|
+
description: "New content (optional)",
|
|
446
|
+
},
|
|
447
|
+
topics: {
|
|
448
|
+
type: "array",
|
|
449
|
+
items: { type: "string" },
|
|
450
|
+
description: "New topics array (optional)",
|
|
451
|
+
},
|
|
452
|
+
},
|
|
453
|
+
required: ["task_id"],
|
|
454
|
+
},
|
|
455
|
+
},
|
|
456
|
+
],
|
|
457
|
+
description: "Single update object or array of update objects",
|
|
355
458
|
},
|
|
356
459
|
},
|
|
357
|
-
required: ["
|
|
460
|
+
required: ["updates"],
|
|
358
461
|
},
|
|
359
462
|
},
|
|
360
463
|
{
|
|
@@ -388,28 +491,23 @@ const TOOLS = [
|
|
|
388
491
|
},
|
|
389
492
|
{
|
|
390
493
|
name: "delete_task",
|
|
391
|
-
description: "Delete a task
|
|
392
|
-
inputSchema: {
|
|
393
|
-
type: "object",
|
|
394
|
-
properties: {
|
|
395
|
-
task_id: {
|
|
396
|
-
type: "string",
|
|
397
|
-
description: "ID of task to delete",
|
|
398
|
-
},
|
|
399
|
-
},
|
|
400
|
-
required: ["task_id"],
|
|
401
|
-
},
|
|
402
|
-
},
|
|
403
|
-
{
|
|
404
|
-
name: "batch_delete_tasks",
|
|
405
|
-
description: "Delete multiple tasks in a single transaction. All-or-nothing operation.",
|
|
494
|
+
description: "Delete one or more tasks in a single transaction. Accepts a single task ID or an array of task IDs for batch deletion.",
|
|
406
495
|
inputSchema: {
|
|
407
496
|
type: "object",
|
|
408
497
|
properties: {
|
|
409
498
|
task_ids: {
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
499
|
+
oneOf: [
|
|
500
|
+
{
|
|
501
|
+
type: "string",
|
|
502
|
+
description: "Single task ID to delete",
|
|
503
|
+
},
|
|
504
|
+
{
|
|
505
|
+
type: "array",
|
|
506
|
+
items: { type: "string" },
|
|
507
|
+
description: "Array of task IDs to delete",
|
|
508
|
+
},
|
|
509
|
+
],
|
|
510
|
+
description: "Single task ID or array of task IDs to delete",
|
|
413
511
|
},
|
|
414
512
|
},
|
|
415
513
|
required: ["task_ids"],
|
|
@@ -424,21 +522,24 @@ async function handleAddMemory(args) {
|
|
|
424
522
|
if (!args.space_id) {
|
|
425
523
|
throw new Error("space_id is required. Use list_spaces to see available options.");
|
|
426
524
|
}
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
return makeApiCall("add-memory",
|
|
525
|
+
if (!args.memories) {
|
|
526
|
+
throw new Error("memories parameter is required (single object or array)");
|
|
527
|
+
}
|
|
528
|
+
// Pass through to API
|
|
529
|
+
return makeApiCall("add-memory", {
|
|
530
|
+
space_id: args.space_id,
|
|
531
|
+
memories: args.memories,
|
|
532
|
+
});
|
|
432
533
|
}
|
|
433
534
|
async function handleSearchMemories(args) {
|
|
434
|
-
const { space_id,
|
|
435
|
-
// Require
|
|
436
|
-
if (!space_id
|
|
437
|
-
throw new Error("
|
|
535
|
+
const { space_id, query, topics, max_results = 10, } = args;
|
|
536
|
+
// Require space_id
|
|
537
|
+
if (!space_id) {
|
|
538
|
+
throw new Error("space_id is required. Use list_spaces to see available options.");
|
|
438
539
|
}
|
|
439
540
|
return makeApiCall("search-memories", {
|
|
440
541
|
space_id,
|
|
441
|
-
space_ids,
|
|
542
|
+
space_ids: [space_id], // Convert to array for backend compatibility
|
|
442
543
|
query,
|
|
443
544
|
topics,
|
|
444
545
|
max_results,
|
|
@@ -461,8 +562,8 @@ async function handleGetEntities(args) {
|
|
|
461
562
|
return makeApiCall("get-entities", { memory_id });
|
|
462
563
|
}
|
|
463
564
|
async function handleDeleteMemory(args) {
|
|
464
|
-
const {
|
|
465
|
-
return makeApiCall("delete-memory", {
|
|
565
|
+
const { memory_ids } = args;
|
|
566
|
+
return makeApiCall("delete-memory", { memory_ids });
|
|
466
567
|
}
|
|
467
568
|
async function handleDebugStructure() {
|
|
468
569
|
return makeApiCall("debug-structure", {});
|
|
@@ -482,25 +583,36 @@ async function handleStart(args) {
|
|
|
482
583
|
return makeApiCall("start", { space_id });
|
|
483
584
|
}
|
|
484
585
|
async function handleAddTask(args) {
|
|
485
|
-
|
|
586
|
+
if (!args.space_id) {
|
|
587
|
+
throw new Error("space_id is required. Use list_spaces to see available options.");
|
|
588
|
+
}
|
|
589
|
+
if (!args.tasks) {
|
|
590
|
+
throw new Error("tasks parameter is required (single object or array)");
|
|
591
|
+
}
|
|
592
|
+
// Pass through to API
|
|
593
|
+
return makeApiCall("add-task", {
|
|
594
|
+
space_id: args.space_id,
|
|
595
|
+
tasks: args.tasks,
|
|
596
|
+
});
|
|
486
597
|
}
|
|
487
598
|
async function handleUpdateTaskStatus(args) {
|
|
488
599
|
return makeApiCall("update-task-status", args);
|
|
489
600
|
}
|
|
490
601
|
async function handleUpdateTask(args) {
|
|
491
|
-
|
|
602
|
+
if (!args.updates) {
|
|
603
|
+
throw new Error("updates parameter is required (single object or array)");
|
|
604
|
+
}
|
|
605
|
+
// Pass through to API
|
|
606
|
+
return makeApiCall("update-task", {
|
|
607
|
+
updates: args.updates,
|
|
608
|
+
});
|
|
492
609
|
}
|
|
493
610
|
async function handleListTasks(args) {
|
|
494
611
|
return makeApiCall("list-tasks", args);
|
|
495
612
|
}
|
|
496
613
|
async function handleDeleteTask(args) {
|
|
497
|
-
|
|
498
|
-
}
|
|
499
|
-
async function handleBatchDeleteMemories(args) {
|
|
500
|
-
return makeApiCall("batch-delete-memories", args);
|
|
501
|
-
}
|
|
502
|
-
async function handleBatchDeleteTasks(args) {
|
|
503
|
-
return makeApiCall("batch-delete-tasks", args);
|
|
614
|
+
const { task_ids } = args;
|
|
615
|
+
return makeApiCall("delete-task", { task_ids });
|
|
504
616
|
}
|
|
505
617
|
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
506
618
|
const { name, arguments: args } = request.params;
|
|
@@ -552,12 +664,6 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
552
664
|
case "delete_task":
|
|
553
665
|
result = await handleDeleteTask(args);
|
|
554
666
|
break;
|
|
555
|
-
case "batch_delete_memories":
|
|
556
|
-
result = await handleBatchDeleteMemories(args);
|
|
557
|
-
break;
|
|
558
|
-
case "batch_delete_tasks":
|
|
559
|
-
result = await handleBatchDeleteTasks(args);
|
|
560
|
-
break;
|
|
561
667
|
default:
|
|
562
668
|
throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${name}`);
|
|
563
669
|
}
|
package/index.ts
CHANGED
|
@@ -35,7 +35,7 @@ console.log("Intangle MCP Server starting - connecting to", API_BASE_URL);
|
|
|
35
35
|
|
|
36
36
|
// Version checking
|
|
37
37
|
// IMPORTANT: Update BOTH package.json version AND this constant when bumping version
|
|
38
|
-
const CURRENT_VERSION = "1.0.
|
|
38
|
+
const CURRENT_VERSION = "1.0.8";
|
|
39
39
|
let latestVersion: string | null = null;
|
|
40
40
|
let versionCheckDone = false;
|
|
41
41
|
|
|
@@ -100,50 +100,78 @@ const TOOLS = [
|
|
|
100
100
|
{
|
|
101
101
|
name: "add_memory",
|
|
102
102
|
description:
|
|
103
|
-
"Store
|
|
103
|
+
"Store one or more memories in the user's memory graph with flexible topics. Accepts a single memory object or an array of memory objects for batch creation. REQUIRES space_id parameter.",
|
|
104
104
|
inputSchema: {
|
|
105
105
|
type: "object",
|
|
106
106
|
properties: {
|
|
107
107
|
space_id: {
|
|
108
108
|
type: "string",
|
|
109
109
|
description:
|
|
110
|
-
"REQUIRED: Space to store memory in (use list_spaces to see available options)",
|
|
111
|
-
},
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
110
|
+
"REQUIRED: Space to store memory/memories in (use list_spaces to see available options)",
|
|
111
|
+
},
|
|
112
|
+
memories: {
|
|
113
|
+
oneOf: [
|
|
114
|
+
{
|
|
115
|
+
type: "object",
|
|
116
|
+
properties: {
|
|
117
|
+
title: {
|
|
118
|
+
type: "string",
|
|
119
|
+
description: "Title/summary of the memory",
|
|
120
|
+
},
|
|
121
|
+
content: {
|
|
122
|
+
type: "string",
|
|
123
|
+
description: "Detailed content of the memory",
|
|
124
|
+
},
|
|
125
|
+
topics: {
|
|
126
|
+
type: "array",
|
|
127
|
+
items: { type: "string" },
|
|
128
|
+
description:
|
|
129
|
+
"Flexible topics/tags for organization (e.g., ['coding', 'react'])",
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
required: ["title", "content"],
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
type: "array",
|
|
136
|
+
items: {
|
|
137
|
+
type: "object",
|
|
138
|
+
properties: {
|
|
139
|
+
title: {
|
|
140
|
+
type: "string",
|
|
141
|
+
description: "Title/summary of the memory",
|
|
142
|
+
},
|
|
143
|
+
content: {
|
|
144
|
+
type: "string",
|
|
145
|
+
description: "Detailed content of the memory",
|
|
146
|
+
},
|
|
147
|
+
topics: {
|
|
148
|
+
type: "array",
|
|
149
|
+
items: { type: "string" },
|
|
150
|
+
description:
|
|
151
|
+
"Flexible topics/tags for organization (e.g., ['coding', 'react'])",
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
required: ["title", "content"],
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
],
|
|
158
|
+
description: "Single memory object or array of memory objects to create",
|
|
125
159
|
},
|
|
126
160
|
},
|
|
127
|
-
required: ["space_id", "
|
|
161
|
+
required: ["space_id", "memories"],
|
|
128
162
|
},
|
|
129
163
|
},
|
|
130
164
|
{
|
|
131
165
|
name: "search_memories",
|
|
132
166
|
description:
|
|
133
|
-
"Search through stored memories using advanced hybrid search (semantic + text + entity relationships). ALWAYS provide
|
|
167
|
+
"Search through stored memories using advanced hybrid search (semantic + text + entity relationships). ALWAYS provide space_id parameter - this is mandatory for all searches.",
|
|
134
168
|
inputSchema: {
|
|
135
169
|
type: "object",
|
|
136
170
|
properties: {
|
|
137
171
|
space_id: {
|
|
138
172
|
type: "string",
|
|
139
173
|
description:
|
|
140
|
-
"REQUIRED
|
|
141
|
-
},
|
|
142
|
-
space_ids: {
|
|
143
|
-
type: "array",
|
|
144
|
-
items: { type: "string" },
|
|
145
|
-
description:
|
|
146
|
-
"REQUIRED (or use space_id): Multiple spaces to search across",
|
|
174
|
+
"REQUIRED: Space to search in (use list_spaces to see available options)",
|
|
147
175
|
},
|
|
148
176
|
query: {
|
|
149
177
|
type: "string",
|
|
@@ -205,29 +233,23 @@ const TOOLS = [
|
|
|
205
233
|
},
|
|
206
234
|
{
|
|
207
235
|
name: "delete_memory",
|
|
208
|
-
description: "Delete a
|
|
209
|
-
inputSchema: {
|
|
210
|
-
type: "object",
|
|
211
|
-
properties: {
|
|
212
|
-
memory_id: {
|
|
213
|
-
type: "string",
|
|
214
|
-
description: "ID of the memory to delete",
|
|
215
|
-
},
|
|
216
|
-
},
|
|
217
|
-
required: ["memory_id"],
|
|
218
|
-
},
|
|
219
|
-
},
|
|
220
|
-
{
|
|
221
|
-
name: "batch_delete_memories",
|
|
222
|
-
description:
|
|
223
|
-
"Delete multiple memories in a single transaction. All-or-nothing operation.",
|
|
236
|
+
description: "Delete one or more memories in a single transaction. Accepts a single memory ID or an array of memory IDs for batch deletion.",
|
|
224
237
|
inputSchema: {
|
|
225
238
|
type: "object",
|
|
226
239
|
properties: {
|
|
227
240
|
memory_ids: {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
241
|
+
oneOf: [
|
|
242
|
+
{
|
|
243
|
+
type: "string",
|
|
244
|
+
description: "Single memory ID to delete",
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
type: "array",
|
|
248
|
+
items: { type: "string" },
|
|
249
|
+
description: "Array of memory IDs to delete",
|
|
250
|
+
},
|
|
251
|
+
],
|
|
252
|
+
description: "Single memory ID or array of memory IDs to delete",
|
|
231
253
|
},
|
|
232
254
|
},
|
|
233
255
|
required: ["memory_ids"],
|
|
@@ -315,40 +337,83 @@ const TOOLS = [
|
|
|
315
337
|
{
|
|
316
338
|
name: "add_task",
|
|
317
339
|
description:
|
|
318
|
-
"Create
|
|
340
|
+
"Create one or more tasks in your space with status tracking. Accepts a single task object or an array of task objects for batch creation. Tasks have graph relationships like memories (entities, topics, temporal). REQUIRES space_id parameter.",
|
|
319
341
|
inputSchema: {
|
|
320
342
|
type: "object",
|
|
321
343
|
properties: {
|
|
322
344
|
space_id: {
|
|
323
345
|
type: "string",
|
|
324
346
|
description:
|
|
325
|
-
"REQUIRED: Space to create task in (use list_spaces to see available options)",
|
|
326
|
-
},
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
347
|
+
"REQUIRED: Space to create task/tasks in (use list_spaces to see available options)",
|
|
348
|
+
},
|
|
349
|
+
tasks: {
|
|
350
|
+
oneOf: [
|
|
351
|
+
{
|
|
352
|
+
type: "object",
|
|
353
|
+
properties: {
|
|
354
|
+
title: {
|
|
355
|
+
type: "string",
|
|
356
|
+
description: "Task title/summary",
|
|
357
|
+
},
|
|
358
|
+
content: {
|
|
359
|
+
type: "string",
|
|
360
|
+
description: "Detailed task description",
|
|
361
|
+
},
|
|
362
|
+
topics: {
|
|
363
|
+
type: "array",
|
|
364
|
+
items: { type: "string" },
|
|
365
|
+
description: "Optional topics/tags for organization",
|
|
366
|
+
},
|
|
367
|
+
status: {
|
|
368
|
+
type: "string",
|
|
369
|
+
enum: ["pending", "in_progress", "completed", "invalidated"],
|
|
370
|
+
description: "Task status (default: pending)",
|
|
371
|
+
default: "pending",
|
|
372
|
+
},
|
|
373
|
+
parent_id: {
|
|
374
|
+
type: "string",
|
|
375
|
+
description: "Optional parent task ID to create this as a subtask",
|
|
376
|
+
},
|
|
377
|
+
},
|
|
378
|
+
required: ["title", "content"],
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
type: "array",
|
|
382
|
+
items: {
|
|
383
|
+
type: "object",
|
|
384
|
+
properties: {
|
|
385
|
+
title: {
|
|
386
|
+
type: "string",
|
|
387
|
+
description: "Task title/summary",
|
|
388
|
+
},
|
|
389
|
+
content: {
|
|
390
|
+
type: "string",
|
|
391
|
+
description: "Detailed task description",
|
|
392
|
+
},
|
|
393
|
+
topics: {
|
|
394
|
+
type: "array",
|
|
395
|
+
items: { type: "string" },
|
|
396
|
+
description: "Optional topics/tags for organization",
|
|
397
|
+
},
|
|
398
|
+
status: {
|
|
399
|
+
type: "string",
|
|
400
|
+
enum: ["pending", "in_progress", "completed", "invalidated"],
|
|
401
|
+
description: "Task status (default: pending)",
|
|
402
|
+
default: "pending",
|
|
403
|
+
},
|
|
404
|
+
parent_id: {
|
|
405
|
+
type: "string",
|
|
406
|
+
description: "Optional parent task ID to create this as a subtask",
|
|
407
|
+
},
|
|
408
|
+
},
|
|
409
|
+
required: ["title", "content"],
|
|
410
|
+
},
|
|
411
|
+
},
|
|
412
|
+
],
|
|
413
|
+
description: "Single task object or array of task objects to create",
|
|
349
414
|
},
|
|
350
415
|
},
|
|
351
|
-
required: ["space_id", "
|
|
416
|
+
required: ["space_id", "tasks"],
|
|
352
417
|
},
|
|
353
418
|
},
|
|
354
419
|
{
|
|
@@ -372,29 +437,66 @@ const TOOLS = [
|
|
|
372
437
|
},
|
|
373
438
|
{
|
|
374
439
|
name: "update_task",
|
|
375
|
-
description: "Update
|
|
440
|
+
description: "Update one or more tasks. Accepts a single update object or an array of update objects for batch updates. Each update must include task_id.",
|
|
376
441
|
inputSchema: {
|
|
377
442
|
type: "object",
|
|
378
443
|
properties: {
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
444
|
+
updates: {
|
|
445
|
+
oneOf: [
|
|
446
|
+
{
|
|
447
|
+
type: "object",
|
|
448
|
+
properties: {
|
|
449
|
+
task_id: {
|
|
450
|
+
type: "string",
|
|
451
|
+
description: "Task ID to update",
|
|
452
|
+
},
|
|
453
|
+
title: {
|
|
454
|
+
type: "string",
|
|
455
|
+
description: "New title (optional)",
|
|
456
|
+
},
|
|
457
|
+
content: {
|
|
458
|
+
type: "string",
|
|
459
|
+
description: "New content (optional)",
|
|
460
|
+
},
|
|
461
|
+
topics: {
|
|
462
|
+
type: "array",
|
|
463
|
+
items: { type: "string" },
|
|
464
|
+
description: "New topics array (optional)",
|
|
465
|
+
},
|
|
466
|
+
},
|
|
467
|
+
required: ["task_id"],
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
type: "array",
|
|
471
|
+
items: {
|
|
472
|
+
type: "object",
|
|
473
|
+
properties: {
|
|
474
|
+
task_id: {
|
|
475
|
+
type: "string",
|
|
476
|
+
description: "Task ID to update",
|
|
477
|
+
},
|
|
478
|
+
title: {
|
|
479
|
+
type: "string",
|
|
480
|
+
description: "New title (optional)",
|
|
481
|
+
},
|
|
482
|
+
content: {
|
|
483
|
+
type: "string",
|
|
484
|
+
description: "New content (optional)",
|
|
485
|
+
},
|
|
486
|
+
topics: {
|
|
487
|
+
type: "array",
|
|
488
|
+
items: { type: "string" },
|
|
489
|
+
description: "New topics array (optional)",
|
|
490
|
+
},
|
|
491
|
+
},
|
|
492
|
+
required: ["task_id"],
|
|
493
|
+
},
|
|
494
|
+
},
|
|
495
|
+
],
|
|
496
|
+
description: "Single update object or array of update objects",
|
|
395
497
|
},
|
|
396
498
|
},
|
|
397
|
-
required: ["
|
|
499
|
+
required: ["updates"],
|
|
398
500
|
},
|
|
399
501
|
},
|
|
400
502
|
{
|
|
@@ -428,29 +530,23 @@ const TOOLS = [
|
|
|
428
530
|
},
|
|
429
531
|
{
|
|
430
532
|
name: "delete_task",
|
|
431
|
-
description: "Delete a task
|
|
432
|
-
inputSchema: {
|
|
433
|
-
type: "object",
|
|
434
|
-
properties: {
|
|
435
|
-
task_id: {
|
|
436
|
-
type: "string",
|
|
437
|
-
description: "ID of task to delete",
|
|
438
|
-
},
|
|
439
|
-
},
|
|
440
|
-
required: ["task_id"],
|
|
441
|
-
},
|
|
442
|
-
},
|
|
443
|
-
{
|
|
444
|
-
name: "batch_delete_tasks",
|
|
445
|
-
description:
|
|
446
|
-
"Delete multiple tasks in a single transaction. All-or-nothing operation.",
|
|
533
|
+
description: "Delete one or more tasks in a single transaction. Accepts a single task ID or an array of task IDs for batch deletion.",
|
|
447
534
|
inputSchema: {
|
|
448
535
|
type: "object",
|
|
449
536
|
properties: {
|
|
450
537
|
task_ids: {
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
538
|
+
oneOf: [
|
|
539
|
+
{
|
|
540
|
+
type: "string",
|
|
541
|
+
description: "Single task ID to delete",
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
type: "array",
|
|
545
|
+
items: { type: "string" },
|
|
546
|
+
description: "Array of task IDs to delete",
|
|
547
|
+
},
|
|
548
|
+
],
|
|
549
|
+
description: "Single task ID or array of task IDs to delete",
|
|
454
550
|
},
|
|
455
551
|
},
|
|
456
552
|
required: ["task_ids"],
|
|
@@ -470,38 +566,40 @@ async function handleAddMemory(args: any) {
|
|
|
470
566
|
);
|
|
471
567
|
}
|
|
472
568
|
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
569
|
+
if (!args.memories) {
|
|
570
|
+
throw new Error("memories parameter is required (single object or array)");
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
// Pass through to API
|
|
574
|
+
return makeApiCall("add-memory", {
|
|
575
|
+
space_id: args.space_id,
|
|
576
|
+
memories: args.memories,
|
|
577
|
+
});
|
|
478
578
|
}
|
|
479
579
|
|
|
480
580
|
async function handleSearchMemories(args: any) {
|
|
481
581
|
const {
|
|
482
582
|
space_id,
|
|
483
|
-
space_ids,
|
|
484
583
|
query,
|
|
485
584
|
topics,
|
|
486
585
|
max_results = 10,
|
|
487
586
|
} = args as {
|
|
488
|
-
space_id
|
|
489
|
-
space_ids?: string[];
|
|
587
|
+
space_id: string;
|
|
490
588
|
query: string;
|
|
491
589
|
topics?: string[];
|
|
492
590
|
max_results?: number;
|
|
493
591
|
};
|
|
494
592
|
|
|
495
|
-
// Require
|
|
496
|
-
if (!space_id
|
|
593
|
+
// Require space_id
|
|
594
|
+
if (!space_id) {
|
|
497
595
|
throw new Error(
|
|
498
|
-
"
|
|
596
|
+
"space_id is required. Use list_spaces to see available options.",
|
|
499
597
|
);
|
|
500
598
|
}
|
|
501
599
|
|
|
502
600
|
return makeApiCall("search-memories", {
|
|
503
601
|
space_id,
|
|
504
|
-
space_ids,
|
|
602
|
+
space_ids: [space_id], // Convert to array for backend compatibility
|
|
505
603
|
query,
|
|
506
604
|
topics,
|
|
507
605
|
max_results,
|
|
@@ -540,11 +638,11 @@ async function handleGetEntities(args: any) {
|
|
|
540
638
|
}
|
|
541
639
|
|
|
542
640
|
async function handleDeleteMemory(args: any) {
|
|
543
|
-
const {
|
|
544
|
-
|
|
641
|
+
const { memory_ids } = args as {
|
|
642
|
+
memory_ids: string | string[];
|
|
545
643
|
};
|
|
546
644
|
|
|
547
|
-
return makeApiCall("delete-memory", {
|
|
645
|
+
return makeApiCall("delete-memory", { memory_ids });
|
|
548
646
|
}
|
|
549
647
|
|
|
550
648
|
async function handleDebugStructure() {
|
|
@@ -570,7 +668,21 @@ async function handleStart(args: any) {
|
|
|
570
668
|
}
|
|
571
669
|
|
|
572
670
|
async function handleAddTask(args: any) {
|
|
573
|
-
|
|
671
|
+
if (!args.space_id) {
|
|
672
|
+
throw new Error(
|
|
673
|
+
"space_id is required. Use list_spaces to see available options.",
|
|
674
|
+
);
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
if (!args.tasks) {
|
|
678
|
+
throw new Error("tasks parameter is required (single object or array)");
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
// Pass through to API
|
|
682
|
+
return makeApiCall("add-task", {
|
|
683
|
+
space_id: args.space_id,
|
|
684
|
+
tasks: args.tasks,
|
|
685
|
+
});
|
|
574
686
|
}
|
|
575
687
|
|
|
576
688
|
async function handleUpdateTaskStatus(args: any) {
|
|
@@ -578,7 +690,14 @@ async function handleUpdateTaskStatus(args: any) {
|
|
|
578
690
|
}
|
|
579
691
|
|
|
580
692
|
async function handleUpdateTask(args: any) {
|
|
581
|
-
|
|
693
|
+
if (!args.updates) {
|
|
694
|
+
throw new Error("updates parameter is required (single object or array)");
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
// Pass through to API
|
|
698
|
+
return makeApiCall("update-task", {
|
|
699
|
+
updates: args.updates,
|
|
700
|
+
});
|
|
582
701
|
}
|
|
583
702
|
|
|
584
703
|
async function handleListTasks(args: any) {
|
|
@@ -586,15 +705,11 @@ async function handleListTasks(args: any) {
|
|
|
586
705
|
}
|
|
587
706
|
|
|
588
707
|
async function handleDeleteTask(args: any) {
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
async function handleBatchDeleteMemories(args: any) {
|
|
593
|
-
return makeApiCall("batch-delete-memories", args);
|
|
594
|
-
}
|
|
708
|
+
const { task_ids } = args as {
|
|
709
|
+
task_ids: string | string[];
|
|
710
|
+
};
|
|
595
711
|
|
|
596
|
-
|
|
597
|
-
return makeApiCall("batch-delete-tasks", args);
|
|
712
|
+
return makeApiCall("delete-task", { task_ids });
|
|
598
713
|
}
|
|
599
714
|
|
|
600
715
|
server.setRequestHandler(CallToolRequestSchema, async (request: any) => {
|
|
@@ -649,12 +764,6 @@ server.setRequestHandler(CallToolRequestSchema, async (request: any) => {
|
|
|
649
764
|
case "delete_task":
|
|
650
765
|
result = await handleDeleteTask(args);
|
|
651
766
|
break;
|
|
652
|
-
case "batch_delete_memories":
|
|
653
|
-
result = await handleBatchDeleteMemories(args);
|
|
654
|
-
break;
|
|
655
|
-
case "batch_delete_tasks":
|
|
656
|
-
result = await handleBatchDeleteTasks(args);
|
|
657
|
-
break;
|
|
658
767
|
default:
|
|
659
768
|
throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${name}`);
|
|
660
769
|
}
|