Skip to main content
Glama

Create a diagram from Mermaid, or add one to the board

add_elements_from_mermaid

Creates diagram elements from a Mermaid definition. Creates a new canvas if room_id is omitted, or adds to the existing canvas if room_id is provided. Preferred over add_elements for new diagrams and large changes to existing diagrams whenever the content can be represented in Mermaid. Supports: flowchart, graph, flowchart-elk, sequenceDiagram, classDiagram, classDiagram-v2, stateDiagram, stateDiagram-v2, erDiagram, journey, gantt, pie, gitGraph, mindmap, timeline, C4Context, C4Container, C4Component, C4Dynamic, C4Deployment, sankey, sankey-beta, quadrantChart, xychart, xychart-beta, requirement, requirementDiagram, kanban, architecture, block, block-beta, packet, packet-beta, radar-beta, treemap, info. Example: "flowchart TD\n A[Start] --> B{Decision}\n B -->|Yes| C[OK]\n B -->|No| D[Cancel]"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
configNoOptional Mermaid rendering config. flowchart.curve is handled automatically.
mermaidYesMermaid diagram definition. Prefer converting compatible user requests into Mermaid instead of using add_elements.
room_idNoRoom ID of an existing canvas to add to. If the user is continuing a canvas already referenced in this conversation (by room_id, or a URL like ?room=[room_id] or /gdrive?id=[room_id]), pass it here. Omit to create a new canvas.
timeoutNoRoom lifetime in seconds (default: 3600, max: 86400). Only used when creating new canvas

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesCanvas room URL
isNewYesWhether a new canvas was created
room_idNoCanvas room ID
appStateYesCanvas app state (viewBackgroundColor, etc.)
elementsYesAll elements currently on the canvas
collabUrlYesCollaboration server URL for Socket.IO
pendingMermaidNoMermaid definition pending client-side rendering

TDQS

A4.1/5.0
Behavior4/5

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

The description goes beyond the annotations by disclosing that a new canvas is created if room_id is omitted, but elements are added to an existing canvas if room_id is provided. It also notes that config.curve is handled server-side. This adds meaningful behavioral context beyond the minimal readOnly/destructive hints. It does not mention error handling or whether elements are appended vs. replaced, but key behavior is covered.

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 description is well-organized: a clear first sentence, a preference statement, a list of supported diagram types, and an example. The list is long but necessary given the many Mermaid diagram types. No filler, but it could arguably be trimmed (e.g., move the full list to a separate reference). It earns a 4, not a 5, due to the length.

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?

The description covers the tool's purpose, when to use it, conditional behavior (new vs. existing canvas), supported Mermaid diagram types, and includes an example. An output schema exists, so return values need not be detailed. It misses error-handling and edge cases (e.g., invalid Mermaid), but it is fairly complete for the tool's complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The tool description adds a few useful notes (e.g., 'prefer converting compatible user requests into Mermaid') but mostly repeats what the schema already states for parameters like room_id and timeout. It does not significantly enrich parameter understanding beyond the schema.

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 clearly states the tool 'creates diagram elements from a Mermaid definition' and explains the key conditional behavior (new canvas vs. existing canvas based on room_id). It distinguishes itself from the sibling add_elements by specifying that this tool works from Mermaid and is preferred for certain cases.

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?

The description explicitly names an alternative (add_elements) and states when this tool is preferred: 'for new diagrams and large changes to existing diagrams whenever the content can be represented in Mermaid.' However, it does not explicitly state when NOT to use it (e.g., for small edits), so it falls just short of a 5.

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.

TDQS

A4.4/5.0
Disambiguation5/5

Each tool has a clear, distinct purpose: add_elements for manual creation, add_elements_from_mermaid for Mermaid-based creation, delete/query/update for lifecycle operations, and get_guide for workflow guidance. The overlap between the two creation tools is explicitly resolved in descriptions, leaving no ambiguity.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern: add_elements, add_elements_from_mermaid, delete_elements, get_guide, query_elements, update_elements. The modifier 'from_mermaid' extends the base pattern without breaking consistency, and all verbs are clear (add, delete, get, query, update).

Tool Count5/5

With 6 tools, the set is well-scoped for a canvas/diagram server, covering creation, query, update, delete, and guidance. This is within the ideal 3-15 range, and each tool earns its place without redundancy or bloat.

Completeness4/5

The toolset provides solid CRUD coverage for canvas elements (add, query, update, delete) plus a Mermaid import option and usage guidance. A minor gap is that there is no explicit tool to list existing canvases/rooms; agents must rely on prior room_id, which could be a friction point in new sessions, but core workflows are fully supported.

Resources