Skip to main content
Glama
yctimlin

Excalidraw MCP Server

by yctimlin

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
NameRequiredDescriptionDefault
alignmentYes
elementIdsYes

Implementation Reference

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

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It implies a mutation operation (aligning elements likely changes their positions), but does not specify whether this is destructive, requires permissions, has side effects, or what the output looks like. For a tool with no annotations, this leaves significant gaps in understanding its behavior.

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 a single, concise sentence that directly states the tool's function. It is front-loaded with the core action and avoids unnecessary words, making it efficient and easy to parse.

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

Completeness2/5

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

Given the tool's complexity (mutating element positions), lack of annotations, no output schema, and low schema description coverage, the description is incomplete. It does not address key aspects like what happens after alignment, error conditions, or how it interacts with sibling tools, leaving the agent with insufficient information for reliable use.

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?

The input schema has 0% description coverage, so the description must compensate. It mentions 'specific position' but does not explain the parameters: alignment (with enum values like left, center) or elementIds (an array of IDs). The description adds minimal meaning beyond the schema, failing to clarify what alignment means in context or how elementIds are used.

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

Purpose3/5

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

The description states the tool's purpose as aligning elements to a specific position, which is clear but vague. It specifies the action (align) and target (elements), but does not distinguish it from sibling tools like distribute_elements or group_elements, nor does it clarify what type of elements (e.g., UI components, graphics) or context (e.g., layout, design) it operates on.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It does not mention prerequisites, such as needing existing elements to align, or differentiate from similar tools like distribute_elements or group_elements. Without any context, the agent must infer usage based on the tool name alone.

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

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

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