Skip to main content
Glama

distribute_elements

Arrange diagram elements evenly in horizontal or vertical alignment to organize Excalidraw diagrams.

Instructions

Distribute elements evenly

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
elementIdsYes
directionYes

Implementation Reference

  • 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) }] }; }
  • 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'] } },

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