Skip to main content
Glama
Abdullah007bajwa

Excalidraw MCP Server

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']
      }
    },
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure but provides almost none. 'Distribute elements evenly' doesn't reveal whether this is a read-only or destructive operation, what permissions might be required, whether it modifies existing elements or creates new ones, or what happens on failure. For a tool that likely performs spatial/visual operations, this lack of behavioral context is severely inadequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is maximally concise at just three words. There's no wasted language or unnecessary elaboration. While this conciseness comes at the cost of completeness, the description itself is perfectly structured as a simple, direct statement of function.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity implied by spatial distribution operations, 2 parameters with 0% schema coverage, no annotations, and no output schema, the description is completely inadequate. It doesn't explain what 'elements' are in this system, what 'distribute evenly' means operationally, what the tool returns, or any error conditions. For a tool that likely performs non-trivial layout operations, this minimal description leaves the agent with insufficient context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage and 2 parameters, the description provides no information about parameter meanings beyond what's implied by the tool name. The schema shows 'elementIds' (array of strings) and 'direction' (horizontal/vertical enum), but the description doesn't explain what element IDs refer to, what 'distribute evenly' means in horizontal vs. vertical contexts, or how the distribution algorithm works. The description fails to compensate for the complete lack of schema documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Distribute elements evenly' is a tautology that essentially restates the tool name 'distribute_elements' without adding meaningful specificity. It mentions 'elements' and 'evenly' but doesn't clarify what type of elements (e.g., UI components, graphical objects) or what distribution means in this context. While it distinguishes from some siblings like 'create_element' or 'delete_element', it doesn't clearly differentiate from 'align_elements' which might have similar visual/spatial functionality.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides absolutely no guidance on when to use this tool versus alternatives. There's no mention of prerequisites, appropriate contexts, or comparison with sibling tools like 'align_elements' or 'group_elements'. The agent must guess based solely on the tool name and minimal description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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