unlock_elements
Unlock selected elements in Excalidraw diagrams to enable editing and modifications, allowing users to update previously locked components.
Instructions
Unlock elements to allow modification
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"elementIds": "<elementIds>"
},
"name": "unlock_elements"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| elementIds | Yes |
Implementation Reference
- src/index.js:553-568 (handler)Handler logic for the unlock_elements tool: parses elementIds, sets locked=false on each matching element in the elements Map, and returns a success response with the list of IDs.
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:254-266 (registration)Registration of the unlock_elements tool in the MCP server capabilities, including description and input schema.
unlock_elements: { description: 'Unlock elements to allow modification', inputSchema: { type: 'object', properties: { elementIds: { type: 'array', items: { type: 'string' } } }, required: ['elementIds'] } }, - src/index.js:52-54 (schema)Zod schema used to parse and validate the input arguments for unlock_elements (and lock_elements), expecting an array of element IDs.
const ElementIdsSchema = z.object({ elementIds: z.array(z.string()) }); - src/index.js:827-840 (registration)Tool listing entry for unlock_elements returned by the ListToolsRequest handler.
{ name: 'unlock_elements', description: 'Unlock elements to allow modification', inputSchema: { type: 'object', properties: { elementIds: { type: 'array', items: { type: 'string' } } }, required: ['elementIds'] } },