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

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

With no annotations, the description carries the full burden of behavioral disclosure. It implies a mutation ('align'), but doesn't specify if it requires permissions, is reversible, affects other properties, or has side effects. No rate limits, auth needs, or output format are mentioned, leaving significant gaps for a tool that likely modifies elements.

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, efficient sentence with no wasted words. It's appropriately sized and front-loaded, making it easy to parse quickly, though this conciseness comes at the cost of detail.

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 elements with two parameters), lack of annotations, and no output schema, the description is incomplete. It doesn't cover behavioral traits, parameter meanings, or usage context, making it inadequate for safe and effective tool invocation by an agent.

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 but adds no parameter details. It doesn't explain what 'elementIds' are (e.g., identifiers of elements to align) or clarify 'alignment' beyond the enum values, failing to provide meaning beyond the bare schema.

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 'Align elements to a specific position' clearly states the verb ('align') and resource ('elements'), but it's vague about what 'elements' are (e.g., UI components, graphics) and doesn't distinguish from siblings like 'distribute_elements' or 'group_elements'. It avoids tautology by not just restating the name, but lacks specificity.

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. The description doesn't mention prerequisites, exclusions, or compare to sibling tools like 'distribute_elements' or 'group_elements', leaving the agent to infer usage from context 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

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