Skip to main content
Glama
yctimlin

Excalidraw MCP Server

by yctimlin

distribute_elements

Evenly space elements in Excalidraw diagrams horizontally or vertically by specifying element IDs and direction.

Instructions

Distribute elements evenly

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
directionYes
elementIdsYes

Implementation Reference

  • Handler for distribute_elements tool: parses input using DistributeElementsSchema, logs the action (placeholder implementation), and returns a success result.
    case 'distribute_elements': {
      const params = DistributeElementsSchema.parse(args);
      const { elementIds, direction } = params;
      
      // Implementation would distribute elements based on the specified direction
      logger.info('Distributing elements', { elementIds, direction });
      
      const result = { distributed: true, elementIds, direction };
      return {
        content: [{ type: 'text', text: JSON.stringify(result, null, 2) }]
      };
    }
  • Zod schema for validating distribute_elements tool input parameters: array of element IDs and direction (horizontal or vertical).
    const DistributeElementsSchema = z.object({
      elementIds: z.array(z.string()),
      direction: z.enum(['horizontal', 'vertical'])
    });
  • src/index.ts:371-388 (registration)
    Tool registration in the tools array, defining name, description, and inputSchema for distribute_elements.
    {
      name: 'distribute_elements',
      description: 'Distribute elements evenly',
      inputSchema: {
        type: 'object',
        properties: {
          elementIds: { 
            type: 'array',
            items: { type: 'string' }
          },
          direction: { 
            type: 'string', 
            enum: ['horizontal', 'vertical'] 
          }
        },
        required: ['elementIds', 'direction']
      }
    },
Install Server

Other Tools

Related 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/yctimlin/mcp_excalidraw'

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