unlock_elements
Enable modification of specific elements in Excalidraw diagrams by unlocking them through structured API requests, facilitating dynamic updates and adjustments.
Instructions
Unlock elements to allow modification
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| elementIds | Yes |
Implementation Reference
- src/index.js:553-568 (handler)The main handler for the 'unlock_elements' tool. Parses input using ElementIdsSchema, iterates over the element IDs, sets locked=false on each existing element, and returns a success message.case 'unlock_elements': { const params = ElementIdsSchema.parse(args); const { elementIds } = params; elementIds.forEach(id => { const element = elements.get(id); if (element) { element.locked = false; } }); const result = { unlocked: true, elementIds }; return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
- src/index.js:52-54 (schema)Zod schema used for input validation in the unlock_elements handler, defining an object with an array of element ID strings.const ElementIdsSchema = z.object({ elementIds: z.array(z.string()) });
- src/index.js:254-266 (registration)Registration of the 'unlock_elements' tool in the MCP server capabilities, providing description and JSON input schema.unlock_elements: { description: 'Unlock elements to allow modification', inputSchema: { type: 'object', properties: { elementIds: { type: 'array', items: { type: 'string' } } }, required: ['elementIds'] } },