Skip to main content
Glama

Load diagram file

load_diagram

Load a .drawio, .drawio.svg, or raw XML diagram into the session, replacing all pages. Pass it by file path or XML to edit and re-export instead of rewriting files.

Instructions

Load a .drawio diagram into the current session, REPLACING the entire diagram (all pages). To change an existing file, load it here, edit with edit_diagram, then export_diagram to the same path; never rewrite the file by hand. Provide ONE of two mutually exclusive sources: 'path' (the server reads the file from disk — you do NOT need to read the file yourself or pass its XML through create_new_diagram) or 'xml' (the raw file content you already have — from another tool, a repository read, or an API response — so no temporary file needs to be written first). Both accept plain XML and draw.io's compressed save format. .drawio.svg (Editable SVG, the format export_diagram writes) is accepted too; .png files (also draw.io's editable PNG) and plain .svg files cannot be loaded.

After loading from 'path' (or from compressed 'xml'), call get_diagram before edit_diagram — you haven't seen the file's cell IDs yet. Plain-XML 'xml' content you supplied yourself is already known and can be edited immediately.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xmlNoRaw .drawio file content: a plain <mxfile>/<mxGraphModel>, or draw.io's compressed save format. Use when the content is already in hand (another tool's output, a repository read, an API response). Mutually exclusive with 'path'.
pathNoPath to the .drawio or .drawio.svg file to load (e.g. /Users/me/diagram.drawio or ~/diagram.drawio). Relative paths resolve against the MCP server's working directory, which is often not your project. Mutually exclusive with 'xml'.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only declare openWorldHint=false, so the description carries the behavioral burden and does so well: it discloses the whole-diagram replacement, the accepted formats (plain XML, compressed save format, .drawio.svg) and explicitly the rejected ones (.png, plain .svg), plus the cell-ID visibility trap after loading. These are exactly the traits an agent needs and none are in 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.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads the replacement warning and keeps every sentence functional, but the middle paragraph is dense with parenthetical asides that make it heavier than needed for the payoff. No sentence is pure filler, so it stops short of a 5.

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

Completeness4/5

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

No output schema exists, and the description covers inputs, format limits, and the required follow-up calls well. It does not say what a successful load returns or how to inspect resulting pages beyond pointing at get_diagram, which is a minor gap for a session-mutating loader.

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?

Schema coverage is 100% (baseline 3), and the description goes beyond it by giving a selection rule between the two mutually exclusive sources, noting compressed-format support for both, and warning that 'path' resolves against the server's working directory, which may not be the project directory. That last note is a real semantic addition the schema only hints at.

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?

States a specific verb+resource ('Load a .drawio diagram into the current session') and immediately scopes it with the destructive side effect 'REPLACING the entire diagram (all pages)'. It also distinguishes itself from the sibling create_new_diagram by saying the caller does not need to pass XML through that tool.

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?

Explicitly states the two mutually exclusive input modes, when to choose each ('path' when the server should read from disk, 'xml' when content is already in hand), and the intended edit workflow (load here, edit_diagram, then export_diagram to the same path). It adds a concrete precondition: call get_diagram before edit_diagram after a path load, but not for self-supplied plain XML.

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