Skip to main content
Glama

Get diagram

get_diagram
Read-only

Fetch the current diagram XML from the live browser canvas, including manual edits, to inspect structure, pages, and cell IDs before editing or after a rejected change.

Instructions

Get the current diagram XML (fetches latest from browser, including user's manual edits). Call this when you don't know the current diagram content (cell IDs, pages, structure) — e.g. before editing a diagram you didn't create in this conversation, or after edit_diagram was rejected because the user changed the diagram in the browser.

Returns the full by default. If a page selector is provided, returns just that page's embedded in a one-page wrapper.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already establish readOnlyHint=true and openWorldHint=false, so safety is covered. The description adds genuinely non-obvious behavior — that it re-fetches from the browser so user's manual edits are included — plus what is actually returned (full <mxfile> by default vs. a one-page wrapper holding the page's <mxGraphModel>). It stops short of stating size/latency characteristics, so not a 5.

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 action, followed by the when-to-use clause, then return-shape detail. Three sentences, each carrying distinct information, with no filler or restatement of the tool name.

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?

With no output schema and only three optional params, the description carries the necessary burden and does so: it tells the agent what is returned in both default and page-scoped modes and warns that content may differ from conversation state. Nothing needed to call it 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?

Schema coverage is 100%, so the baseline is 3 and the schema already documents precedence among page_id/page_name/page_index. The description still adds value the schema does not: it explains the output-shape consequence of supplying a page selector (single page embedded in a one-page <mxfile>), which is semantic behavior rather than a restatement of the property definitions.

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 ("Get the current diagram XML") and immediately qualifies what "current" means — a live fetch from the browser including manual edits. This distinguishes it from load_diagram, list_saved_diagrams, and edit_diagram without the agent needing to open any schema.

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 names the triggering conditions: when the current diagram content (cell IDs, pages, structure) is unknown, before editing a diagram not created in this conversation, or after edit_diagram was rejected because the user changed things in the browser. This is a textbook when-to-use clause that routes the agent away from stale-state assumptions.

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