Skip to main content
Glama

delete_drawing

Remove an Excalidraw drawing by specifying its unique ID to manage your diagram collection and maintain workspace organization.

Instructions

Delete an Excalidraw drawing by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes

Implementation Reference

  • Core implementation of deleteDrawing: removes the drawing content and metadata files 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`); } }
  • MCP tool call handler: parses input with schema and invokes the 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) }], };
  • index.ts:78-81 (registration)
    Registration of the delete_drawing tool in the ListTools response, specifying name, description, and input schema.
    name: "delete_drawing", description: "Delete an Excalidraw drawing by ID", inputSchema: zodToJsonSchema(drawings.DeleteDrawingSchema), },
  • Zod input schema validation for delete_drawing tool: requires a non-empty string 'id'.
    export const DeleteDrawingSchema = z.object({ id: z.string().min(1), });

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