Skip to main content
Glama

Export a diagram file

export_diagram
Idempotent

Exports the diagram, or one frame (frameId: the frame and everything inside it), as a file and returns a download link for the person: png (default), svg, jpeg, pdf (vector) or json (the diagram document, as the editor’s JSON export, with embedded images and files). Animated GIF and WebM are made in the editor (Share → Export). Returns { downloadUrl, expiresAt, maxDownloads, downloadsLeft, reused, filename, mimeType, bytes, width, height, scale, requestedScale, seq, watermark, watermarkSource, watermarkStyle, watermarkPosition, externalImageCount, externalImageNodeIds, warnings, pageCount, pages }. The link downloads the file (not an inline image) until expiresAt (15 minutes), for up to 5 downloads, and anyone with the link can use it until then. The same call on an unchanged diagram returns the same open link (reused: true). Formats follow the organization’s plan as in the editor (otherwise export_format_locked). PNG and JPEG: scale 1–4 pixels per diagram unit (default 2); PNG long edge up to 3072 px, JPEG up to 16 megapixels; warnings lists png_scale_capped, png_size_reduced or jpeg_scale_capped when the scale used is lower. PDF: pdf_raster_fallback when drawn as an image. pages (core.page ids or "all") makes one PDF with one PDF page per page, each at its own size, titles as bookmarks; a page exports without margin and content outside it is cut. SVG: still unless animate is true. background "transparent" (PNG, SVG) removes the background; padding sets the margin. watermark adds the Archboard watermark, always when the plan requires it (watermarkSource "plan"); watermarkStyle and watermarkPosition set its look and corner (watermark_style_adjusted: replaced by badge). JSON has no watermark or size. PNG is drawn by the same renderer as render_snapshot, with the same limits: external and AVIF images render as placeholders, colour emoji render in one colour, text inside nested SVG images is not drawn. In SVG, external and AVIF images are placeholders. JPEG and PDF show images from a web address as placeholders too. When images point to a web address, warnings lists external_images_placeholder with externalImageCount and externalImageNodeIds (add_image imports them).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "diagramId": "<diagramId>"
    },
    "name": "export_diagram"
  }
}

Input Schema

NameRequiredDescriptionDefault
pagesNocore.page pages: "all" or ids. pdf: one file, one PDF page per page, in page order; other formats: one page. Not with frameId.
scaleNoPNG and JPEG: pixels per diagram unit (default 2); the result’s scale is the value actually used.
themeNoColour theme (default light).light
formatNopng (default), svg, jpeg, pdf (vector) or json (the diagram document).png
animateNoSVG only: keep the diagram’s edge animations (SMIL). Default false: a still SVG.
frameIdNoExport only this frame (or any node) and its subtree.
paddingNoMargin in diagram units (default 40; 0 for a poster frame or a page).
filenameNoFile name without extension, in any language (default: the diagram title; with frameId, the title and the frame name).
diagramIdYesDiagram id (from list_diagrams or create_diagram).
watermarkNoAdd the Archboard watermark. Ignored when the organization’s plan always adds it (watermarkSource "plan").
backgroundNotransparent: no background (PNG, SVG). Default canvas: the theme’s background.canvas
pageNumbersNoPDF of pages: print page numbers.
watermarkStyleNoWatermark style: badge (default: logo, name and domain on a light chip), badge-dark (the same on a dark chip), mark (logo only; replaced by badge when the organization’s plan requires the watermark), band (edge band).
watermarkPositionNoCorner: bottom-right (default), bottom-left, top-right, top-left.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / padding / description
      Previous value: -"Margin in diagram units (default 40; 0 for a poster frame)."New value: +"Margin in diagram units (default 40; 0 for a poster frame or a page)."
    • addedInput schema / properties / pageNumbers
      Added value: +{
      +  "description": "PDF of pages: print page numbers.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / pages
      Added value: +{
      +  "anyOf": [
      +    {
      +      "const": "all",
      +      "type": "string"
      +    },
      +    {
      +      "items": {
      +        "maxLength": 1024,
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "maxItems": 30,
      +      "minItems": 1,
      +      "type": "array"
      +    }
      +  ],
      +  "description": "core.page pages: \"all\" or ids. pdf: one file, one PDF page per page, in page order; other formats: one page. Not with frameId."
      +}
  2. Changed6 schema fields changed
    • addedInput schema / properties / background
      Added value: +{
      +  "default": "canvas",
      +  "description": "transparent: no background (PNG, SVG). Default canvas: the theme’s background.",
      +  "enum": [
      +    "canvas",
      +    "transparent"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / format / description
      Previous value: -"File format: png (default) or svg. PDF and JPEG files are made in the editor (Share → Export)."New value: +"png (default), svg, jpeg, pdf (vector) or json (the diagram document)."
    • changedInput schema / properties / format / enum
      Previous value: -[
      -  "png",
      -  "svg"
      -]New value: +[
      +  "png",
      +  "svg",
      +  "jpeg",
      +  "pdf",
      +  "json"
      +]
    • addedInput schema / properties / padding
      Added value: +{
      +  "description": "Margin in diagram units (default 40; 0 for a poster frame).",
      +  "maximum": 2000,
      +  "minimum": 0,
      +  "type": "number"
      +}
    • changedInput schema / properties / scale / description
      Previous value: -"PNG only: pixels per diagram unit (default 2). The long edge is capped at 3072 px. The result’s scale is the value actually used."New value: +"PNG and JPEG: pixels per diagram unit (default 2); the result’s scale is the value actually used."
    • changedInput schema / properties / theme / description
      Previous value: -"Colour theme (default light); the file’s background is the theme’s opaque canvas colour."New value: +"Colour theme (default light)."
  3. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Adds substantial behavior beyond the annotations: link expires in 15 minutes, capped at 5 downloads, anyone with the link can use it, and an unchanged diagram returns the same open link (reused: true), which supports the idempotentHint. It also discloses scale capping warnings, watermark-override rules, placeholder rendering of external/AVIF images, and per-format limitations — exactly the mutation/side-effect context annotations cannot carry.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

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

Purpose is front-loaded, but the body is a single dense run-on paragraph with stacked parentheticals and a long inline return-field list, which hurts scannability. Nearly every clause is informative, yet the lack of paragraph or bullet structure makes it heavier than it needs to be.

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?

For a 14-parameter export tool with no output schema, the description enumerates the return object fields and explains their meaning (downloadUrl, expiresAt, reused, warnings, pages). Combined with warnings vocabulary (png_scale_capped, external_images_placeholder), an agent has everything needed to call it and interpret the result.

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, but the description adds cross-parameter meaning the schema only partially encodes: pages produces a single PDF with one PDF page per page and titles as bookmarks, pages is incompatible with frameId, padding defaults to 0 for poster frames/pages, and JSON has no watermark or size. That is genuine added semantics rather than restatement.

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 and resource ('Exports the diagram, or one frame ... as a file') and immediately names the return value (a download link), listing the supported formats. It also differentiates from render_snapshot by noting PNG uses the same renderer with the same limits, so an agent can tell the two apart.

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?

Explicitly rules out animated GIF/WebM ('made in the editor (Share → Export)') and flags plan-gated formats via export_format_locked, which is real routing guidance. It stops short of stating when to prefer this over render_snapshot for previewing, so it is strong but not exhaustive.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.