Skip to content

Commit f41eeb0

Browse files
anatoly314claude
andcommitted
Bump version to 1.1.4
- Simplified area/note deletion to use numeric IDs only - Removed title/name lookup fallback for areas and notes - Fixed ESLint no-case-declarations warnings with block scopes - Updated MCP tool descriptions to reflect ID-based lookup 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 9f33180 commit f41eeb0

File tree

6 files changed

+37
-34
lines changed

6 files changed

+37
-34
lines changed

apps/backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "backend",
3-
"version": "1.1.3",
3+
"version": "1.1.4",
44
"description": "Model Context Protocol server for DrawDB - enables AI assistants to create and modify database diagrams via WebSocket",
55
"author": "Anatoly Tarnavsky",
66
"private": true,

apps/backend/src/mcp/primitives/essential/tools/delete-area.tool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class DeleteAreaTool {
1515
description:
1616
'Delete a rectangular area from the diagram. Removes the area grouping but does not affect the tables within it.',
1717
parameters: z.object({
18-
areaId: z.string().describe('Name of the area to delete (areas are identified by their name property)'),
18+
areaId: z.string().describe('ID of the area to delete'),
1919
}),
2020
})
2121
async deleteArea(input: any, context: Context) {

apps/backend/src/mcp/primitives/essential/tools/delete-note.tool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class DeleteNoteTool {
1515
description:
1616
'Delete a sticky note from the diagram. This will remove the note annotation from the canvas.',
1717
parameters: z.object({
18-
noteId: z.string().describe('Title of the note to delete (notes are identified by their title property)'),
18+
noteId: z.string().describe('ID of the note to delete'),
1919
}),
2020
})
2121
async deleteNote(input: any, context: Context) {

apps/backend/src/mcp/primitives/essential/tools/update-area.tool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class UpdateAreaTool {
1515
description:
1616
'Update properties of an existing area in the diagram. Can modify name, position, color, or indices.',
1717
parameters: z.object({
18-
areaId: z.string().describe('Name of the area to update (areas are identified by their name property)'),
18+
areaId: z.string().describe('ID of the area to update'),
1919
name: z.string().optional().describe('New area name'),
2020
x: z.number().optional().describe('New X coordinate on canvas'),
2121
y: z.number().optional().describe('New Y coordinate on canvas'),

apps/backend/src/mcp/primitives/essential/tools/update-note.tool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class UpdateNoteTool {
1515
description:
1616
'Update properties of an existing sticky note in the diagram. Can modify title, content, position, size, or color.',
1717
parameters: z.object({
18-
noteId: z.string().describe('Title of the note to update (notes are identified by their title property)'),
18+
noteId: z.string().describe('ID of the note to update'),
1919
title: z.string().optional().describe('New note title'),
2020
content: z.string().optional().describe('New note content/text'),
2121
x: z.number().optional().describe('New X coordinate on canvas'),

apps/gui/src/hooks/useRemoteControl.js

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -223,24 +223,26 @@ export function useRemoteControl(enabled = false) {
223223
break;
224224

225225
case "deleteArea":
226-
// Areas use numeric array indices, so find by name or numeric ID
227-
const areaToDelete = areas.areas.find((a) => a.name === params.id || a.id === parseInt(params.id, 10));
228-
if (areaToDelete) {
229-
areas.deleteArea(areaToDelete.id, params.addToHistory ?? true);
230-
result = { success: true, message: "Area deleted" };
231-
} else {
232-
throw new Error(`Area with id "${params.id}" not found`);
226+
{
227+
const areaToDelete = areas.areas.find((a) => a.id === parseInt(params.id, 10));
228+
if (areaToDelete) {
229+
areas.deleteArea(areaToDelete.id, params.addToHistory ?? true);
230+
result = { success: true, message: "Area deleted" };
231+
} else {
232+
throw new Error(`Area with id "${params.id}" not found`);
233+
}
233234
}
234235
break;
235236

236237
case "updateArea":
237-
// Areas use numeric array indices, so find by name or numeric ID
238-
const areaToUpdate = areas.areas.find((a) => a.name === params.id || a.id === parseInt(params.id, 10));
239-
if (areaToUpdate) {
240-
areas.updateArea(areaToUpdate.id, params.updates);
241-
result = { success: true, message: "Area updated" };
242-
} else {
243-
throw new Error(`Area with id "${params.id}" not found`);
238+
{
239+
const areaToUpdate = areas.areas.find((a) => a.id === parseInt(params.id, 10));
240+
if (areaToUpdate) {
241+
areas.updateArea(areaToUpdate.id, params.updates);
242+
result = { success: true, message: "Area updated" };
243+
} else {
244+
throw new Error(`Area with id "${params.id}" not found`);
245+
}
244246
}
245247
break;
246248

@@ -251,26 +253,27 @@ export function useRemoteControl(enabled = false) {
251253
break;
252254

253255
case "deleteNote":
254-
// Notes use numeric array indices, so find by title or numeric ID
255-
const noteToDelete = notes.notes.find((n) => n.title === params.id || n.id === parseInt(params.id, 10));
256-
if (noteToDelete) {
257-
notes.deleteNote(noteToDelete.id, params.addToHistory ?? true);
258-
result = { success: true, message: "Note deleted" };
259-
} else {
260-
throw new Error(`Note with id "${params.id}" not found`);
256+
{
257+
const noteToDelete = notes.notes.find((n) => n.id === parseInt(params.id, 10));
258+
if (noteToDelete) {
259+
notes.deleteNote(noteToDelete.id, params.addToHistory ?? true);
260+
result = { success: true, message: "Note deleted" };
261+
} else {
262+
throw new Error(`Note with id "${params.id}" not found`);
263+
}
261264
}
262265
break;
263266

264267
case "updateNote":
265-
// Notes use numeric array indices, so find by title or numeric ID
266-
const noteToUpdate = notes.notes.find((n) => n.title === params.id || n.id === parseInt(params.id, 10));
267-
if (noteToUpdate) {
268-
notes.updateNote(noteToUpdate.id, params.updates);
269-
result = { success: true, message: "Note updated" };
270-
} else {
271-
throw new Error(`Note with id "${params.id}" not found`);
268+
{
269+
const noteToUpdate = notes.notes.find((n) => n.id === parseInt(params.id, 10));
270+
if (noteToUpdate) {
271+
notes.updateNote(noteToUpdate.id, params.updates);
272+
result = { success: true, message: "Note updated" };
273+
} else {
274+
throw new Error(`Note with id "${params.id}" not found`);
275+
}
272276
}
273-
274277
break;
275278

276279
// Enum operations

0 commit comments

Comments
 (0)