distribute_elements
Arrange diagram elements evenly in horizontal or vertical alignment to organize Excalidraw diagrams.
Instructions
Distribute elements evenly
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| elementIds | Yes | ||
| direction | Yes |
Implementation Reference
- src/index.js:523-534 (handler)Handler function for the 'distribute_elements' tool. Parses input parameters using DistributeElementsSchema, logs the action, and returns a placeholder success response indicating elements have been distributed.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 structure for the distribute_elements tool: an array of elementIds and a direction (horizontal or vertical).const DistributeElementsSchema = z.object({ elementIds: z.array(z.string()), direction: z.enum(['horizontal', 'vertical']) });
- src/index.js:224-240 (registration)Registration of the distribute_elements tool in the MCP server capabilities, including description and input schema definition.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'] } },
- src/index.js:796-812 (registration)Tool listing registration in the ListToolsRequestHandler response, mirroring the capabilities schema 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'] } },