@mentagen/mcp 0.4.0 → 0.4.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.
- package/dist/client/helene.js +6 -0
- package/dist/index.js +0 -0
- package/dist/tools/delete.js +32 -0
- package/dist/tools/index.js +24 -2
- package/dist/tools/update.js +7 -1
- package/package.json +1 -1
package/dist/client/helene.js
CHANGED
|
@@ -142,6 +142,12 @@ export class MentagenClient {
|
|
|
142
142
|
async updateBoard(params) {
|
|
143
143
|
return this.call('boards.update', params);
|
|
144
144
|
}
|
|
145
|
+
/**
|
|
146
|
+
* Soft-delete a board.
|
|
147
|
+
*/
|
|
148
|
+
async deleteBoard(params) {
|
|
149
|
+
await this.call('boards.deleteBoard', params);
|
|
150
|
+
}
|
|
145
151
|
/**
|
|
146
152
|
* Add an edge between two nodes.
|
|
147
153
|
*/
|
package/dist/index.js
CHANGED
|
File without changes
|
package/dist/tools/delete.js
CHANGED
|
@@ -4,6 +4,9 @@ export const deleteSchema = z.object({
|
|
|
4
4
|
boardId: z.string().describe('The board ID containing the node'),
|
|
5
5
|
nodeId: z.string().describe('The node ID to delete'),
|
|
6
6
|
});
|
|
7
|
+
export const deleteBoardSchema = z.object({
|
|
8
|
+
boardId: z.string().describe('The board ID to delete'),
|
|
9
|
+
});
|
|
7
10
|
export async function handleDelete(client, params) {
|
|
8
11
|
try {
|
|
9
12
|
await client.deleteNode({
|
|
@@ -34,3 +37,32 @@ export async function handleDelete(client, params) {
|
|
|
34
37
|
};
|
|
35
38
|
}
|
|
36
39
|
}
|
|
40
|
+
export async function handleDeleteBoard(client, params) {
|
|
41
|
+
try {
|
|
42
|
+
await client.deleteBoard({
|
|
43
|
+
boardId: params.boardId,
|
|
44
|
+
});
|
|
45
|
+
return {
|
|
46
|
+
content: [
|
|
47
|
+
{
|
|
48
|
+
type: 'text',
|
|
49
|
+
text: JSON.stringify({
|
|
50
|
+
success: true,
|
|
51
|
+
message: 'Board deleted successfully. This is a soft delete and can be undone in Mentagen.',
|
|
52
|
+
}, null, 2),
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
return {
|
|
59
|
+
content: [
|
|
60
|
+
{
|
|
61
|
+
type: 'text',
|
|
62
|
+
text: `Failed to delete board: ${formatError(error)}`,
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
isError: true,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
}
|
package/dist/tools/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import { createSchema, handleCreate } from './create.js';
|
|
|
10
10
|
import { createBoardSchema, handleCreateBoard } from './create-board.js';
|
|
11
11
|
import { createEdgeSchema, handleCreateEdge } from './create-edge.js';
|
|
12
12
|
import { createGraphSchema, handleCreateGraph } from './create-graph.js';
|
|
13
|
-
import { deleteSchema, handleDelete } from './delete.js';
|
|
13
|
+
import { deleteBoardSchema, deleteSchema, handleDelete, handleDeleteBoard, } from './delete.js';
|
|
14
14
|
import { deleteEdgeSchema, handleDeleteEdge } from './delete-edge.js';
|
|
15
15
|
import { extractBoardContentSchema, handleExtractBoardContent, } from './extract-board-content.js';
|
|
16
16
|
import { findOverlapsSchema, handleFindOverlaps } from './find-overlaps.js';
|
|
@@ -89,6 +89,20 @@ export function registerTools(server, client, config) {
|
|
|
89
89
|
required: ['boardId', 'name'],
|
|
90
90
|
},
|
|
91
91
|
},
|
|
92
|
+
{
|
|
93
|
+
name: 'mentagen_delete_board',
|
|
94
|
+
description: 'Delete a board from Mentagen. CAUTION: Be extra careful when using this tool - verify the board ID and confirm with the user before deleting. This is a soft delete and can be undone in the app, but all nodes and edges in the board will be affected.',
|
|
95
|
+
inputSchema: {
|
|
96
|
+
type: 'object',
|
|
97
|
+
properties: {
|
|
98
|
+
boardId: {
|
|
99
|
+
type: 'string',
|
|
100
|
+
description: 'The board ID to delete',
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
required: ['boardId'],
|
|
104
|
+
},
|
|
105
|
+
},
|
|
92
106
|
// Node tools
|
|
93
107
|
{
|
|
94
108
|
name: 'mentagen_list_nodes',
|
|
@@ -272,7 +286,7 @@ export function registerTools(server, client, config) {
|
|
|
272
286
|
},
|
|
273
287
|
{
|
|
274
288
|
name: 'mentagen_update_node',
|
|
275
|
-
description: 'Update an existing node in Mentagen. When name changes, size auto-adjusts unless explicit width/height provided. Returns the final position and size.',
|
|
289
|
+
description: 'Update an existing node in Mentagen. When name changes, size auto-adjusts unless explicit width/height provided. Can also move nodes between boards using targetBoardId. Returns the final position and size.',
|
|
276
290
|
inputSchema: {
|
|
277
291
|
type: 'object',
|
|
278
292
|
properties: {
|
|
@@ -284,6 +298,10 @@ export function registerTools(server, client, config) {
|
|
|
284
298
|
type: 'string',
|
|
285
299
|
description: 'The node ID to update',
|
|
286
300
|
},
|
|
301
|
+
targetBoardId: {
|
|
302
|
+
type: 'string',
|
|
303
|
+
description: 'Move node to a different board. Preserves type and all properties.',
|
|
304
|
+
},
|
|
287
305
|
name: {
|
|
288
306
|
type: 'string',
|
|
289
307
|
description: 'New name for the node',
|
|
@@ -871,6 +889,10 @@ export function registerTools(server, client, config) {
|
|
|
871
889
|
const params = updateBoardSchema.parse(args);
|
|
872
890
|
return handleUpdateBoard(client, params, config.mentagenUrl);
|
|
873
891
|
},
|
|
892
|
+
mentagen_delete_board: async (args) => {
|
|
893
|
+
const params = deleteBoardSchema.parse(args);
|
|
894
|
+
return handleDeleteBoard(client, params);
|
|
895
|
+
},
|
|
874
896
|
// Node handlers
|
|
875
897
|
mentagen_list_nodes: async (args) => {
|
|
876
898
|
const params = listNodesSchema.parse(args);
|
package/dist/tools/update.js
CHANGED
|
@@ -6,6 +6,10 @@ import { calculateNodeSize } from './size-calc.js';
|
|
|
6
6
|
export const updateSchema = z.object({
|
|
7
7
|
boardId: z.string().describe('The board ID containing the node'),
|
|
8
8
|
nodeId: z.string().describe('The node ID to update'),
|
|
9
|
+
targetBoardId: z
|
|
10
|
+
.string()
|
|
11
|
+
.optional()
|
|
12
|
+
.describe('Move node to a different board. Provide the target board ID to move the node while preserving its type and properties.'),
|
|
9
13
|
name: z.string().optional().describe('New name for the node'),
|
|
10
14
|
content: z.string().optional().describe('Content for text/markdown nodes.'),
|
|
11
15
|
code: z
|
|
@@ -75,6 +79,8 @@ function buildUpdateData(params, nodeType) {
|
|
|
75
79
|
data.name = params.name;
|
|
76
80
|
if (params.color !== undefined)
|
|
77
81
|
data.color = params.color;
|
|
82
|
+
if (params.targetBoardId !== undefined)
|
|
83
|
+
data.board = params.targetBoardId;
|
|
78
84
|
addContentFields(data, params, nodeType);
|
|
79
85
|
for (const field of POSITION_FIELDS) {
|
|
80
86
|
const value = params[field];
|
|
@@ -134,7 +140,7 @@ export async function handleUpdate(client, params) {
|
|
|
134
140
|
content: [
|
|
135
141
|
{
|
|
136
142
|
type: 'text',
|
|
137
|
-
text: `At least one field to update must be provided (name, content, url, color, x, y, width, height).`,
|
|
143
|
+
text: `At least one field to update must be provided (name, content, url, color, x, y, width, height, targetBoardId).`,
|
|
138
144
|
},
|
|
139
145
|
],
|
|
140
146
|
isError: true,
|