Skip to main content
Glama

export_to_json

Convert an Excalidraw drawing into JSON format using the provided drawing ID, enabling easy data integration and sharing.

Instructions

Export an Excalidraw drawing to JSON

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes

Implementation Reference

  • Core handler function that fetches the drawing by ID and returns its JSON content.
    export async function exportToJson(id: string): Promise<string> { try { // Get the drawing const drawing = await getDrawing(id); // Return the JSON content return drawing.content; } catch (error) { if (error instanceof ExcalidrawResourceNotFoundError) { throw error; } throw new Error(`Failed to export drawing to JSON: ${(error as Error).message}`); } }
  • Zod schema defining the input for the export_to_json tool (requires 'id' string).
    export const ExportToJsonSchema = z.object({ id: z.string().min(1), });
  • index.ts:97-101 (registration)
    Registration of the export_to_json tool in the ListTools response, including name, description, and schema reference.
    { name: "export_to_json", description: "Export an Excalidraw drawing to JSON", inputSchema: zodToJsonSchema(exportOps.ExportToJsonSchema), },

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