Skip to main content
Glama

get_drawing

Retrieve an Excalidraw drawing by its unique ID to access, view, or edit existing diagrams within the Excalidraw MCP Server.

Instructions

Get an Excalidraw drawing by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes

Implementation Reference

  • Implements the core logic to retrieve a drawing by ID: validates ID, reads content and metadata from storage files, handles errors.
    export async function getDrawing(
      id: string
    ): Promise<{ id: string; name: string; content: string; metadata: any }> {
      // Validate the ID for security
      validateFileId(id);
    
      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 {
        // Read the drawing content
        const content = await fs.readFile(filePath, "utf-8");
    
        // Read the metadata
        const metadataStr = await fs.readFile(metadataPath, "utf-8");
        const metadata = safeJsonParse(metadataStr, "drawing metadata");
    
        return {
          id,
          name: metadata.name,
          content,
          metadata,
        };
      } catch (error) {
        if (error instanceof ExcalidrawValidationError) {
          throw error; // Re-throw validation errors as-is
        }
        throw new ExcalidrawResourceNotFoundError(
          sanitizeErrorMessage(error, `Drawing with ID ${id} not found`)
        );
      }
    }
  • Zod schema for validating input to get_drawing tool (requires 'id' string).
    export const GetDrawingSchema = z.object({
      id: z.string().min(1),
    });
  • src/index.ts:70-74 (registration)
    Registers the 'get_drawing' tool in the MCP server with name, description, and input schema.
    {
      name: "get_drawing",
      description: "Get an Excalidraw drawing by ID",
      inputSchema: zodToJsonSchema(drawings.GetDrawingSchema),
    },
  • Dispatcher handler in main server that parses args, calls getDrawing, and formats response for MCP.
    case "get_drawing": {
      const args = drawings.GetDrawingSchema.parse(request.params.arguments);
      const result = await drawings.getDrawing(args.id);
      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, the description carries full burden but provides minimal behavioral context. It doesn't disclose if this is a read-only operation, what happens if the ID is invalid (e.g., errors), or any rate limits or authentication needs, which are critical for a retrieval tool.

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, efficient sentence with no wasted words, clearly front-loading the core purpose. It's appropriately sized for a simple retrieval tool, making it easy to parse quickly.

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?

For a tool with no annotations, no output schema, and low schema coverage, the description is incomplete. It lacks details on return values, error conditions, and behavioral traits, which are essential for an agent to use it effectively in context with siblings.

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

Parameters3/5

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

The description adds that the 'id' parameter is for retrieving a specific Excalidraw drawing, which gives basic meaning. However, with 0% schema description coverage, it doesn't explain ID format, source, or constraints, leaving gaps that the schema alone doesn't address.

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 ('Get') and resource ('an Excalidraw drawing by ID'), making the purpose understandable. However, it doesn't differentiate from siblings like 'list_drawings' or 'export_to_json' which also retrieve drawings in different ways, preventing a perfect score.

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. For example, it doesn't mention that 'list_drawings' should be used to find IDs first, or that export tools are for different output formats, leaving the agent to infer usage from context alone.

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