Skip to main content
Glama

align_elements

Position Excalidraw diagram elements precisely by aligning them to specified edges or axes, such as left, center, right, top, middle, or bottom, using defined element IDs for accuracy.

Instructions

Align elements to a specific position

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
alignmentYes
elementIdsYes

Implementation Reference

  • The switch case handler for the 'align_elements' tool. It parses the input arguments using AlignElementsSchema, logs the alignment action, and returns a placeholder success response without modifying the 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) }] }; }
  • Zod schema defining the input structure for the 'align_elements' tool: array of element IDs and alignment type.
    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 capabilities, including 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)
    Registration of the 'align_elements' tool in the list tools response handler.
    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'] }

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/Abdullah007bajwa/mcp_excalidraw'

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