Skip to main content
Glama

unlock_elements

Modify locked elements in Excalidraw diagrams by unlocking them for editing.

Instructions

Unlock elements to allow modification

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
elementIdsYes

Implementation Reference

  • Main unlock_elements tool handler: parses args using ElementIdsSchema, iterates through element IDs, calls client.updateElement(id, { locked: false }) for each, and returns success count.
    export async function unlockElementsTool(
      args: unknown,
      client: CanvasClient
    ) {
      const { elementIds } = ElementIdsSchema.parse(args);
      let unlockedCount = 0;
    
      for (const id of elementIds) {
        await client.updateElement(id, { locked: false });
        unlockedCount++;
      }
    
      return { success: true, unlockedCount };
    }
  • Tool registration in MCP main server: registers 'unlock_elements' tool with description, schema { elementIds: IdsZ }, and inline async handler that updates elements and returns formatted response.
    // --- Tool: unlock_elements ---
    server.tool(
      'unlock_elements',
      'Unlock elements to allow modification',
      { elementIds: IdsZ },
      async ({ elementIds }) => {
        try {
          let count = 0;
          for (const eid of elementIds) {
            await client.updateElement(eid, { locked: false });
            count++;
          }
          return { content: [{ type: 'text', text: JSON.stringify({ unlockedCount: count }, null, 2) }] };
        } catch (err) {
          return { content: [{ type: 'text', text: `Error: ${(err as Error).message}` }], isError: true };
        }
      }
    );
  • ElementIdsSchema: input validation schema for unlock_elements tool, defines an object with elementIds array (string[], min 1, max MAX_ELEMENT_IDS).
    export const ElementIdsSchema = z
      .object({
        elementIds: z
          .array(z.string().max(LIMITS.MAX_ID_LENGTH))
          .min(1)
          .max(LIMITS.MAX_ELEMENT_IDS),
      })
      .strict();
  • Sandbox server registration: unlock_elements registered with noop handler for capability scanning.
    server.tool('unlock_elements', 'Unlock elements to allow modification', { elementIds: IdsZ }, noop);
  • Export of unlockElementsTool from tools module for use in the MCP server.
    export { unlockElementsTool } from './unlock-elements.js';
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. It mentions 'allow modification', which hints at a state change, but doesn't disclose behavioral traits such as permissions required, whether unlocking is reversible, side effects, or error conditions. This is inadequate for a mutation tool with zero annotation coverage.

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 a single, efficient sentence with zero waste. It's appropriately sized and front-loaded, clearly stating the core action without unnecessary elaboration.

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 complexity of a mutation tool with no annotations, 0% schema coverage, and no output schema, the description is incomplete. It lacks details on behavior, parameters, and expected outcomes, making it insufficient for an agent to use the tool effectively without additional context.

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?

Schema description coverage is 0%, and the description adds no information about the 'elementIds' parameter beyond what the schema provides (an array of strings). It doesn't explain what element IDs are, their format, or how to obtain them, failing to compensate for the coverage gap.

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

Purpose3/5

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

The description 'Unlock elements to allow modification' states the verb ('unlock') and resource ('elements'), but it's vague about what 'elements' are and doesn't distinguish from sibling tools like 'lock_elements' or 'update_element'. It provides a basic purpose but lacks specificity about the domain or system context.

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?

No guidance is provided on when to use this tool versus alternatives like 'lock_elements' or 'update_element'. The description implies usage for enabling modifications but doesn't specify prerequisites, conditions, or exclusions, leaving the agent to infer context from sibling tool names alone.

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

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/debu-sinha/excalidraw-mcp-server'

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