Skip to main content
Glama

delete_drawing

Remove an existing Excalidraw drawing by specifying its unique identifier to manage your diagram collection and free up storage space.

Instructions

Delete an Excalidraw drawing by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes

Implementation Reference

  • Core implementation of delete_drawing tool: validates ID, ensures storage dir, deletes the drawing content and metadata files.
    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 schema for validating input to delete_drawing: requires a string ID.
    export const DeleteDrawingSchema = z.object({ id: z.string().min(1), });
  • src/index.ts:80-84 (registration)
    Registration of delete_drawing tool in the MCP server's listTools handler, including name, description, and schema.
    { name: "delete_drawing", description: "Delete an Excalidraw drawing by ID", inputSchema: zodToJsonSchema(drawings.DeleteDrawingSchema), },
  • MCP server dispatch handler for delete_drawing: parses arguments using schema and calls the core deleteDrawing function, 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) }, ], }; }

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