Skip to main content
Glama

Tidy up the diagram

layout_diagram
Idempotent

Tidies a completed BPMN diagram by recalculating every shape position and connection route while preserving colors, names, and links; returns layout warnings and element counts.

Instructions

Recalculates the position of every shape and the route of every connection, like the editor's "Tidy up" button. Handles pools, lanes, message flows, boundary events, expanded subprocesses, annotations and groups. Colors, names and connections are kept: only positions and routes change. Returns the layout warnings, if any, and the number of shapes and connections. Call it once the drawing is complete, then check the result with get_diagram_image. To place or shift a few shapes without touching the rest, use move_elements.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "layout_diagram"
  }
}

Input Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.4.6

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=false, destructiveHint=false and idempotentHint=true, but the description goes further: it specifies the preservation contract ("Colors, names and connections are kept: only positions and routes change") and what the call returns (layout warnings, counts of shapes and connections). That is meaningful context for a mutating, full-diagram operation and is fully consistent with the annotations.

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?

Front-loaded with the action, then scope, then the preservation guarantee, then the return value, then the sequencing and the alternative. The "Tidy up button" analogy earns its place by anchoring the behavior for readers familiar with the editor; no sentence is filler.

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

Completeness5/5

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

Despite no output schema, the description tells the agent what comes back (warnings plus shape/connection counts), what is and isn't modified, and how to verify the outcome with get_diagram_image. Nothing needed to invoke this zero-parameter tool correctly is missing.

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

Parameters4/5

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

The tool takes zero parameters, so there is no parameter semantics to add; the empty object schema matches the description's claim that the operation applies to the whole diagram uniformly. Baseline 4 applies for a parameterless tool.

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?

Specific verb and resource: "Recalculates the position of every shape and the route of every connection," with an analogy to the editor's "Tidy up" button. It enumerates the affected element types (pools, lanes, message flows, boundary events, expanded subprocesses, annotations, groups), so an agent can distinguish it from sibling style_elements or move_elements.

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

Usage Guidelines5/5

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

Explicit sequencing ("Call it once the drawing is complete, then check the result with get_diagram_image") and an explicit exclusion with a named alternative ("To place or shift a few shapes without touching the rest, use move_elements"). Both when-to-use and when-not-to-use are covered.

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