Skip to main content
Glama

list_drawings

Retrieve and display all available Excalidraw drawings with pagination controls for organized access.

Instructions

List all Excalidraw drawings

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNo
perPageNo

Implementation Reference

  • Core implementation of the list_drawings tool. Lists drawings by filtering metadata files (.meta.json) from the storage directory, applies pagination based on page and perPage parameters, reads and parses metadata for each drawing, and returns the paginated list along with total count. Handles errors by returning empty list.
    export async function listDrawings(page: number = 1, perPage: number = 10): Promise<{ drawings: any[], total: number }> {
      await ensureStorageDir();
      
      try {
        // Get all files in the storage directory
        const files = await fs.readdir(STORAGE_DIR);
        
        // Filter metadata files
        const metadataFiles = files.filter(file => file.endsWith('.meta.json'));
        
        // Calculate pagination
        const start = (page - 1) * perPage;
        const end = start + perPage;
        const paginatedFiles = metadataFiles.slice(start, end);
        
        // Read metadata for each drawing
        const drawings = await Promise.all(
          paginatedFiles.map(async (file) => {
            const metadataPath = path.join(STORAGE_DIR, file);
            const metadataStr = await fs.readFile(metadataPath, 'utf-8');
            return JSON.parse(metadataStr);
          })
        );
        
        return {
          drawings,
          total: metadataFiles.length,
        };
      } catch (error) {
        console.error('Failed to list drawings:', error);
        return {
          drawings: [],
          total: 0,
        };
      }
    }
  • Zod schema defining input parameters for list_drawings tool: optional page (default 1) and perPage (default 10, max 100). Used for validation in both registration and dispatch.
    export const ListDrawingsSchema = z.object({
      page: z.number().int().min(1).optional().default(1),
      perPage: z.number().int().min(1).max(100).optional().default(10),
    });
  • index.ts:83-86 (registration)
    Tool registration in the ListTools response, specifying name, description, and input schema.
      name: "list_drawings",
      description: "List all Excalidraw drawings",
      inputSchema: zodToJsonSchema(drawings.ListDrawingsSchema),
    },
  • Dispatch handler in the main CallToolRequestHandler switch statement. Parses arguments using the schema, calls the core listDrawings function, and formats result as MCP content.
    case "list_drawings": {
      const args = drawings.ListDrawingsSchema.parse(request.params.arguments);
      const result = await drawings.listDrawings(args.page, args.perPage);
      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?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states 'List all Excalidraw drawings', which implies a read-only operation, but does not clarify if it's paginated (implied by parameters), what the output format is, or any rate limits or permissions required. This leaves significant gaps in understanding tool 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 conveys the core purpose without unnecessary elaboration, earning full marks for brevity and structure.

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 list operation with pagination parameters, no annotations, and no output schema, the description is incomplete. It does not explain the pagination behavior, return format, or any constraints, making it inadequate for the agent to fully understand how to use the tool effectively.

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?

With 2 parameters and 0% schema description coverage, the schema provides no descriptions for 'page' and 'perPage'. The tool description does not mention or explain these parameters at all, failing to compensate for the lack of schema documentation and leaving their purpose unclear to the agent.

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 ('List') and resource ('all Excalidraw drawings'), making the purpose evident. However, it does not differentiate from potential siblings like 'get_drawing' (which might fetch a single drawing) or 'export_to_json' (which might list in a specific format), leaving room for improvement in sibling distinction.

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?

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'get_drawing' (for a single drawing) and export tools, it lacks explicit instructions on usage context, prerequisites, or exclusions, offering minimal help for agent decision-making.

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/i-tozer/excalidraw-mcp'

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