Skip to main content
Glama

export_to_svg

Convert Excalidraw drawings to SVG format for scalable vector graphics that maintain quality at any size.

Instructions

Export an Excalidraw drawing to SVG

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes

Implementation Reference

  • Executes the core logic of exporting an Excalidraw drawing to SVG format. Validates ID, fetches drawing, and returns SVG content (placeholder in this impl).
    export async function exportToSvg(id: string): Promise<string> { // Validate the ID for security validateFileId(id); try { // Get the drawing const drawing = await getDrawing(id); // Return the SVG content // Note: In a real implementation, we would use the Excalidraw API to convert the drawing to SVG // For now, we'll just return a placeholder return `<svg> <text x="10" y="20">Drawing: ${drawing.name}</text> <text x="10" y="40">This is a placeholder for the SVG export.</text> </svg>`; } catch (error) { if (error instanceof ExcalidrawResourceNotFoundError) { throw error; } throw new Error( sanitizeErrorMessage(error, "Failed to export drawing to SVG") ); } }
  • Zod schema defining the input parameters for the export_to_svg tool (requires 'id' string).
    export const ExportToSvgSchema = z.object({ id: z.string().min(1), });
  • src/index.ts:91-94 (registration)
    Registers the export_to_svg tool in the MCP server's listTools response with name, description, and input schema.
    name: "export_to_svg", description: "Export an Excalidraw drawing to SVG", inputSchema: zodToJsonSchema(exportOps.ExportToSvgSchema), },
  • MCP server request handler dispatches calls to export_to_svg by parsing arguments and invoking the exportToSvg function.
    case "export_to_svg": { const args = exportOps.ExportToSvgSchema.parse( request.params.arguments ); const result = await exportOps.exportToSvg(args.id); return { content: [{ type: "text", text: result }], }; }

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