Skip to main content
Glama
yctimlin

Excalidraw MCP Server

by yctimlin

unlock_elements

Modify Excalidraw diagram elements by unlocking them. Input element IDs to enable editing and updates within the Excalidraw MCP Server.

Instructions

Unlock elements to allow modification

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
elementIdsYes

Implementation Reference

  • Executes the unlock_elements tool by parsing input elementIds, updating each element's 'locked' property to false via the canvas API, awaiting all updates, counting successful updates, and returning a success summary or error.
    case 'unlock_elements': {
      const params = ElementIdsSchema.parse(args);
      const { elementIds } = params;
      
      try {
        // Unlock elements through HTTP API updates
        const updatePromises = elementIds.map(async (id) => {
          return await updateElementOnCanvas({ id, locked: false });
        });
        
        const results = await Promise.all(updatePromises);
        const successCount = results.filter(result => result).length;
        
        if (successCount === 0) {
          throw new Error('Failed to unlock any elements: HTTP server unavailable');
        }
        
        const result = { unlocked: true, elementIds, successCount };
        return {
          content: [{ type: 'text', text: JSON.stringify(result, null, 2) }]
        };
      } catch (error) {
        throw new Error(`Failed to unlock elements: ${(error as Error).message}`);
      }
    }
  • src/index.ts:403-416 (registration)
    Registers the unlock_elements tool in the tools array, including its name, description, and input schema requiring an array of elementIds.
    {
      name: 'unlock_elements',
      description: 'Unlock elements to allow modification',
      inputSchema: {
        type: 'object',
        properties: {
          elementIds: { 
            type: 'array',
            items: { type: 'string' }
          }
        },
        required: ['elementIds']
      }
    },
  • Zod schema used for input validation in the unlock_elements handler, defining elementIds as an array of strings.
    const ElementIdsSchema = z.object({
      elementIds: z.array(z.string())
    });
  • Helper function called by the handler to update an individual element on the canvas, setting locked: false, via syncToCanvas.
    async function updateElementOnCanvas(elementData: Partial<ServerElement> & { id: string }): Promise<ServerElement | null> {
      const result = await syncToCanvas('update', elementData);
      return result?.element || null;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action ('unlock') and outcome ('allow modification'), but doesn't describe permissions required, whether unlocking is reversible, side effects (e.g., if other users can now modify elements), rate limits, or error conditions. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise ('Unlock elements to allow modification')—a single, front-loaded sentence with zero wasted words. It efficiently communicates the core purpose without unnecessary elaboration, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 1 parameter with 0% schema coverage, no annotations, no output schema, and siblings indicating it's part of a mutation workflow (e.g., with 'lock_elements', 'update_element'), the description is incomplete. It doesn't cover parameter details, behavioral traits like permissions or side effects, or usage context relative to siblings, making it inadequate for safe and effective use by an AI agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 1 parameter ('elementIds') with 0% description coverage, and the tool description provides no information about parameters. It doesn't explain what 'elementIds' are (e.g., identifiers of UI elements, database records), their format, or constraints (e.g., must be locked elements). With low schema coverage, the description fails to compensate, leaving parameters undocumented.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Unlock elements to allow modification' clearly states the verb ('unlock') and resource ('elements'), and specifies the purpose ('to allow modification'). It distinguishes from siblings like 'lock_elements' (opposite action) and 'update_element' (requires unlocked state). However, it doesn't explicitly differentiate from all siblings like 'align_elements' or 'group_elements' in terms of when unlocking is necessary versus other operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., elements must be locked first), when not to use it (e.g., if elements are already unlocked), or alternatives (e.g., using 'update_element' directly if elements are unlocked). Given the sibling tools include 'lock_elements', some context could have been added about the workflow.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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/yctimlin/mcp_excalidraw'

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