Skip to main content
Glama

create_drawing

Generate a new Excalidraw drawing by providing a name and content. This tool enables diagram creation through natural language commands.

Instructions

Create a new Excalidraw drawing

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
contentYes

Implementation Reference

  • The core handler function that implements the create_drawing tool logic: generates a unique ID, saves the drawing content to a JSON file, creates metadata, and returns the ID and name.
    export async function createDrawing(
      name: string,
      content: string
    ): Promise<{ id: string; name: string }> {
      await ensureStorageDir();
    
      // Generate a unique ID for the drawing
      const id = `${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
    
      // Create the drawing file
      const filePath = path.join(STORAGE_DIR, `${id}.json`);
    
      // Save the drawing content
      await fs.writeFile(filePath, content, "utf-8");
    
      // Create a metadata file for the drawing
      const metadataPath = path.join(STORAGE_DIR, `${id}.meta.json`);
      const metadata = {
        id,
        name,
        createdAt: new Date().toISOString(),
        updatedAt: new Date().toISOString(),
      };
    
      await fs.writeFile(metadataPath, JSON.stringify(metadata, null, 2), "utf-8");
    
      return { id, name };
    }
  • Zod schema for input validation of the create_drawing tool, requiring 'name' and 'content' as non-empty strings.
    export const CreateDrawingSchema = z.object({
      name: z.string().min(1),
      content: z.string().min(1),
    });
  • src/index.ts:66-69 (registration)
    Tool registration in the MCP server's listTools response, defining name, description, and input schema.
      name: "create_drawing",
      description: "Create a new Excalidraw drawing",
      inputSchema: zodToJsonSchema(drawings.CreateDrawingSchema),
    },
  • MCP server dispatch handler for 'create_drawing': parses arguments using the schema and delegates to drawings.createDrawing.
    case "create_drawing": {
      const args = drawings.CreateDrawingSchema.parse(
        request.params.arguments
      );
      const result = await drawings.createDrawing(args.name, args.content);
      return {
        content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
      };
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It implies a write operation ('Create') but fails to detail aspects like required permissions, whether the drawing is saved persistently, error conditions, or response format. This leaves significant gaps for an agent to understand the tool's behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with no wasted words, making it highly concise and front-loaded. It efficiently communicates the core purpose without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a creation tool with no annotations, 0% schema coverage, and no output schema, the description is incomplete. It lacks details on parameters, behavioral traits, and expected outcomes, making it insufficient for an agent to use the tool effectively without additional context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate by explaining parameters. It adds no information about 'name' or 'content' parameters, such as what 'content' should contain (e.g., Excalidraw JSON format) or naming constraints. This results in inadequate parameter guidance beyond the basic schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Create') and resource ('a new Excalidraw drawing'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'update_drawing' or specify what distinguishes creation from other operations beyond the basic verb.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'update_drawing' or 'get_drawing', nor are any prerequisites or contextual cues mentioned. The description merely states what it does without offering usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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/andreswebs-public-images/excalidraw-mcp'

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