Skip to main content
Glama

delete_drawing

Remove a specific Excalidraw drawing by its ID using the Excalidraw MCP Server. This tool simplifies drawing management by allowing users to delete unwanted or outdated diagrams efficiently.

Instructions

Delete an Excalidraw drawing by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes

Implementation Reference

  • The core handler function that deletes the drawing files (content and metadata) for the given ID from the storage directory.
    export async function deleteDrawing(id: string): Promise<void> { 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(`Drawing with ID ${id} not found`); } }
  • Zod schema for validating the input to the delete_drawing tool, requiring an 'id' string.
    export const DeleteDrawingSchema = z.object({ id: z.string().min(1), });
  • index.ts:78-81 (registration)
    Tool registration in the listTools handler, defining name, description, and input schema.
    name: "delete_drawing", description: "Delete an Excalidraw drawing by ID", inputSchema: zodToJsonSchema(drawings.DeleteDrawingSchema), },
  • Dispatcher handler in the main switch statement that parses arguments and calls the deleteDrawing function.
    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) }], }; }

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/i-tozer/excalidraw-mcp'

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