@vincentwei1021/synapse-openclaw-plugin 0.5.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.
@@ -0,0 +1,681 @@
1
+ import { createPassthroughTool, defineOpenClawTools } from "./tool-registry.js";
2
+
3
+ /**
4
+ * All Synapse MCP tools available to agents.
5
+ *
6
+ * In the current Synapse architecture, all tools are available to all agents.
7
+ * The Synapse MCP server handles role-based access internally.
8
+ * These definitions tell OpenClaw what tools exist and how to call them.
9
+ */
10
+ export const commonToolDefinitions = defineOpenClawTools([
11
+ // =========================================================================
12
+ // Agent Identity & Assignments
13
+ // =========================================================================
14
+ createPassthroughTool({
15
+ name: "synapse_checkin",
16
+ description: "Agent check-in. Returns persona, roles, owner info, and pending assignments. Recommended at session start.",
17
+ parameters: {
18
+ type: "object",
19
+ properties: {},
20
+ additionalProperties: false,
21
+ },
22
+ targetToolName: "synapse_checkin",
23
+ mapArgs: () => ({}),
24
+ }),
25
+ createPassthroughTool({
26
+ name: "synapse_get_my_assignments",
27
+ description: "Get all research questions and experiment runs currently assigned to you.",
28
+ parameters: {
29
+ type: "object",
30
+ properties: {},
31
+ additionalProperties: false,
32
+ },
33
+ targetToolName: "synapse_get_my_assignments",
34
+ mapArgs: () => ({}),
35
+ }),
36
+
37
+ // =========================================================================
38
+ // Research Projects
39
+ // =========================================================================
40
+ createPassthroughTool<{ page?: number; pageSize?: number }>({
41
+ name: "synapse_list_research_projects",
42
+ description: "List all research projects for the current company.",
43
+ parameters: {
44
+ type: "object",
45
+ properties: {
46
+ page: { type: "number", description: "Page number (default: 1)" },
47
+ pageSize: { type: "number", description: "Items per page (default: 20)" },
48
+ },
49
+ additionalProperties: false,
50
+ },
51
+ targetToolName: "synapse_list_research_projects",
52
+ }),
53
+ createPassthroughTool<{ researchProjectUuid: string }>({
54
+ name: "synapse_get_research_project",
55
+ description: "Get research project details including goal, datasets, evaluation methods, and synthesis summary.",
56
+ parameters: {
57
+ type: "object",
58
+ properties: {
59
+ researchProjectUuid: { type: "string", description: "Research Project UUID" },
60
+ },
61
+ required: ["researchProjectUuid"],
62
+ additionalProperties: false,
63
+ },
64
+ targetToolName: "synapse_get_research_project",
65
+ }),
66
+ createPassthroughTool<{ researchProjectUuid: string }>({
67
+ name: "synapse_get_project_full_context",
68
+ description: "Get full research context for a project: brief, datasets, evaluation methods, all research questions, all experiments with outcomes, and related works count.",
69
+ parameters: {
70
+ type: "object",
71
+ properties: {
72
+ researchProjectUuid: { type: "string", description: "Research Project UUID" },
73
+ },
74
+ required: ["researchProjectUuid"],
75
+ additionalProperties: false,
76
+ },
77
+ targetToolName: "synapse_get_project_full_context",
78
+ }),
79
+ createPassthroughTool<{ researchProjectUuid: string; page?: number; pageSize?: number }>({
80
+ name: "synapse_get_activity",
81
+ description: "Get the activity stream for a research project.",
82
+ parameters: {
83
+ type: "object",
84
+ properties: {
85
+ researchProjectUuid: { type: "string", description: "Research Project UUID" },
86
+ page: { type: "number", description: "Page number (default: 1)" },
87
+ pageSize: { type: "number", description: "Items per page (default: 50)" },
88
+ },
89
+ required: ["researchProjectUuid"],
90
+ additionalProperties: false,
91
+ },
92
+ targetToolName: "synapse_get_activity",
93
+ }),
94
+
95
+ // =========================================================================
96
+ // Research Questions
97
+ // =========================================================================
98
+ createPassthroughTool<{ researchProjectUuid: string; status?: string; page?: number; pageSize?: number }>({
99
+ name: "synapse_get_research_questions",
100
+ description: "List research questions for a project. Can filter by status.",
101
+ parameters: {
102
+ type: "object",
103
+ properties: {
104
+ researchProjectUuid: { type: "string", description: "Research Project UUID" },
105
+ status: { type: "string", description: "Filter by status: open | elaborating | proposal_created | completed | closed" },
106
+ page: { type: "number", description: "Page number (default: 1)" },
107
+ pageSize: { type: "number", description: "Items per page (default: 20)" },
108
+ },
109
+ required: ["researchProjectUuid"],
110
+ additionalProperties: false,
111
+ },
112
+ targetToolName: "synapse_get_research_questions",
113
+ }),
114
+ createPassthroughTool<{ researchQuestionUuid: string }>({
115
+ name: "synapse_get_research_question",
116
+ description: "Get detailed information for a single research question.",
117
+ parameters: {
118
+ type: "object",
119
+ properties: {
120
+ researchQuestionUuid: { type: "string", description: "Research Question UUID" },
121
+ },
122
+ required: ["researchQuestionUuid"],
123
+ additionalProperties: false,
124
+ },
125
+ targetToolName: "synapse_get_research_question",
126
+ }),
127
+ createPassthroughTool<{ researchProjectUuid: string }>({
128
+ name: "synapse_get_available_research_questions",
129
+ description: "Get research questions available to claim in a project (status=open).",
130
+ parameters: {
131
+ type: "object",
132
+ properties: {
133
+ researchProjectUuid: { type: "string", description: "Research Project UUID" },
134
+ },
135
+ required: ["researchProjectUuid"],
136
+ additionalProperties: false,
137
+ },
138
+ targetToolName: "synapse_get_available_research_questions",
139
+ }),
140
+ createPassthroughTool<{ researchQuestionUuid: string }>({
141
+ name: "synapse_claim_research_question",
142
+ description: "Claim an open research question for elaboration (open -> elaborating).",
143
+ parameters: {
144
+ type: "object",
145
+ properties: {
146
+ researchQuestionUuid: { type: "string", description: "Research Question UUID" },
147
+ },
148
+ required: ["researchQuestionUuid"],
149
+ additionalProperties: false,
150
+ },
151
+ targetToolName: "synapse_claim_research_question",
152
+ }),
153
+ createPassthroughTool<{ researchQuestionUuid: string }>({
154
+ name: "synapse_release_research_question",
155
+ description: "Release a claimed research question (assigned -> open).",
156
+ parameters: {
157
+ type: "object",
158
+ properties: {
159
+ researchQuestionUuid: { type: "string", description: "Research Question UUID" },
160
+ },
161
+ required: ["researchQuestionUuid"],
162
+ additionalProperties: false,
163
+ },
164
+ targetToolName: "synapse_release_research_question",
165
+ }),
166
+ createPassthroughTool<{ researchQuestionUuid: string; status: string }>({
167
+ name: "synapse_update_research_question_status",
168
+ description: "Update research question status (only assignee can operate).",
169
+ parameters: {
170
+ type: "object",
171
+ properties: {
172
+ researchQuestionUuid: { type: "string", description: "Research Question UUID" },
173
+ status: { type: "string", description: "New status: elaborating | proposal_created | completed | in_progress | pending_review" },
174
+ },
175
+ required: ["researchQuestionUuid", "status"],
176
+ additionalProperties: false,
177
+ },
178
+ targetToolName: "synapse_update_research_question_status",
179
+ }),
180
+
181
+ // =========================================================================
182
+ // Experiments (primary workflow)
183
+ // =========================================================================
184
+ createPassthroughTool<{ experimentUuid: string }>({
185
+ name: "synapse_get_experiment",
186
+ description: "Get detailed information for an experiment.",
187
+ parameters: {
188
+ type: "object",
189
+ properties: {
190
+ experimentUuid: { type: "string", description: "Experiment UUID" },
191
+ },
192
+ required: ["experimentUuid"],
193
+ additionalProperties: false,
194
+ },
195
+ targetToolName: "synapse_get_experiment",
196
+ }),
197
+ createPassthroughTool<{ researchProjectUuid?: string; statuses?: string[] }>({
198
+ name: "synapse_get_assigned_experiments",
199
+ description: "List experiments assigned to this agent, sorted by execution priority and FIFO within the same priority.",
200
+ parameters: {
201
+ type: "object",
202
+ properties: {
203
+ researchProjectUuid: { type: "string", description: "Optional research project UUID" },
204
+ statuses: { type: "array", items: { type: "string" }, description: "Optional experiment statuses to include" },
205
+ },
206
+ additionalProperties: false,
207
+ },
208
+ targetToolName: "synapse_get_assigned_experiments",
209
+ }),
210
+ createPassthroughTool<{ experimentUuid: string; gpuUuids?: string[]; workingNotes?: string }>({
211
+ name: "synapse_start_experiment",
212
+ description: "Start an assigned experiment and optionally reserve GPUs.",
213
+ parameters: {
214
+ type: "object",
215
+ properties: {
216
+ experimentUuid: { type: "string", description: "Experiment UUID" },
217
+ gpuUuids: { type: "array", items: { type: "string" }, description: "Optional GPU UUIDs to reserve" },
218
+ workingNotes: { type: "string", description: "Optional notes or execution plan to append to the experiment description" },
219
+ },
220
+ required: ["experimentUuid"],
221
+ additionalProperties: false,
222
+ },
223
+ targetToolName: "synapse_start_experiment",
224
+ mapArgs: ({ experimentUuid, gpuUuids, workingNotes }) => ({
225
+ experimentUuid,
226
+ gpuUuids: gpuUuids ?? [],
227
+ workingNotes,
228
+ }),
229
+ }),
230
+ createPassthroughTool<{ experimentUuid: string; outcome?: string; experimentResults?: unknown }>({
231
+ name: "synapse_submit_experiment_results",
232
+ description: "Submit experiment outcome and structured results, releasing any reserved GPU resources.",
233
+ parameters: {
234
+ type: "object",
235
+ properties: {
236
+ experimentUuid: { type: "string", description: "Experiment UUID" },
237
+ outcome: { type: "string", description: "Human-readable summary of the outcome" },
238
+ experimentResults: { type: "object", description: "Structured results payload" },
239
+ },
240
+ required: ["experimentUuid"],
241
+ additionalProperties: true,
242
+ },
243
+ targetToolName: "synapse_submit_experiment_results",
244
+ }),
245
+ createPassthroughTool<{ experimentUuid: string; message: string; phase?: string }>({
246
+ name: "synapse_report_experiment_progress",
247
+ description: "Report a progress update for an in-progress experiment. The message appears on the experiment card in real-time.",
248
+ parameters: {
249
+ type: "object",
250
+ properties: {
251
+ experimentUuid: { type: "string", description: "Experiment UUID" },
252
+ message: { type: "string", description: "Short status message, e.g. 'Training epoch 3/10, loss=0.42'" },
253
+ phase: { type: "string", description: "Optional phase label, e.g. 'data_download', 'training', 'evaluation'" },
254
+ },
255
+ required: ["experimentUuid", "message"],
256
+ additionalProperties: false,
257
+ },
258
+ targetToolName: "synapse_report_experiment_progress",
259
+ }),
260
+ createPassthroughTool<{
261
+ researchProjectUuid: string;
262
+ title: string;
263
+ description: string;
264
+ researchQuestionUuid?: string;
265
+ priority?: string;
266
+ }>({
267
+ name: "synapse_propose_experiment",
268
+ description: "Propose a new experiment for human review (created in draft status). Only usable when autonomous loop is active.",
269
+ parameters: {
270
+ type: "object",
271
+ properties: {
272
+ researchProjectUuid: { type: "string", description: "Research Project UUID" },
273
+ title: { type: "string", description: "Experiment title" },
274
+ description: { type: "string", description: "Experiment description" },
275
+ researchQuestionUuid: { type: "string", description: "Optional linked research question UUID" },
276
+ priority: { type: "string", description: "Priority: low | medium | high | immediate (default: medium)" },
277
+ },
278
+ required: ["researchProjectUuid", "title", "description"],
279
+ additionalProperties: false,
280
+ },
281
+ targetToolName: "synapse_propose_experiment",
282
+ }),
283
+
284
+ // =========================================================================
285
+ // Compute
286
+ // =========================================================================
287
+ createPassthroughTool<{ onlyAvailable?: boolean; researchProjectUuid?: string }>({
288
+ name: "synapse_list_compute_nodes",
289
+ description: "List compute pools, machines, and per-GPU availability and telemetry.",
290
+ parameters: {
291
+ type: "object",
292
+ properties: {
293
+ onlyAvailable: { type: "boolean", description: "If true, only show currently available GPUs" },
294
+ researchProjectUuid: { type: "string", description: "Optional research project UUID to filter by assigned pool" },
295
+ },
296
+ additionalProperties: false,
297
+ },
298
+ targetToolName: "synapse_list_compute_nodes",
299
+ mapArgs: ({ onlyAvailable, researchProjectUuid }) => ({
300
+ onlyAvailable: onlyAvailable ?? false,
301
+ researchProjectUuid,
302
+ }),
303
+ }),
304
+ createPassthroughTool<{ experimentUuid: string; nodeUuid: string }>({
305
+ name: "synapse_get_node_access_bundle",
306
+ description: "Fetch a managed SSH access bundle for a compute node. Use this when managedKeyAvailable=true instead of assuming local key paths.",
307
+ parameters: {
308
+ type: "object",
309
+ properties: {
310
+ experimentUuid: { type: "string", description: "Experiment UUID" },
311
+ nodeUuid: { type: "string", description: "Compute node UUID" },
312
+ },
313
+ required: ["experimentUuid", "nodeUuid"],
314
+ additionalProperties: false,
315
+ },
316
+ targetToolName: "synapse_get_node_access_bundle",
317
+ }),
318
+ createPassthroughTool<{ nodeUuid: string; ec2InstanceId?: string; instanceType?: string; region?: string; gpus: Array<Record<string, unknown>> }>({
319
+ name: "synapse_sync_node_inventory",
320
+ description: "Sync a machine's instance metadata and GPU inventory back into Synapse after logging in.",
321
+ parameters: {
322
+ type: "object",
323
+ properties: {
324
+ nodeUuid: { type: "string", description: "Compute node UUID" },
325
+ ec2InstanceId: { type: "string", description: "EC2 instance ID" },
326
+ instanceType: { type: "string", description: "Instance type" },
327
+ region: { type: "string", description: "AWS region" },
328
+ gpus: { type: "array", items: { type: "object" }, description: "GPU inventory: [{ slotIndex, model, memoryGb? }]" },
329
+ },
330
+ required: ["nodeUuid", "gpus"],
331
+ additionalProperties: false,
332
+ },
333
+ targetToolName: "synapse_sync_node_inventory",
334
+ }),
335
+ createPassthroughTool<{ nodeUuid: string; gpus: Array<Record<string, unknown>> }>({
336
+ name: "synapse_report_gpu_status",
337
+ description: "Report latest GPU lifecycle or telemetry after running a workload.",
338
+ parameters: {
339
+ type: "object",
340
+ properties: {
341
+ nodeUuid: { type: "string", description: "Compute node UUID" },
342
+ gpus: { type: "array", items: { type: "object" }, description: "GPU statuses: [{ gpuUuid, lifecycle?, utilizationPercent?, memoryUsedGb?, temperatureC?, notes? }]" },
343
+ },
344
+ required: ["nodeUuid", "gpus"],
345
+ additionalProperties: false,
346
+ },
347
+ targetToolName: "synapse_report_gpu_status",
348
+ }),
349
+
350
+ // =========================================================================
351
+ // Documents
352
+ // =========================================================================
353
+ createPassthroughTool<{ researchProjectUuid: string; type?: string; page?: number; pageSize?: number }>({
354
+ name: "synapse_get_documents",
355
+ description: "List documents for a project. Can filter by type.",
356
+ parameters: {
357
+ type: "object",
358
+ properties: {
359
+ researchProjectUuid: { type: "string", description: "Research Project UUID" },
360
+ type: { type: "string", description: "Filter by document type" },
361
+ page: { type: "number", description: "Page number (default: 1)" },
362
+ pageSize: { type: "number", description: "Items per page (default: 20)" },
363
+ },
364
+ required: ["researchProjectUuid"],
365
+ additionalProperties: false,
366
+ },
367
+ targetToolName: "synapse_get_documents",
368
+ }),
369
+ createPassthroughTool<{ documentUuid: string }>({
370
+ name: "synapse_get_document",
371
+ description: "Get the detailed content of a single document.",
372
+ parameters: {
373
+ type: "object",
374
+ properties: {
375
+ documentUuid: { type: "string", description: "Document UUID" },
376
+ },
377
+ required: ["documentUuid"],
378
+ additionalProperties: false,
379
+ },
380
+ targetToolName: "synapse_get_document",
381
+ }),
382
+
383
+ // =========================================================================
384
+ // Comments
385
+ // =========================================================================
386
+ createPassthroughTool<{ targetType: string; targetUuid: string; content: string }>({
387
+ name: "synapse_add_comment",
388
+ description: "Add a comment to a research question, experiment, experiment design, experiment run, or document.",
389
+ parameters: {
390
+ type: "object",
391
+ properties: {
392
+ targetType: { type: "string", description: "Target type: research_question | experiment | experiment_design | experiment_run | document" },
393
+ targetUuid: { type: "string", description: "Target UUID" },
394
+ content: { type: "string", description: "Comment content" },
395
+ },
396
+ required: ["targetType", "targetUuid", "content"],
397
+ additionalProperties: false,
398
+ },
399
+ targetToolName: "synapse_add_comment",
400
+ }),
401
+ createPassthroughTool<{ targetType: string; targetUuid: string; page?: number; pageSize?: number }>({
402
+ name: "synapse_get_comments",
403
+ description: "Get comments for an entity. Useful for understanding context, decisions, and feedback.",
404
+ parameters: {
405
+ type: "object",
406
+ properties: {
407
+ targetType: { type: "string", description: "Target type: research_question | experiment | experiment_design | experiment_run | document" },
408
+ targetUuid: { type: "string", description: "Target UUID" },
409
+ page: { type: "number", description: "Page number (default: 1)" },
410
+ pageSize: { type: "number", description: "Items per page (default: 20)" },
411
+ },
412
+ required: ["targetType", "targetUuid"],
413
+ additionalProperties: false,
414
+ },
415
+ targetToolName: "synapse_get_comments",
416
+ }),
417
+
418
+ // =========================================================================
419
+ // Notifications
420
+ // =========================================================================
421
+ createPassthroughTool<{ status?: string; autoMarkRead?: boolean }>({
422
+ name: "synapse_get_notifications",
423
+ description: "Get notifications. By default fetches unread and auto-marks them as read.",
424
+ parameters: {
425
+ type: "object",
426
+ properties: {
427
+ status: { type: "string", description: "Filter: unread | read | all (default: unread)" },
428
+ autoMarkRead: { type: "boolean", description: "Auto-mark fetched unread as read (default: true)" },
429
+ },
430
+ additionalProperties: false,
431
+ },
432
+ targetToolName: "synapse_get_notifications",
433
+ mapArgs: ({ status, autoMarkRead }) => {
434
+ const args: Record<string, unknown> = {};
435
+ if (status) args.status = status;
436
+ if (autoMarkRead !== undefined) args.autoMarkRead = autoMarkRead;
437
+ return args;
438
+ },
439
+ }),
440
+ createPassthroughTool<{ notificationUuid?: string; all?: boolean }>({
441
+ name: "synapse_mark_notification_read",
442
+ description: "Mark notification(s) as read (single or all).",
443
+ parameters: {
444
+ type: "object",
445
+ properties: {
446
+ notificationUuid: { type: "string", description: "Single notification UUID" },
447
+ all: { type: "boolean", description: "Whether to mark all as read" },
448
+ },
449
+ additionalProperties: false,
450
+ },
451
+ targetToolName: "synapse_mark_notification_read",
452
+ }),
453
+
454
+ // =========================================================================
455
+ // Mentions
456
+ // =========================================================================
457
+ createPassthroughTool<{ query: string; limit?: number }>({
458
+ name: "synapse_search_mentionables",
459
+ description: "Search for users and agents that can be @mentioned. Returns name, type, and UUID.",
460
+ parameters: {
461
+ type: "object",
462
+ properties: {
463
+ query: { type: "string", description: "Name or keyword to search" },
464
+ limit: { type: "number", description: "Max results to return (default 10)" },
465
+ },
466
+ required: ["query"],
467
+ additionalProperties: false,
468
+ },
469
+ targetToolName: "synapse_search_mentionables",
470
+ }),
471
+
472
+ // =========================================================================
473
+ // Hypothesis Formulation
474
+ // =========================================================================
475
+ createPassthroughTool<{ researchQuestionUuid: string; roundUuid: string; answers: Array<Record<string, unknown>> }>({
476
+ name: "synapse_answer_hypothesis_formulation",
477
+ description: "Answer hypothesis formulation questions for a research question.",
478
+ parameters: {
479
+ type: "object",
480
+ properties: {
481
+ researchQuestionUuid: { type: "string", description: "Research Question UUID" },
482
+ roundUuid: { type: "string", description: "Hypothesis formulation round UUID" },
483
+ answers: {
484
+ type: "array",
485
+ description: "Array of answers. Each: { questionId, selectedOptionId, customText }",
486
+ items: { type: "object" },
487
+ },
488
+ },
489
+ required: ["researchQuestionUuid", "roundUuid", "answers"],
490
+ additionalProperties: false,
491
+ },
492
+ targetToolName: "synapse_answer_hypothesis_formulation",
493
+ }),
494
+ createPassthroughTool<{ researchQuestionUuid: string }>({
495
+ name: "synapse_get_hypothesis_formulation",
496
+ description: "Get the full hypothesis formulation state for a research question, including all rounds, questions, answers, and progress summary.",
497
+ parameters: {
498
+ type: "object",
499
+ properties: {
500
+ researchQuestionUuid: { type: "string", description: "Research Question UUID" },
501
+ },
502
+ required: ["researchQuestionUuid"],
503
+ additionalProperties: false,
504
+ },
505
+ targetToolName: "synapse_get_hypothesis_formulation",
506
+ }),
507
+
508
+ // =========================================================================
509
+ // Project Groups
510
+ // =========================================================================
511
+ createPassthroughTool({
512
+ name: "synapse_get_project_groups",
513
+ description: "List all project groups with project counts and completion rates.",
514
+ parameters: {
515
+ type: "object",
516
+ properties: {},
517
+ additionalProperties: false,
518
+ },
519
+ targetToolName: "synapse_get_project_groups",
520
+ mapArgs: () => ({}),
521
+ }),
522
+ createPassthroughTool<{ groupUuid: string }>({
523
+ name: "synapse_get_project_group",
524
+ description: "Get a single project group with its projects and stats.",
525
+ parameters: {
526
+ type: "object",
527
+ properties: {
528
+ groupUuid: { type: "string", description: "Project group UUID" },
529
+ },
530
+ required: ["groupUuid"],
531
+ additionalProperties: false,
532
+ },
533
+ targetToolName: "synapse_get_project_group",
534
+ }),
535
+ createPassthroughTool<{ groupUuid: string }>({
536
+ name: "synapse_get_group_dashboard",
537
+ description: "Get aggregated dashboard stats for a project group.",
538
+ parameters: {
539
+ type: "object",
540
+ properties: {
541
+ groupUuid: { type: "string", description: "Project group UUID" },
542
+ },
543
+ required: ["groupUuid"],
544
+ additionalProperties: false,
545
+ },
546
+ targetToolName: "synapse_get_group_dashboard",
547
+ }),
548
+
549
+ // =========================================================================
550
+ // Literature / Related Works
551
+ // =========================================================================
552
+ createPassthroughTool<{ query: string; limit?: number }>({
553
+ name: "synapse_search_papers",
554
+ description: "Search for academic papers using Semantic Scholar.",
555
+ parameters: {
556
+ type: "object",
557
+ properties: {
558
+ query: { type: "string", description: "Search query" },
559
+ limit: { type: "number", description: "Max results (default: 10, max: 20)" },
560
+ },
561
+ required: ["query"],
562
+ additionalProperties: false,
563
+ },
564
+ targetToolName: "synapse_search_papers",
565
+ }),
566
+ createPassthroughTool<{ researchProjectUuid: string; title: string; url: string; authors?: string; abstract?: string; arxivId?: string; source?: string }>({
567
+ name: "synapse_add_related_work",
568
+ description: "Add a paper to a research project's related works collection.",
569
+ parameters: {
570
+ type: "object",
571
+ properties: {
572
+ researchProjectUuid: { type: "string", description: "Research Project UUID" },
573
+ title: { type: "string", description: "Paper title" },
574
+ url: { type: "string", description: "Paper URL" },
575
+ authors: { type: "string", description: "Authors" },
576
+ abstract: { type: "string", description: "Abstract" },
577
+ arxivId: { type: "string", description: "ArXiv ID" },
578
+ source: { type: "string", description: "Source: arxiv | semantic_scholar" },
579
+ },
580
+ required: ["researchProjectUuid", "title", "url"],
581
+ additionalProperties: false,
582
+ },
583
+ targetToolName: "synapse_add_related_work",
584
+ }),
585
+ createPassthroughTool<{ researchProjectUuid: string }>({
586
+ name: "synapse_get_related_works",
587
+ description: "Get all related works (papers) collected for a research project.",
588
+ parameters: {
589
+ type: "object",
590
+ properties: {
591
+ researchProjectUuid: { type: "string", description: "Research Project UUID" },
592
+ },
593
+ required: ["researchProjectUuid"],
594
+ additionalProperties: false,
595
+ },
596
+ targetToolName: "synapse_get_related_works",
597
+ }),
598
+
599
+ // =========================================================================
600
+ // Sessions
601
+ // =========================================================================
602
+ createPassthroughTool<{ status?: string }>({
603
+ name: "synapse_list_sessions",
604
+ description: "List all sessions for the current agent.",
605
+ parameters: {
606
+ type: "object",
607
+ properties: {
608
+ status: { type: "string", description: "Filter by status: active | inactive | closed" },
609
+ },
610
+ additionalProperties: false,
611
+ },
612
+ targetToolName: "synapse_list_sessions",
613
+ }),
614
+ createPassthroughTool<{ sessionUuid: string }>({
615
+ name: "synapse_get_session",
616
+ description: "Get session details and active checkins.",
617
+ parameters: {
618
+ type: "object",
619
+ properties: {
620
+ sessionUuid: { type: "string", description: "Session UUID" },
621
+ },
622
+ required: ["sessionUuid"],
623
+ additionalProperties: false,
624
+ },
625
+ targetToolName: "synapse_get_session",
626
+ }),
627
+ createPassthroughTool<{ name: string; description?: string; expiresAt?: string }>({
628
+ name: "synapse_create_session",
629
+ description: "Create a new agent session.",
630
+ parameters: {
631
+ type: "object",
632
+ properties: {
633
+ name: { type: "string", description: "Session name" },
634
+ description: { type: "string", description: "Session description" },
635
+ expiresAt: { type: "string", description: "Expiration time (ISO 8601)" },
636
+ },
637
+ required: ["name"],
638
+ additionalProperties: false,
639
+ },
640
+ targetToolName: "synapse_create_session",
641
+ }),
642
+ createPassthroughTool<{ sessionUuid: string }>({
643
+ name: "synapse_close_session",
644
+ description: "Close a session (batch checkout all checkins).",
645
+ parameters: {
646
+ type: "object",
647
+ properties: {
648
+ sessionUuid: { type: "string", description: "Session UUID" },
649
+ },
650
+ required: ["sessionUuid"],
651
+ additionalProperties: false,
652
+ },
653
+ targetToolName: "synapse_close_session",
654
+ }),
655
+ createPassthroughTool<{ sessionUuid: string }>({
656
+ name: "synapse_reopen_session",
657
+ description: "Reopen a closed session (closed -> active).",
658
+ parameters: {
659
+ type: "object",
660
+ properties: {
661
+ sessionUuid: { type: "string", description: "Session UUID" },
662
+ },
663
+ required: ["sessionUuid"],
664
+ additionalProperties: false,
665
+ },
666
+ targetToolName: "synapse_reopen_session",
667
+ }),
668
+ createPassthroughTool<{ sessionUuid: string }>({
669
+ name: "synapse_session_heartbeat",
670
+ description: "Session heartbeat (updates lastActiveAt).",
671
+ parameters: {
672
+ type: "object",
673
+ properties: {
674
+ sessionUuid: { type: "string", description: "Session UUID" },
675
+ },
676
+ required: ["sessionUuid"],
677
+ additionalProperties: false,
678
+ },
679
+ targetToolName: "synapse_session_heartbeat",
680
+ }),
681
+ ]);
@@ -0,0 +1,8 @@
1
+ import type { SynapseMcpClient } from "../mcp-client.js";
2
+ import { commonToolDefinitions } from "./common-tool-definitions.js";
3
+ import { registerOpenClawTools } from "./tool-registry.js";
4
+
5
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6
+ export function registerCommonTools(api: any, mcpClient: SynapseMcpClient) {
7
+ registerOpenClawTools(api, mcpClient, commonToolDefinitions);
8
+ }