distribute_elements
Distribute elements in Excalidraw diagrams evenly along horizontal or vertical axes for better organization and alignment using structured API commands.
Instructions
Distribute elements evenly
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| direction | Yes | ||
| elementIds | Yes |
Implementation Reference
- src/index.js:523-534 (handler)The handler case for the 'distribute_elements' tool in the switch statement. It parses the input using DistributeElementsSchema, logs the action, and returns a stub success response without actual distribution logic.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) }] }; }
- src/index.js:65-68 (schema)Zod schema defining the input parameters for the distribute_elements tool: 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.js:224-240 (registration)Tool registration in the MCP server capabilities object, specifying the name, description, and input schema for distribute_elements.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'] } },