Skip to main content
Glama
Abdullah007bajwa

Excalidraw MCP Server

get_resource

Retrieve Excalidraw diagrams, libraries, themes, or elements from the MCP server for diagram creation and manipulation.

Instructions

Get an Excalidraw resource

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
resourceYes

Implementation Reference

  • The handler function for the 'get_resource' tool. It validates input using ResourceSchema, switches on the resource type (scene, library, theme, elements), retrieves data from in-memory state, and returns JSON-formatted content.
    case 'get_resource': {
      const params = ResourceSchema.parse(args);
      const { resource } = params;
      logger.info('Getting resource', { resource });
      
      let result;
      switch (resource) {
        case 'scene':
          result = {
            theme: sceneState.theme,
            viewport: sceneState.viewport,
            selectedElements: Array.from(sceneState.selectedElements)
          };
          break;
        case 'library':
          result = {
            elements: Array.from(elements.values())
          };
          break;
        case 'theme':
          result = {
            theme: sceneState.theme
          };
          break;
        case 'elements':
          result = {
            elements: Array.from(elements.values())
          };
          break;
        default:
          throw new Error(`Unknown resource: ${resource}`);
      }
      
      return {
        content: [{ type: 'text', text: JSON.stringify(result, null, 2) }]
      };
    }
  • Zod schema used for input validation in the get_resource handler.
    const ResourceSchema = z.object({
      resource: z.enum(['scene', 'library', 'theme', 'elements'])
    });
  • src/index.js:171-183 (registration)
    Tool registration in server capabilities, including description and input schema definition.
    get_resource: {
      description: 'Get an Excalidraw resource',
      inputSchema: {
        type: 'object',
        properties: {
          resource: { 
            type: 'string', 
            enum: ['scene', 'library', 'theme', 'elements'] 
          }
        },
        required: ['resource']
      }
    },
Behavior2/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 only states 'Get', implying a read operation, but doesn't disclose behavioral traits such as authentication needs, rate limits, error handling, or what 'Get' entails (e.g., returns data, metadata, or files). This leaves significant gaps in understanding how the tool behaves.

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 extremely concise with a single sentence, 'Get an Excalidraw resource', which is front-loaded and wastes no words. Every part of the sentence is necessary, making it efficient and well-structured.

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 tool's simplicity (1 parameter, no output schema, no annotations), the description is incomplete. It doesn't explain what 'resource' means, what types of resources are available, or what the tool returns. For a tool with no annotations or output schema, more context is needed to understand its full functionality and use cases.

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 description adds minimal meaning beyond the input schema. With 0% schema description coverage and 1 parameter, the description doesn't explain the 'resource' parameter or its enum values. However, since there's only one parameter and the schema defines it clearly with an enum, the baseline is high. The description doesn't compensate for the lack of schema descriptions but doesn't need to heavily due to the simple parameter structure.

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

Purpose3/5

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

The description 'Get an Excalidraw resource' states a verb ('Get') and resource ('Excalidraw resource'), but is vague about what 'resource' specifically means. It doesn't distinguish from siblings like 'query_elements' or 'save_scene', which also involve Excalidraw resources. The purpose is understandable but lacks specificity.

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 explain if this is for retrieving metadata, configurations, or raw data, or how it differs from siblings like 'query_elements'. The description offers no context for selection among the available 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/Abdullah007bajwa/mcp_excalidraw'

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