Skip to main content
Glama

generate_diagram_from_mermaid

Convert Mermaid diagram code to D2 format and generate PNG images for flowcharts, sequence diagrams, ER diagrams, and other visualizations.

Instructions

Convert a Mermaid diagram definition into a D2 diagram and return a PNG image. Use this tool when the user has existing Mermaid code (flowchart, sequenceDiagram, erDiagram, etc.) and wants it converted to D2 or rendered as an image. Pass the Mermaid source as content. Returns a link to view and edit the generated diagram in the browser.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYesA Mermaid diagram definition to convert to D2. Pass the raw Mermaid source (e.g. flowchart, sequenceDiagram, erDiagram). Example: "flowchart LR A --> B --> C"
promptNoOptional instruction for layout or styling of the converted diagram.
diagramTypeNoPreferred diagram type for the converted D2 output.
isIconEnabledNoSet to true when the user asks to include icons in the diagram.
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It describes the core transformation behavior (Mermaid to D2 conversion with PNG output) and mentions the return format ('Returns a link to view and edit the generated diagram in the browser'), but doesn't cover important aspects like error handling, performance characteristics, authentication needs, or rate limits.

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?

The description is efficiently structured with three focused sentences: purpose statement, usage guidance, and return value explanation. Every sentence earns its place with no wasted words, and the most critical information is front-loaded.

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?

For a transformation tool with no annotations and no output schema, the description does well by explaining the core behavior, usage context, and return format. However, it could be more complete by addressing potential limitations, error scenarios, or transformation constraints given the complexity of diagram conversion.

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?

With 100% schema description coverage, the baseline is 3. The description mentions the 'content' parameter ('Pass the Mermaid source as content') but doesn't add significant semantic value beyond what's already documented in the comprehensive schema descriptions for all four parameters.

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 specific action ('Convert a Mermaid diagram definition into a D2 diagram and return a PNG image'), identifies the resource ('Mermaid diagram definition'), and distinguishes it from sibling tools by specifying it's for Mermaid code conversion rather than ASCII, image, JSON, or text inputs.

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?

The description explicitly states when to use this tool ('when the user has existing Mermaid code... and wants it converted to D2 or rendered as an image'), provides clear context about the input type, and implicitly distinguishes from sibling tools by specifying Mermaid-specific usage.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/erajasekar/ai-diagram-maker-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server