Skip to main content
Glama
Abdullah007bajwa

Excalidraw MCP Server

align_elements

Align selected elements in Excalidraw diagrams to specific positions like left, center, right, top, middle, or bottom for organized layouts.

Instructions

Align elements to a specific position

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
elementIdsYes
alignmentYes

Implementation Reference

  • Handler logic for the 'align_elements' tool. Parses input parameters using AlignElementsSchema, logs the alignment request, and returns a dummy success response without performing actual alignment of 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 (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.js:207-222 (registration)
    Registration of the 'align_elements' tool in the MCP server's capabilities, providing 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)
    Duplicate registration of the 'align_elements' tool in the ListToolsRequestHandler response.
    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']
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

C2.7/5.0
Behavior2/5

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

With no annotations, the description is the only source of behavioral transparency. It fails to disclose whether alignment is relative to other elements or an absolute canvas position, what values like 'center' vs 'middle' mean, or any side effects. This ambiguity leaves the agent guessing about the tool's actual behavior.

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

Conciseness4/5

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

The description is a single, efficient sentence with no redundancy or fluff. It is front-loaded with the action and resource. However, it errs on the side of underspecification, which slightly detracts from its effectiveness, though it remains concise.

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?

For a tool with no annotations, no output schema, and two parameters, the description is not complete enough. It lacks information on return values, alignment semantics, and how it interacts with the canvas or selection. The sibling tools like distribute_elements and group_elements suggest a broader context that this description fails to address.

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?

Schema description coverage is 0%, so the description must compensate. It does not explain the meaning of the 'alignment' enum values (e.g., 'left', 'center', 'right', 'top', 'middle', 'bottom') or clarify what 'elementIds' refers to. The parameter names are self-evident but their precise semantics remain under-specified.

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

Purpose4/5

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

The description clearly states a specific action (Align) and target (elements) with an outcome ('to a specific position'). It distinguishes itself from generic tools but does not explicitly differentiate from closely related siblings like distribute_elements, so it misses the top score.

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?

No guidance is provided on when to use this tool versus alternatives. There is no mention of prerequisites, scenarios, or exclusions. The description is purely a bare definition without contextual usage advice.

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