Skip to main content
Glama

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

Implementation Reference

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

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