lock_elements
Prevent modification of specific elements in Excalidraw diagrams by locking them. Use this tool to maintain the integrity of selected components during collaborative editing or diagram updates.
Instructions
Lock elements to prevent modification
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| elementIds | Yes |
Implementation Reference
- src/index.js:536-551 (handler)Handler for the 'lock_elements' tool call. It parses the input arguments using ElementIdsSchema, iterates over the provided elementIds, sets the 'locked' property to true on each existing element, and returns a success response with the list of element IDs.case 'lock_elements': { const params = ElementIdsSchema.parse(args); const { elementIds } = params; elementIds.forEach(id => { const element = elements.get(id); if (element) { element.locked = true; } }); const result = { locked: true, elementIds }; return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
- src/index.js:241-252 (registration)Registration of the 'lock_elements' tool in the MCP server's capabilities object, defining its description and input schema (requiring an array of elementIds).lock_elements: { description: 'Lock elements to prevent modification', inputSchema: { type: 'object', properties: { elementIds: { type: 'array', items: { type: 'string' } } }, required: ['elementIds'] }
- src/index.js:52-54 (schema)Zod schema definition for input validation of tools requiring an array of element IDs, used by the lock_elements handler.const ElementIdsSchema = z.object({ elementIds: z.array(z.string()) });
- src/index.js:814-825 (schema)Schema and details for 'lock_elements' tool provided in the ListToolsRequestHandler response.name: 'lock_elements', description: 'Lock elements to prevent modification', inputSchema: { type: 'object', properties: { elementIds: { type: 'array', items: { type: 'string' } } }, required: ['elementIds'] }