Skip to main content
Glama

Export diagram

export_diagram

Export the current diagram to .drawio, .png, .svg, or .drawio.svg files. Specify a page to export a single page, or omit for all pages.

Instructions

Export the current diagram to a file. Supports .drawio (XML), .png, .svg, and .drawio.svg (an SVG with the diagram embedded, which draw.io and load_diagram can open again). The format is auto-detected from the file extension, or can be specified explicitly. Images get a 20 px margin; a PNG has a white background (or the page's own background color) unless transparent is true.

Multi-page behaviour:

  • .drawio with NO page selector: writes the full (all pages).

  • .drawio with a page selector: writes a single-page containing only that page.

  • .png / .svg with NO page selector: exports the currently active page in the browser.

  • .png with a page selector: renders that page without changing what the user sees.

  • .svg / .drawio.svg with a page selector: temporarily loads that page into the browser, captures it, then restores the full document (the user sees a brief flicker).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute file path to save to (e.g. /Users/me/diagram.drawio, ~/diagram.png). Relative paths resolve against the MCP server's working directory, which is often not your project.
formatNoExport format. If omitted, detected from file extension. Defaults to drawio.
page_idNoTarget a page by its id (as returned by list_pages or add_page). Wins over page_name and page_index when multiple are set.
page_nameNoTarget a page by its display name (e.g. "CNN"). Used only when page_id is not set.
page_indexNoTarget a page by its 0-based tab index. Used only when page_id and page_name are not set.
transparentNoPNG only: a transparent background instead of white. Default false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only supply openWorldHint=false, so the description carries the behavioral burden and does so well: 20 px margin, white vs transparent PNG background, the exact multi-page semantics per format, and the user-visible flicker side effect of temporarily loading a page for SVG capture. These are non-obvious consequences an agent could not infer from the schema.

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 core purpose in one sentence, then carefully sectioned into format behavior and a labelled 'Multi-page behaviour' bullet list. The length is justified by the genuine combinatorial complexity of format x page-selector; nothing reads as filler.

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 never states what the tool returns or whether it overwrites an existing file at the given path. Given the moderate complexity and otherwise thorough coverage of format and page semantics, this is a narrow but real gap.

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 description coverage is already 100%, so the baseline is 3. The description goes beyond it by explaining that format defaults to drawio when undetectable and, more importantly, by mapping page-selector combinations to concrete output behavior (full mxfile vs single-page mxfile vs active page). It does not restate the page_id > page_name > page_index precedence, which the schema already covers.

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?

Opens with a specific verb+resource ('Export the current diagram to a file') and enumerates the exact supported output formats (.drawio, .png, .svg, .drawio.svg), so the agent knows precisely what artifact this produces. It is readily distinguishable from read-oriented siblings like get_diagram, though it never explicitly contrasts itself with screenshot_diagram, which is the nearest alternative.

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

Usage Guidelines4/5

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

Gives clear selection logic for the format parameter (auto-detected from extension or specified explicitly) and a detailed decision matrix for when a page selector is used versus omitted. It stops short of naming when to prefer this tool over screenshot_diagram or get_diagram, so the sibling routing is left implicit.

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