Skip to main content
Glama
Abdullah007bajwa

Excalidraw MCP Server

group_elements

Combine multiple diagram elements into a single group for easier organization and manipulation in Excalidraw diagrams.

Instructions

Group multiple elements together

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
elementIdsYes

Implementation Reference

  • The handler function for the 'group_elements' tool. It parses the input arguments using ElementIdsSchema, generates a unique groupId, stores the elementIds in sceneState.groups Map, and returns a JSON response with the groupId and elementIds.
    case 'group_elements': {
      const params = ElementIdsSchema.parse(args);
      const { elementIds } = params;
      
      const groupId = generateId();
      sceneState.groups.set(groupId, elementIds);
      
      const result = { groupId, elementIds };
      return {
        content: [{ type: 'text', text: JSON.stringify(result, null, 2) }]
      };
    }
  • Zod schema used for input validation in the group_elements handler (and others). Defines required elementIds as array of strings.
    const ElementIdsSchema = z.object({
      elementIds: z.array(z.string())
    });
  • Input schema definition for the group_elements tool in the MCP server capabilities declaration.
    group_elements: {
      description: 'Group multiple elements together',
      inputSchema: {
        type: 'object',
        properties: {
          elementIds: { 
            type: 'array',
            items: { type: 'string' }
          }
        },
        required: ['elementIds']
      }
    },
  • src/index.js:753-764 (registration)
    Tool registration in the ListToolsRequestHandler response, listing the group_elements tool with its schema.
    name: 'group_elements',
    description: 'Group multiple elements together',
    inputSchema: {
      type: 'object',
      properties: {
        elementIds: { 
          type: 'array',
          items: { type: 'string' }
        }
      },
      required: ['elementIds']
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

C2.4/5.0
Behavior1/5

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

There are no annotations, and the description only states the action without disclosing behavioral consequences such as whether a group object is created, whether elements are repositioned, or whether the operation is reversible. The description adds no behavioral context.

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, concise, front-loaded sentence with no extraneous words. It is efficient, though it sacrifices substance for brevity.

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?

With no annotations, no output schema, and a single undocumented parameter, the description is insufficiently complete. It does not explain the effect on the canvas, expected return value, or any constraints, which is particularly problematic for a mutation-like tool.

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

Parameters1/5

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

Schema description coverage is 0%, and the description does not mention elementIds or explain what the array should contain, any constraints, or the relationship of these IDs. The description provides zero added meaning beyond the parameter name.

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 uses a specific verb ('Group') and resource ('elements'), clearly distinguishing it from siblings like ungroup_elements. It is minimal but not a bare tautology.

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 such as ungroup_elements, align_elements, or distribute_elements. There are no prerequisites or exclusions mentioned.

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