Skip to main content
Glama

Draw a diagram from Mermaid or an infographic spec

compose_diagram

Adds a new drawing to an existing diagram as one agent change (revert_change can revert it). It only adds shapes: it never changes, moves, reconnects or removes what is already on the canvas; changes to existing shapes, such as inserting a node between two existing ones or renaming one, are made with apply_ops. The drawing is either a Mermaid flowchart (subgraphs become frames, or containers such as network.vpc when you map their ids; map ids, classes or "@shape" to node types with types; unmapped nodes become core.box; options layout, direction ("auto" picks the readable one), frame), or an infographic spec (infographic: theme + blocks; each block is { block, …the node type’s props }, e.g. header, kpi-row, chart, progress, funnel, timeline, process, icon-grid, versus, source) that the server measures and lays out on a 12-column poster — the spec gives data and order, not coordinates. Pie, xychart, timeline, quadrantChart and venn Mermaid diagrams become infographic blocks. It takes exactly one of mermaid and infographic. dryRun checks without writing; with dryRun, preview "light" or "dark" also returns a PNG (a poster exactly as export_diagram draws it). read_me topic "infographics" describes the blocks. Returns applied, seq, batchId, effects, bounds and warnings; Mermaid adds nodeIds, groupIds, edgeIds ("A->B" → edge id) and frameId plus the direction used, an infographic adds idMap, posterId, nodeIds, blocks (node ids and bounds), quota and layout, and each infographic warning’s fix says which span, field or poster size to change. status (≤ 80 characters) is shown to people next to your cursor.

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": "compose_diagram"
  }
}

Input Schema

NameRequiredDescriptionDefault
frameNo{ title } wraps a Mermaid drawing in a new frame; { id } puts the drawing or the poster inside an existing container (frame, namespace, VPC…) below its children and grows the container if needed (a page keeps its size).
typesNoMaps Mermaid node ids, subgraph ids, classes (":::name" / "class A name") or "@shape" (e.g. "@cylinder") to node types from search_node_types (e.g. {"db":"cloud.database","vpc":"network.vpc"}). A subgraph takes a container type (network.vpc, k8s.namespace, cloud.region, c4.system-boundary…). Unmapped nodes become core.box (non-rectangular Mermaid shapes become core.shape), unmapped subgraphs core.frame. Edges between mindmap.* or org.* nodes become mind-map branches / reporting lines.
dryRunNoCheck the drawing against the current state without writing. Ids in a dry-run result are placeholders; the call that writes returns the real ones.
layoutNoLayout engine (default layered).
statusNo
mermaidNoMermaid source: a flowchart ("flowchart LR" / "graph TD", subgraphs included), or a pie, xychart, timeline, quadrantChart or venn-beta chart, which is drawn as one infographic block. Other Mermaid diagram kinds are not supported; the error names the Archboard node types to use instead.
previewNoWith dryRun: also render a PNG (the whole poster, as export_diagram draws it).
diagramIdYesDiagram id (from list_diagrams or create_diagram).
directionNoFlow direction; overrides the Mermaid header. "auto" keeps the header direction unless the drawing gets much wider than tall (or taller than wide), then uses the other one; the result says which.
placementNoWhere to put the drawing: "auto" (default; right of existing content, or 0,0 on an empty canvas), "right", "below", or a top-left point { x, y } in world pixels.
infographicNoInfographic spec: theme + blocks; the server measures and lays the blocks out on a 12-column poster. Read read_me topic "infographics".

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / frame / description
      Previous value: -"{ title } wraps a Mermaid drawing in a new frame; { id } puts the drawing or the poster inside an existing container (frame, namespace, VPC…) below its children and grows the container if needed."New value: +"{ title } wraps a Mermaid drawing in a new frame; { id } puts the drawing or the poster inside an existing container (frame, namespace, VPC…) below its children and grows the container if needed (a page keeps its size)."
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the annotations, it discloses that the change is revertible with revert_change, that it only adds shapes and never mutates existing content, and that dryRun returns placeholder ids. It also describes preview PNG behavior, return fields, warnings, and how warning fixes should be applied.

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?

The key scope and the apply_ops alternative are front-loaded, and the length is justified by the tool's complexity, nested inputs, and lack of an output schema. However, it is a dense single paragraph that could be easier to scan if broken into shorter sections.

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?

Given 11 parameters, nested objects, and no output schema, the description is complete enough to call correctly. It covers both input modes, dryRun and preview behavior, return value shapes for Mermaid and infographic paths, and warning semantics.

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 91%, so the schema already carries most parameter meaning. The description still adds useful constraints not evident in the schema, especially that exactly one of mermaid and infographic must be supplied, plus examples of infographic block kinds and Mermaid id/type mapping behavior.

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 specific verb and resource: "Adds a new drawing to an existing diagram as one agent change." It immediately narrows the scope to additions only and explicitly contrasts itself with apply_ops for modifying existing shapes, so an agent can distinguish it from siblings without consulting schemas.

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?

It gives clear when-to-use guidance: add a new drawing to an existing diagram, using either Mermaid or an infographic spec. It also gives when-not-to-use guidance, stating that changes to existing shapes must use apply_ops, and it notes dryRun for checking without writing.

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.