Skip to main content
Glama

delete_element

Remove a specific element from an Excalidraw diagram by providing its unique ID, enabling precise diagram editing and management.

Instructions

Delete an Excalidraw element

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes

Implementation Reference

  • The handler function for the 'delete_element' tool. It validates the input using ElementIdSchema, checks if the element exists in the in-memory store, deletes it using elements.delete(id), and returns a confirmation message.
    case 'delete_element': { const params = ElementIdSchema.parse(args); const { id } = params; if (!elements.has(id)) throw new Error(`Element with ID ${id} not found`); elements.delete(id); return { content: [{ type: 'text', text: JSON.stringify({ id, deleted: true }, null, 2) }] }; }
  • Zod schema used for input validation in the delete_element handler, defining the required 'id' parameter.
    const ElementIdSchema = z.object({ id: z.string() });
  • src/index.js:145-154 (registration)
    Tool registration in the MCP server capabilities, including description and input schema for delete_element.
    delete_element: { description: 'Delete an Excalidraw element', inputSchema: { type: 'object', properties: { id: { type: 'string' } }, required: ['id'] } },
  • Duplicate schema definition for delete_element in the ListToolsRequestHandler response.
    name: 'delete_element', description: 'Delete an Excalidraw element', inputSchema: { type: 'object', properties: { id: { type: 'string' } }, required: ['id'] }

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/Abdullah007bajwa/mcp_excalidraw'

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