align_elements
Align elements in Excalidraw diagrams to specified positions such as left, center, right, top, middle, or bottom by providing element IDs and alignment type.
Instructions
Align elements to a specific position
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| alignment | Yes | ||
| elementIds | Yes |
Implementation Reference
- src/index.ts:782-793 (handler)Handler for align_elements tool: parses input using AlignElementsSchema, logs the action, and returns a placeholder success result indicating elements have been aligned.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.ts:212-215 (schema)Zod schema defining input for align_elements: array of element IDs and alignment direction (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.ts:353-370 (registration)Registers the align_elements tool in the MCP tools list, providing name, description, and JSON schema matching the Zod schema.{ 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'] } },