Skip to main content
Glama

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
NameRequiredDescriptionDefault
elementIdsYes

Implementation Reference

  • 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'] }
  • 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()) });
  • 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'] }

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Abdullah007bajwa/mcp_excalidraw'

If you have feedback or need assistance with the MCP directory API, please join our Discord server