align_elements
Align selected elements in Excalidraw diagrams to specific positions like left, center, right, top, middle, or bottom for organized layouts.
Instructions
Align elements to a specific position
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| elementIds | Yes | ||
| alignment | Yes |
Implementation Reference
- src/index.js:510-521 (handler)Handler logic for the 'align_elements' tool. Parses input parameters using AlignElementsSchema, logs the alignment request, and returns a dummy success response without performing actual alignment of elements.case 'align_elements': { const params = AlignElementsSchema.parse(args); const { elementIds, alignment } = params; // Implementation would align elements based on the specified alignment logger.info('Aligning elements', { elementIds, alignment }); const result = { aligned: true, elementIds, alignment }; return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
- src/index.js:60-63 (schema)Zod schema defining the input structure for the 'align_elements' tool: array of element IDs and alignment type (left, center, right, top, middle, bottom).const AlignElementsSchema = z.object({ elementIds: z.array(z.string()), alignment: z.enum(['left', 'center', 'right', 'top', 'middle', 'bottom']) });
- src/index.js:207-222 (registration)Registration of the 'align_elements' tool in the MCP server's capabilities, providing description and input schema.align_elements: { description: 'Align elements to a specific position', inputSchema: { type: 'object', properties: { elementIds: { type: 'array', items: { type: 'string' } }, alignment: { type: 'string', enum: ['left', 'center', 'right', 'top', 'middle', 'bottom'] } }, required: ['elementIds', 'alignment'] }
- src/index.js:778-793 (registration)Duplicate registration of the 'align_elements' tool in the ListToolsRequestHandler response.name: 'align_elements', description: 'Align elements to a specific position', inputSchema: { type: 'object', properties: { elementIds: { type: 'array', items: { type: 'string' } }, alignment: { type: 'string', enum: ['left', 'center', 'right', 'top', 'middle', 'bottom'] } }, required: ['elementIds', 'alignment'] }