Skip to main content
Glama

read_me

Access the Excalidraw element reference to understand types, colors, sizing, and tips before creating diagrams.

Instructions

Get the Excalidraw element reference: types, colors, sizing, and tips. Call this before creating diagrams.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the read_me tool that returns the cheatsheet content as formatted text
    export async function handleReadMe(): Promise<{
      content: Array<{ type: 'text'; text: string }>;
    }> {
      return {
        content: [{
          type: 'text' as const,
          text: getCheatsheetText(),
        }],
      };
    }
  • Helper function that generates the formatted cheatsheet text with element types, color palettes, sizing guidelines, and tips
    export function getCheatsheetText(): string {
      const ref = ELEMENT_REFERENCE;
      const lines: string[] = [];
    
      lines.push('# Excalidraw MCP Quick Reference\n');
    
      lines.push('## Element Types\n');
      for (const [name, info] of Object.entries(ref.types)) {
        lines.push(`### ${name}`);
        lines.push(info.description);
        lines.push(`Required: ${info.requiredFields.join(', ')}`);
        if (info.optionalFields) {
          lines.push(`Optional: ${info.optionalFields.join(', ')}`);
        }
        if ('defaults' in info && info.defaults) {
          lines.push(`Defaults: ${JSON.stringify(info.defaults)}`);
        }
        if ('example' in info && info.example) {
          lines.push(`Example: ${JSON.stringify(info.example)}`);
        }
        lines.push('');
      }
    
      lines.push('## Color Palettes\n');
      for (const [name, palette] of Object.entries(ref.colorPalettes)) {
        lines.push(`### ${name} - ${palette.description}`);
        for (const [colorName, hex] of Object.entries(palette.colors)) {
          lines.push(`  ${colorName}: ${hex}`);
        }
        lines.push('');
      }
    
      lines.push('## Sizing Guidelines\n');
      for (const [key, val] of Object.entries(ref.sizing)) {
        if (typeof val === 'string') {
          lines.push(`- ${key}: ${val}`);
        } else {
          lines.push(`- ${key}:`);
          for (const [k, v] of Object.entries(val)) {
            lines.push(`    ${k}: ${v}px`);
          }
        }
      }
      lines.push('');
    
      lines.push('## Tips\n');
      for (const tip of ref.tips) {
        lines.push(`- ${tip}`);
      }
    
      return lines.join('\n');
    }
  • Data structure defining all element types, color palettes, sizing rules, and best practices that the read_me tool returns
    export const ELEMENT_REFERENCE = {
      types: {
        rectangle: {
          description: 'Rectangular shape. Use for boxes, containers, cards.',
          requiredFields: ['x', 'y'],
          optionalFields: ['width', 'height', 'backgroundColor', 'strokeColor', 'text'],
          defaults: { width: 200, height: 100 },
        },
        ellipse: {
          description: 'Oval/circle shape. Use for nodes, badges, indicators.',
          requiredFields: ['x', 'y'],
          optionalFields: ['width', 'height', 'backgroundColor', 'strokeColor', 'text'],
          defaults: { width: 150, height: 150 },
        },
        diamond: {
          description: 'Diamond/rhombus shape. Use for decision points in flowcharts.',
          requiredFields: ['x', 'y'],
          optionalFields: ['width', 'height', 'backgroundColor', 'strokeColor', 'text'],
          defaults: { width: 150, height: 150 },
        },
        arrow: {
          description: 'Directional arrow connecting points. Use for flows and relationships.',
          requiredFields: ['x', 'y', 'points'],
          optionalFields: ['strokeColor', 'strokeWidth'],
          example: { x: 0, y: 0, points: [{ x: 0, y: 0 }, { x: 200, y: 0 }] },
        },
        line: {
          description: 'Straight or polyline segment. Use for dividers, connections without direction.',
          requiredFields: ['x', 'y', 'points'],
          optionalFields: ['strokeColor', 'strokeWidth'],
        },
        text: {
          description: 'Standalone text label. Use for titles, annotations, labels.',
          requiredFields: ['x', 'y', 'text'],
          optionalFields: ['fontSize', 'fontFamily'],
          defaults: { fontSize: 20 },
        },
        freedraw: {
          description: 'Freehand drawing path. Use for sketchy annotations.',
          requiredFields: ['x', 'y', 'points'],
          optionalFields: ['strokeColor', 'strokeWidth'],
        },
      },
    
      colorPalettes: {
        excalidraw: {
          description: 'Default Excalidraw hand-drawn palette',
          colors: {
            blue: '#1971c2',
            red: '#c92a2a',
            green: '#2f9e44',
            orange: '#e67700',
            yellow: '#f59f00',
            purple: '#6741d9',
            pink: '#c2255c',
            gray: '#868e96',
            black: '#1b1b1f',
            white: '#ffffff',
          },
        },
        pastel: {
          description: 'Soft pastel backgrounds for containers and cards',
          colors: {
            lightBlue: '#d0ebff',
            lightRed: '#ffe3e3',
            lightGreen: '#d3f9d8',
            lightOrange: '#fff4e6',
            lightYellow: '#fff9db',
            lightPurple: '#e5dbff',
            lightPink: '#ffdeeb',
            lightGray: '#f1f3f5',
          },
        },
      },
    
      sizing: {
        spacing: 'Keep 40-60px between elements for readable layouts',
        textInBox: 'Add 20px padding around text inside rectangles',
        arrowGap: 'Start arrows 10px from source edge, end 10px before target',
        minWidth: 'Minimum readable element width is 80px',
        fontSize: {
          title: 28,
          heading: 22,
          body: 16,
          caption: 12,
        },
      },
    
      tips: [
        'Use batch_create_elements to place multiple elements at once - faster than individual creates',
        'Group related elements with group_elements after creating them',
        'Use align_elements and distribute_elements to clean up layouts',
        'For flowcharts: diamond = decision, rectangle = process, ellipse = start/end',
        'Set roughness: 0 for clean lines, 1 for hand-drawn look, 2 for sketchy',
        'Lock elements with lock_elements to prevent accidental changes to finished sections',
      ],
    };
  • Registration of the read_me tool with the MCP server, including its description and handler wiring
    // Register read_me as a regular tool (no UI needed)
    server.tool(
      'read_me',
      'Get the Excalidraw element reference: types, colors, sizing, and tips. Call this before creating diagrams.',
      {},
      async () => {
        try {
          return await handleReadMe();
        } catch (err) {
          return {
            content: [{ type: 'text' as const, text: `Error: ${(err as Error).message}` }],
            isError: true,
          };
        }
      }
    );
  • src/mcp/index.ts:58-72 (registration)
    Calls registerMcpApps to register the read_me tool along with other MCP Apps tools and resources
    // Register MCP Apps tools (create_view, read_me) and widget resource
    const __dirname = path.dirname(fileURLToPath(import.meta.url));
    registerMcpApps(server, {
      getWidgetHtml: async () => {
        const widgetPath = path.resolve(__dirname, '../widget/index.html');
        try {
          return await fs.promises.readFile(widgetPath, 'utf-8');
        } catch {
          return '<html><body><p>Widget not built. Run npm run build:widget</p></body></html>';
        }
      },
      persistToStore: async (elements) => {
        await client.batchCreate(elements);
      },
    });
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It states this is a 'Get' operation which implies read-only behavior, but doesn't disclose other behavioral traits like rate limits, authentication requirements, or what format the reference information is returned in. The description adds some context about timing but lacks comprehensive behavioral disclosure.

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 perfectly concise with just two sentences that each earn their place. The first sentence states what the tool does, and the second provides crucial usage guidance. No wasted words or redundant information.

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

Completeness3/5

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

For a zero-parameter tool with no output schema, the description provides adequate purpose and usage guidance. However, without annotations or output schema, it doesn't fully describe what the reference information looks like or how it's structured. It's complete enough for basic understanding but lacks detail about the return format.

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

Parameters4/5

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

The tool has 0 parameters with 100% schema description coverage, so the baseline is 4. The description appropriately doesn't discuss parameters since none exist, and instead focuses on the tool's purpose and usage context.

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

Purpose5/5

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

The description clearly states the tool's purpose with specific verbs ('Get') and resources ('Excalidraw element reference'), listing the exact information it provides (types, colors, sizing, and tips). It distinguishes itself from siblings like create_element or update_element by focusing on reference information rather than diagram manipulation.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool: 'Call this before creating diagrams.' This clearly positions it as a prerequisite or preparatory step for diagram creation tools, offering clear alternatives (use this first, then use creation tools).

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/debu-sinha/excalidraw-mcp-server'

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