Skip to main content
Glama
hj1003862396

Next AI Draw.io MCP Server

by hj1003862396

create_new_diagram

Create a new diagram from mxGraphModel XML, either from scratch or as a full replacement.

Instructions

Create a NEW diagram from mxGraphModel XML. Use this when creating a diagram from scratch or replacing the current diagram entirely.

CRITICAL: You MUST provide the 'xml' argument in EVERY call. Do NOT call this tool without xml.

When to use this tool:

  • Creating a new diagram from scratch

  • Replacing the current diagram with a completely different one

  • Major structural changes that require regenerating the diagram

When to use edit_diagram instead:

  • Small modifications to existing diagram

  • Adding/removing individual elements

  • Changing labels, colors, or positions

XML FORMAT - Full mxGraphModel structure:

LAYOUT CONSTRAINTS:

  • Keep all elements within x=0-800, y=0-600 (single page viewport)

  • Start from margins (x=40, y=40), keep elements grouped closely

  • Use unique IDs starting from "2" (0 and 1 are reserved)

  • Set parent="1" for top-level shapes

  • Space shapes 150-200px apart for clear edge routing

EDGE ROUTING RULES:

  • Never let multiple edges share the same path - use different exitY/entryY values

  • For bidirectional connections (A↔B), use OPPOSITE sides

  • Always specify exitX, exitY, entryX, entryY explicitly in edge style

  • Route edges AROUND obstacles using waypoints (add 20-30px clearance)

  • Use natural connection points based on flow (not corners)

COMMON STYLES:

  • Shapes: rounded=1; fillColor=#hex; strokeColor=#hex

  • Edges: endArrow=classic; edgeStyle=orthogonalEdgeStyle; curved=1

  • Text: fontSize=14; fontStyle=1 (bold); align=center

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xmlYesREQUIRED: The complete mxGraphModel XML. Must always be provided.
Behavior5/5

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

No annotations are provided, so the description carries the full burden. It clearly states that the tool replaces the current diagram entirely and requires the xml argument in every call. It also discloses layout constraints, ID conventions, and edge routing rules, which are critical behavioral details for the agent to invoke correctly.

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?

Despite length, the description is well-structured with clear headers (When to use, XML Format, Layout Constraints, Edge Routing, Common Styles) and critical content front-loaded with a CRITICAL warning. Every section earns its place, providing necessary detail for correct usage.

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?

The tool has high complexity (mxGraphModel XML, layout rules, edge routing), and the description covers all these aspects comprehensively. It provides a full XML example, constraints, styles, and even routing logic. While there is no output schema or return value description, for a create operation this is sufficient. It fully enables an agent to use the tool correctly.

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

Parameters5/5

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

Although schema coverage is 100% for the xml parameter, the description goes far beyond the schema by providing a complete mxGraphModel XML example, mandatory argument warning, and detailed layout/edge/styling constraints. This adds substantial meaning that the schema alone does not convey.

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 opens with a clear verb+resource: "Create a NEW diagram from mxGraphModel XML." It explicitly distinguishes from edit_diagram by stating this tool is for creating from scratch or replacing entirely, versus small modifications. This directly addresses sibling differentiation.

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?

The description has explicit "When to use" and "When to use edit_diagram instead" sections. It provides concrete use cases (creating new, replacing, major structural changes) and explicitly names the alternative tool for smaller edits. This is exemplary guidance.

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/hj1003862396/draw-flow-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server