@mentagen/mcp 0.4.0 → 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.
- package/dist/client/helene.js +22 -3
- package/dist/tools/boards.js +20 -4
- package/dist/tools/create-board.js +6 -0
- package/dist/tools/delete.js +32 -0
- package/dist/tools/index.js +83 -5
- package/dist/tools/list-organizations.js +46 -0
- package/dist/tools/list-teams.js +47 -0
- package/dist/tools/search.js +5 -0
- package/dist/tools/update-board.js +18 -2
- package/dist/tools/update.js +7 -1
- package/package.json +1 -1
package/dist/client/helene.js
CHANGED
|
@@ -64,9 +64,10 @@ export class MentagenClient {
|
|
|
64
64
|
/**
|
|
65
65
|
* List boards the user has access to.
|
|
66
66
|
*/
|
|
67
|
-
async listBoards() {
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
async listBoards(params) {
|
|
68
|
+
return this.call('boards.listSimple', {
|
|
69
|
+
orgId: params?.orgId,
|
|
70
|
+
});
|
|
70
71
|
}
|
|
71
72
|
/**
|
|
72
73
|
* Search boards by name.
|
|
@@ -84,6 +85,18 @@ export class MentagenClient {
|
|
|
84
85
|
async searchNodes(params) {
|
|
85
86
|
return this.call('boards.searchNodesText', params);
|
|
86
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* List organizations the user has access to.
|
|
90
|
+
*/
|
|
91
|
+
async listOrganizations() {
|
|
92
|
+
return this.call('org.list', {});
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* List teams within an organization.
|
|
96
|
+
*/
|
|
97
|
+
async listTeams(params) {
|
|
98
|
+
return this.call('team.list', params);
|
|
99
|
+
}
|
|
87
100
|
/**
|
|
88
101
|
* Add a new node to a board.
|
|
89
102
|
*/
|
|
@@ -142,6 +155,12 @@ export class MentagenClient {
|
|
|
142
155
|
async updateBoard(params) {
|
|
143
156
|
return this.call('boards.update', params);
|
|
144
157
|
}
|
|
158
|
+
/**
|
|
159
|
+
* Soft-delete a board.
|
|
160
|
+
*/
|
|
161
|
+
async deleteBoard(params) {
|
|
162
|
+
await this.call('boards.deleteBoard', params);
|
|
163
|
+
}
|
|
145
164
|
/**
|
|
146
165
|
* Add an edge between two nodes.
|
|
147
166
|
*/
|
package/dist/tools/boards.js
CHANGED
|
@@ -3,7 +3,12 @@ import { z } from 'zod';
|
|
|
3
3
|
import { formatShortDate } from '../utils/ejson.js';
|
|
4
4
|
import { formatError } from '../utils/errors.js';
|
|
5
5
|
import { getBoardUrl } from '../utils/urls.js';
|
|
6
|
-
export const boardsSchema = z.object({
|
|
6
|
+
export const boardsSchema = z.object({
|
|
7
|
+
orgId: z
|
|
8
|
+
.string()
|
|
9
|
+
.optional()
|
|
10
|
+
.describe('Optional organization ID to filter boards'),
|
|
11
|
+
});
|
|
7
12
|
/**
|
|
8
13
|
* Format boards as TSV for compact output.
|
|
9
14
|
* Uses papaparse for proper escaping of special characters.
|
|
@@ -13,18 +18,29 @@ function formatBoardsTsv(boards) {
|
|
|
13
18
|
delimiter: '\t',
|
|
14
19
|
header: true,
|
|
15
20
|
newline: '\n',
|
|
16
|
-
columns: [
|
|
21
|
+
columns: [
|
|
22
|
+
'id',
|
|
23
|
+
'name',
|
|
24
|
+
'description',
|
|
25
|
+
'nodeCount',
|
|
26
|
+
'updatedAt',
|
|
27
|
+
'org',
|
|
28
|
+
'teams',
|
|
29
|
+
'link',
|
|
30
|
+
],
|
|
17
31
|
});
|
|
18
32
|
}
|
|
19
|
-
export async function handleBoards(client,
|
|
33
|
+
export async function handleBoards(client, params, baseUrl) {
|
|
20
34
|
try {
|
|
21
|
-
const boards = await client.listBoards();
|
|
35
|
+
const boards = await client.listBoards({ orgId: params.orgId });
|
|
22
36
|
const formatted = boards.map(board => ({
|
|
23
37
|
id: board._id,
|
|
24
38
|
name: board.name,
|
|
25
39
|
description: board.description || '',
|
|
26
40
|
nodeCount: board.nodeCount ?? 0,
|
|
27
41
|
updatedAt: formatShortDate(board.updatedAt),
|
|
42
|
+
org: board.org || '',
|
|
43
|
+
teams: board.teams?.join(',') || '',
|
|
28
44
|
link: getBoardUrl(baseUrl, board._id),
|
|
29
45
|
}));
|
|
30
46
|
return {
|
|
@@ -4,6 +4,11 @@ import { formatError } from '../utils/errors.js';
|
|
|
4
4
|
import { getBoardUrl } from '../utils/urls.js';
|
|
5
5
|
export const createBoardSchema = z.object({
|
|
6
6
|
name: z.string().min(1).describe('The name for the new board'),
|
|
7
|
+
orgId: z
|
|
8
|
+
.string()
|
|
9
|
+
.length(24)
|
|
10
|
+
.optional()
|
|
11
|
+
.describe('Optional organization ID to create the board in'),
|
|
7
12
|
});
|
|
8
13
|
function generateObjectId() {
|
|
9
14
|
const timestamp = Math.floor(Date.now() / 1000)
|
|
@@ -18,6 +23,7 @@ export async function handleCreateBoard(client, params, baseUrl) {
|
|
|
18
23
|
const board = await client.createBoard({
|
|
19
24
|
_id: boardId,
|
|
20
25
|
name: params.name,
|
|
26
|
+
org: params.orgId,
|
|
21
27
|
});
|
|
22
28
|
const result = {
|
|
23
29
|
success: true,
|
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';
|
|
@@ -19,7 +19,9 @@ import { gridCalcSchema, handleGridCalc } from './grid-calc.js';
|
|
|
19
19
|
import { handleLink, linkSchema } from './link.js';
|
|
20
20
|
import { handleListEdges, listEdgesSchema } from './list-edges.js';
|
|
21
21
|
import { handleListNodes, listNodesSchema } from './list-nodes.js';
|
|
22
|
+
import { handleListOrganizations, listOrganizationsSchema, } from './list-organizations.js';
|
|
22
23
|
import { handleListPositions, listPositionsSchema } from './list-positions.js';
|
|
24
|
+
import { handleListTeams, listTeamsSchema } from './list-teams.js';
|
|
23
25
|
import { handleNodeTypes, nodeTypesSchema } from './node-types.js';
|
|
24
26
|
import { handlePatchContent, patchContentSchema } from './patch-content.js';
|
|
25
27
|
import { handleRead, readSchema } from './read.js';
|
|
@@ -40,7 +42,12 @@ export function registerTools(server, client, config) {
|
|
|
40
42
|
description: 'List all boards you have access to in Mentagen. Returns board IDs, names, node counts, and direct links.',
|
|
41
43
|
inputSchema: {
|
|
42
44
|
type: 'object',
|
|
43
|
-
properties: {
|
|
45
|
+
properties: {
|
|
46
|
+
orgId: {
|
|
47
|
+
type: 'string',
|
|
48
|
+
description: 'Optional organization ID to filter boards',
|
|
49
|
+
},
|
|
50
|
+
},
|
|
44
51
|
},
|
|
45
52
|
},
|
|
46
53
|
{
|
|
@@ -67,13 +74,17 @@ export function registerTools(server, client, config) {
|
|
|
67
74
|
type: 'string',
|
|
68
75
|
description: 'The name for the new board',
|
|
69
76
|
},
|
|
77
|
+
orgId: {
|
|
78
|
+
type: 'string',
|
|
79
|
+
description: 'Optional organization ID to create the board in. Board will belong to the user without team assignment.',
|
|
80
|
+
},
|
|
70
81
|
},
|
|
71
82
|
required: ['name'],
|
|
72
83
|
},
|
|
73
84
|
},
|
|
74
85
|
{
|
|
75
86
|
name: 'mentagen_update_board',
|
|
76
|
-
description: 'Update a board
|
|
87
|
+
description: 'Update a board in Mentagen. Can update name, org, and team assignments.',
|
|
77
88
|
inputSchema: {
|
|
78
89
|
type: 'object',
|
|
79
90
|
properties: {
|
|
@@ -85,8 +96,54 @@ export function registerTools(server, client, config) {
|
|
|
85
96
|
type: 'string',
|
|
86
97
|
description: 'New name for the board',
|
|
87
98
|
},
|
|
99
|
+
org: {
|
|
100
|
+
type: ['string', 'null'],
|
|
101
|
+
description: 'Organization ID to assign the board to. Set to null to remove from organization.',
|
|
102
|
+
},
|
|
103
|
+
teams: {
|
|
104
|
+
type: 'array',
|
|
105
|
+
items: { type: 'string' },
|
|
106
|
+
description: 'Array of team IDs to assign to this board. Use mentagen_list_teams to get team IDs for an org.',
|
|
107
|
+
},
|
|
88
108
|
},
|
|
89
|
-
required: ['boardId'
|
|
109
|
+
required: ['boardId'],
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
name: 'mentagen_delete_board',
|
|
114
|
+
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.',
|
|
115
|
+
inputSchema: {
|
|
116
|
+
type: 'object',
|
|
117
|
+
properties: {
|
|
118
|
+
boardId: {
|
|
119
|
+
type: 'string',
|
|
120
|
+
description: 'The board ID to delete',
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
required: ['boardId'],
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
// Organization tools
|
|
127
|
+
{
|
|
128
|
+
name: 'mentagen_list_organizations',
|
|
129
|
+
description: 'List all organizations you are a member of. Returns organization IDs, names, your role, member counts, and direct links.',
|
|
130
|
+
inputSchema: {
|
|
131
|
+
type: 'object',
|
|
132
|
+
properties: {},
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
name: 'mentagen_list_teams',
|
|
137
|
+
description: 'List all teams within an organization. Returns team IDs, names, member counts, and whether it is a system team.',
|
|
138
|
+
inputSchema: {
|
|
139
|
+
type: 'object',
|
|
140
|
+
properties: {
|
|
141
|
+
orgId: {
|
|
142
|
+
type: 'string',
|
|
143
|
+
description: 'The organization ID to list teams from',
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
required: ['orgId'],
|
|
90
147
|
},
|
|
91
148
|
},
|
|
92
149
|
// Node tools
|
|
@@ -159,6 +216,10 @@ export function registerTools(server, client, config) {
|
|
|
159
216
|
type: 'string',
|
|
160
217
|
description: 'Optional board ID to limit search scope',
|
|
161
218
|
},
|
|
219
|
+
org: {
|
|
220
|
+
type: 'string',
|
|
221
|
+
description: 'Optional organization ID to limit search to boards in that organization',
|
|
222
|
+
},
|
|
162
223
|
limit: {
|
|
163
224
|
type: 'number',
|
|
164
225
|
description: 'Maximum number of results (default: 10)',
|
|
@@ -272,7 +333,7 @@ export function registerTools(server, client, config) {
|
|
|
272
333
|
},
|
|
273
334
|
{
|
|
274
335
|
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.',
|
|
336
|
+
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
337
|
inputSchema: {
|
|
277
338
|
type: 'object',
|
|
278
339
|
properties: {
|
|
@@ -284,6 +345,10 @@ export function registerTools(server, client, config) {
|
|
|
284
345
|
type: 'string',
|
|
285
346
|
description: 'The node ID to update',
|
|
286
347
|
},
|
|
348
|
+
targetBoardId: {
|
|
349
|
+
type: 'string',
|
|
350
|
+
description: 'Move node to a different board. Preserves type and all properties.',
|
|
351
|
+
},
|
|
287
352
|
name: {
|
|
288
353
|
type: 'string',
|
|
289
354
|
description: 'New name for the node',
|
|
@@ -871,6 +936,19 @@ export function registerTools(server, client, config) {
|
|
|
871
936
|
const params = updateBoardSchema.parse(args);
|
|
872
937
|
return handleUpdateBoard(client, params, config.mentagenUrl);
|
|
873
938
|
},
|
|
939
|
+
mentagen_delete_board: async (args) => {
|
|
940
|
+
const params = deleteBoardSchema.parse(args);
|
|
941
|
+
return handleDeleteBoard(client, params);
|
|
942
|
+
},
|
|
943
|
+
// Organization handlers
|
|
944
|
+
mentagen_list_organizations: async (args) => {
|
|
945
|
+
listOrganizationsSchema.parse(args);
|
|
946
|
+
return handleListOrganizations(client, config.mentagenUrl);
|
|
947
|
+
},
|
|
948
|
+
mentagen_list_teams: async (args) => {
|
|
949
|
+
const params = listTeamsSchema.parse(args);
|
|
950
|
+
return handleListTeams(client, params);
|
|
951
|
+
},
|
|
874
952
|
// Node handlers
|
|
875
953
|
mentagen_list_nodes: async (args) => {
|
|
876
954
|
const params = listNodesSchema.parse(args);
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import Papa from 'papaparse';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { formatError } from '../utils/errors.js';
|
|
4
|
+
export const listOrganizationsSchema = z.object({});
|
|
5
|
+
export async function handleListOrganizations(client, baseUrl) {
|
|
6
|
+
try {
|
|
7
|
+
const organizations = await client.listOrganizations();
|
|
8
|
+
if (organizations.length === 0) {
|
|
9
|
+
return {
|
|
10
|
+
content: [
|
|
11
|
+
{
|
|
12
|
+
type: 'text',
|
|
13
|
+
text: 'No organizations found. You are not a member of any organization.',
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
const rows = organizations.map(org => ({
|
|
19
|
+
id: org._id,
|
|
20
|
+
name: org.name,
|
|
21
|
+
role: org.role?.type ?? '',
|
|
22
|
+
memberCount: org.members ?? 0,
|
|
23
|
+
link: `${baseUrl}/org/${org._id}`,
|
|
24
|
+
}));
|
|
25
|
+
const tsv = Papa.unparse(rows, {
|
|
26
|
+
delimiter: '\t',
|
|
27
|
+
header: true,
|
|
28
|
+
newline: '\n',
|
|
29
|
+
columns: ['id', 'name', 'role', 'memberCount', 'link'],
|
|
30
|
+
});
|
|
31
|
+
return {
|
|
32
|
+
content: [{ type: 'text', text: tsv }],
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
return {
|
|
37
|
+
content: [
|
|
38
|
+
{
|
|
39
|
+
type: 'text',
|
|
40
|
+
text: `Failed to list organizations: ${formatError(error)}`,
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
isError: true,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import Papa from 'papaparse';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { formatError } from '../utils/errors.js';
|
|
4
|
+
export const listTeamsSchema = z.object({
|
|
5
|
+
orgId: z.string().describe('The organization ID to list teams from'),
|
|
6
|
+
});
|
|
7
|
+
export async function handleListTeams(client, params) {
|
|
8
|
+
try {
|
|
9
|
+
const teams = await client.listTeams({ orgId: params.orgId });
|
|
10
|
+
if (teams.length === 0) {
|
|
11
|
+
return {
|
|
12
|
+
content: [
|
|
13
|
+
{
|
|
14
|
+
type: 'text',
|
|
15
|
+
text: 'No teams found in this organization.',
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
const rows = teams.map(team => ({
|
|
21
|
+
id: team._id,
|
|
22
|
+
name: team.name,
|
|
23
|
+
memberCount: team.members?.length ?? 0,
|
|
24
|
+
isSystemTeam: team.systemType === 'general',
|
|
25
|
+
}));
|
|
26
|
+
const tsv = Papa.unparse(rows, {
|
|
27
|
+
delimiter: '\t',
|
|
28
|
+
header: true,
|
|
29
|
+
newline: '\n',
|
|
30
|
+
columns: ['id', 'name', 'memberCount', 'isSystemTeam'],
|
|
31
|
+
});
|
|
32
|
+
return {
|
|
33
|
+
content: [{ type: 'text', text: tsv }],
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
return {
|
|
38
|
+
content: [
|
|
39
|
+
{
|
|
40
|
+
type: 'text',
|
|
41
|
+
text: `Failed to list teams: ${formatError(error)}`,
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
isError: true,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
}
|
package/dist/tools/search.js
CHANGED
|
@@ -11,6 +11,10 @@ export const searchSchema = z.object({
|
|
|
11
11
|
.string()
|
|
12
12
|
.optional()
|
|
13
13
|
.describe('Optional board ID to limit search scope'),
|
|
14
|
+
org: z
|
|
15
|
+
.string()
|
|
16
|
+
.optional()
|
|
17
|
+
.describe('Optional organization ID to limit search to boards in that organization'),
|
|
14
18
|
limit: z
|
|
15
19
|
.number()
|
|
16
20
|
.default(10)
|
|
@@ -59,6 +63,7 @@ export async function handleSearch(client, params, baseUrl) {
|
|
|
59
63
|
const results = await client.searchNodes({
|
|
60
64
|
query: params.query,
|
|
61
65
|
board: params.board,
|
|
66
|
+
org: params.org,
|
|
62
67
|
semanticRatio: params.semanticRatio,
|
|
63
68
|
});
|
|
64
69
|
const formatted = formatSearchResults(results.hits.slice(0, params.limit));
|
|
@@ -14,11 +14,23 @@ export const updateBoardSchema = z
|
|
|
14
14
|
.url()
|
|
15
15
|
.optional()
|
|
16
16
|
.describe('Pull request URL for this board'),
|
|
17
|
+
org: z
|
|
18
|
+
.string()
|
|
19
|
+
.length(24)
|
|
20
|
+
.optional()
|
|
21
|
+
.nullable()
|
|
22
|
+
.describe('Organization ID. Set to null to remove from organization.'),
|
|
23
|
+
teams: z
|
|
24
|
+
.array(z.string().length(24))
|
|
25
|
+
.optional()
|
|
26
|
+
.describe('Array of team IDs to assign to this board'),
|
|
17
27
|
})
|
|
18
28
|
.refine(data => data.name !== undefined ||
|
|
19
29
|
data.description !== undefined ||
|
|
20
|
-
data.pullRequestUrl !== undefined
|
|
21
|
-
|
|
30
|
+
data.pullRequestUrl !== undefined ||
|
|
31
|
+
data.org !== undefined ||
|
|
32
|
+
data.teams !== undefined, {
|
|
33
|
+
message: 'At least one field (name, description, pullRequestUrl, org, or teams) must be provided',
|
|
22
34
|
});
|
|
23
35
|
export async function handleUpdateBoard(client, params, baseUrl) {
|
|
24
36
|
try {
|
|
@@ -29,6 +41,10 @@ export async function handleUpdateBoard(client, params, baseUrl) {
|
|
|
29
41
|
data.description = params.description;
|
|
30
42
|
if (params.pullRequestUrl !== undefined)
|
|
31
43
|
data.pullRequestUrl = params.pullRequestUrl;
|
|
44
|
+
if (params.org !== undefined)
|
|
45
|
+
data.org = params.org;
|
|
46
|
+
if (params.teams !== undefined)
|
|
47
|
+
data.teams = params.teams;
|
|
32
48
|
const board = await client.updateBoard({
|
|
33
49
|
boardId: params.boardId,
|
|
34
50
|
data,
|
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,
|