Skip to main content
Glama
Abdullah007bajwa

Excalidraw MCP Server

ungroup_elements

Separate grouped elements in Excalidraw diagrams to edit individual components independently.

Instructions

Ungroup a group of elements

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
groupIdYes

Implementation Reference

  • The main handler logic for the 'ungroup_elements' tool. It validates the input using GroupIdSchema, checks if the group exists in sceneState.groups, retrieves the element IDs, deletes the group, and returns a success response with the details.
    case 'ungroup_elements': {
      const params = GroupIdSchema.parse(args);
      const { groupId } = params;
      
      if (!sceneState.groups.has(groupId)) {
        throw new Error(`Group ${groupId} not found`);
      }
      
      const elementIds = sceneState.groups.get(groupId);
      sceneState.groups.delete(groupId);
      
      const result = { groupId, ungrouped: true, elementIds };
      return {
        content: [{ type: 'text', text: JSON.stringify(result, null, 2) }]
      };
    }
  • Zod schema used for input validation of the groupId parameter in the ungroup_elements handler.
    const GroupIdSchema = z.object({
      groupId: z.string()
    });
  • src/index.js:197-206 (registration)
    Tool registration in the MCP server capabilities, including the description and input schema definition.
    ungroup_elements: {
      description: 'Ungroup a group of elements',
      inputSchema: {
        type: 'object',
        properties: {
          groupId: { type: 'string' }
        },
        required: ['groupId']
      }
    },
  • Duplicate schema definition in the ListToolsRequestHandler for consistency.
    name: 'ungroup_elements',
    description: 'Ungroup a group of elements',
    inputSchema: {
      type: 'object',
      properties: {
        groupId: { type: 'string' }
      },
      required: ['groupId']
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.1/5.0
Behavior2/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. It does not mention side effects, whether the operation is reversible, any permissions required, or what happens to the elements after ungrouping. It is a minimal statement of intent without behavioral depth.

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, short sentence that immediately communicates the core action. It is concise, fully front-loaded, and contains no unnecessary words or repetition.

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 mutation tool with no annotations and no output schema, the description is too sparse. It does not explain the required parameter, potential errors, or behavioral outcomes, leaving the agent with only a high-level understanding. More context is needed for correct invocation.

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 schema has 0% coverage, and the description does not explain the 'groupId' parameter at all. While the parameter name is somewhat self-explanatory, the description adds no meaning beyond what the schema provides, failing to compensate for the lack of schema documentation.

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

Purpose5/5

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

The description clearly states the action ('Ungroup') and the target ('a group of elements'), making it immediately distinguishable from sibling tools like group_elements. The verb+resource structure is specific and unambiguous.

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, prerequisites (e.g., elements must already be grouped), or context for typical use cases. The description simply states the operation without any additional context.

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