Skip to main content
Glama

Import a Mermaid flowchart

import_mermaid
DestructiveIdempotent

Convert a Mermaid flowchart or graph into a BPMN process and replace the open diagram with an auto-laid-out result; returns shape counts and warnings.

Instructions

Replaces the whole open diagram with a process converted from a Mermaid flowchart (flowchart or graph), then laid out automatically. Rectangles become tasks, {decisions} exclusive gateways, ((circles)) and ([stadiums]) events, [[subroutines]] call activities, [(cylinders)] data stores, [/parallelograms/] and documents data objects, comment or brace shapes annotations (%% lines are left out), fork parallel gateways, delay timer events. Link labels become flow names. A step with several outgoing links gets a split gateway: exclusive if the links are labelled, parallel otherwise. Missing start and end events are added. Subgraphs become lanes, or expanded subprocesses with subgraphs "subprocesses". Styles, clicks and the direction are ignored. Other Mermaid diagrams (sequence, state, class…) are rejected and the diagram stays unchanged. Returns the counts and the warnings, line by line.

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": {
      "mermaid": "<mermaid>"
    },
    "name": "import_mermaid"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameNoName of the process, or of its pool when there are lanes. Default: "Process"
mermaidYesThe Mermaid flowchart, starting with "flowchart" or "graph", or Markdown text holding a ```mermaid block
flowchartNotrue: keep Mermaid shapes as flowchart shapes. Default: the editor palette
subgraphsNoWhat subgraphs are: roles ("lanes", the default) or steps ("subprocesses")

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.5.1
    • addedInput schema / properties / flowchart
      Added value: +{
      +  "description": "true: keep Mermaid shapes as flowchart shapes. Default: the editor palette",
      +  "type": "boolean"
      +}
  2. Addedv1.4.6

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already flag destructiveHint=true and idempotentHint=true, and the description goes well beyond that: it discloses that the entire open diagram is replaced, which Mermaid constructs are silently dropped (styles, clicks, direction, %% comment lines), that missing start/end events are auto-added, that a split gateway is inferred exclusive vs parallel based on link labels, and that unsupported diagram types leave the diagram unchanged. It also reports that counts and per-line warnings are returned, which matters because there is no output schema.

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-loaded with the destructive scope, then the conversion mapping, then rejection behavior and return values – a sensible order. It is dense but every clause carries real information; the only cost is a long run-on middle sentence listing shapes, which reads as a wall rather than a structured list.

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 destructive, whole-document-replacing conversion tool with four params and no output schema, the description covers input acceptance, element mapping, inference rules, dropped features, failure behavior, and the shape of the response (counts and warnings). An agent has enough to decide whether to call it and to interpret the result without opening anything else.

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; the description earns more by explaining semantics the schema does not: 'Subgraphs become lanes, or expanded subprocesses with subgraphs "subprocesses"' clarifies the enum's effect on output, and the shape-to-element mapping table gives meaning to the flowchart flag's alternatives. The 'name' parameter and the exact behavior of 'flowchart: true' are left mostly to the schema text.

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 and resource: 'Replaces the whole open diagram with a process converted from a Mermaid flowchart (flowchart or graph), then laid out automatically.' The verb 'replaces' plus the scope ('whole open diagram') distinguishes it immediately from read-style siblings such as get_diagram_mermaid and from generic element editors like add_shapes.

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 conditions for use: input must start with 'flowchart' or 'graph' or be Markdown holding a ```mermaid block, and 'Other Mermaid diagrams (sequence, state, class…) are rejected and the diagram stays unchanged.' It does not name an alternative for non-Mermaid import paths (e.g. set_diagram_xml), so it falls short of full when-to-use/when-not routing, but the accepted-input boundary is explicit.

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