Skip to main content
Glama

delete_drawing

Remove an Excalidraw drawing by specifying its ID to manage and organize your diagram collection.

Instructions

Delete an Excalidraw drawing by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes

Implementation Reference

  • Core handler function that implements the deletion logic for a drawing by ID. Validates the ID, checks existence, deletes the content (.json) and metadata (.meta.json) files from storage, and handles errors appropriately.
    export async function deleteDrawing(id: string): Promise<void> {
      // Validate the ID for security
      validateFileId(id);
    
      await ensureStorageDir();
    
      // Get the drawing file path
      const filePath = path.join(STORAGE_DIR, `${id}.json`);
      const metadataPath = path.join(STORAGE_DIR, `${id}.meta.json`);
    
      try {
        // Check if the drawing exists
        await fs.access(filePath);
    
        // Delete the drawing file
        await fs.unlink(filePath);
    
        // Delete the metadata file
        await fs.unlink(metadataPath);
      } catch (error) {
        throw new ExcalidrawResourceNotFoundError(
          sanitizeErrorMessage(error, `Drawing with ID ${id} not found`)
        );
      }
    }
  • Zod input schema for the delete_drawing tool, validating that 'id' is a non-empty string.
    export const DeleteDrawingSchema = z.object({
      id: z.string().min(1),
    });
  • src/index.ts:80-84 (registration)
    Tool registration in the listTools handler, defining the name, description, and input schema for delete_drawing.
    {
      name: "delete_drawing",
      description: "Delete an Excalidraw drawing by ID",
      inputSchema: zodToJsonSchema(drawings.DeleteDrawingSchema),
    },
  • MCP callTool dispatcher for delete_drawing: parses arguments using the schema, calls the core deleteDrawing handler, and returns success response.
    case "delete_drawing": {
      const args = drawings.DeleteDrawingSchema.parse(
        request.params.arguments
      );
      await drawings.deleteDrawing(args.id);
      return {
        content: [
          { type: "text", text: JSON.stringify({ success: true }, null, 2) },
        ],
      };
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action is 'Delete,' implying a destructive mutation, but doesn't elaborate on consequences (e.g., permanent removal, no undo), permissions required, rate limits, or error handling. This is a significant gap for a destructive 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, front-loaded sentence with zero waste—it directly states the tool's purpose without extraneous details. Every word earns its place, making it highly efficient for quick comprehension.

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's destructive nature, lack of annotations, no output schema, and minimal parameter documentation, the description is incomplete. It doesn't address behavioral risks, return values, or error cases, which are critical for safe and effective use by an AI agent in a context with siblings like 'create_drawing' and 'update_drawing'.

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

Parameters4/5

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

The description adds meaningful context beyond the input schema by specifying that the 'id' parameter refers to 'an Excalidraw drawing,' which clarifies the resource type. Since there's only one parameter and schema description coverage is 0%, this compensates well, though it doesn't detail ID format or sourcing (e.g., from 'list_drawings').

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 clearly states the action ('Delete') and the resource ('an Excalidraw drawing by ID'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from siblings like 'update_drawing' or 'get_drawing' beyond the verb, which would require more specific context about what deletion entails versus modification or retrieval.

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., needing an existing drawing ID), exclusions (e.g., not for bulk deletion), or suggest alternatives like 'update_drawing' for modifications, leaving the agent to infer usage from the tool name 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/andreswebs-public-images/excalidraw-mcp'

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