Agentic Mermaid
Server Details
Render, verify, describe, and safely edit Mermaid diagrams through MCP.
- Status
- Healthy
- Last Tested
- Transport
- Streamable HTTP
- URL
- Repository
- adewale/agentic-mermaid
- GitHub Stars
- 10
Glama MCP Gateway
Connect through Glama MCP Gateway for full control over tool access and complete visibility into every call.
Full call logging
Every tool call is logged with complete inputs and outputs, so you can debug issues and audit what your agents are doing.
Tool access control
Enable or disable individual tools per connector, so you decide what your agents can and cannot do.
Managed credentials
Glama handles OAuth flows, token storage, and automatic rotation, so credentials never expire on your clients.
Usage analytics
See which tools your agents call, how often, and when, so you can understand usage patterns and catch anomalies.
Tool Definition Quality
Average 4.5/5 across 9 of 9 tools scored.
Most tools have clear, distinct purposes: build and mutate are separated by create-vs-edit, describe and verify are separated by semantic-explain-vs-validate, and render_* variants differ by output format. The only potential ambiguity is between execute and build/mutate, but the descriptions explicitly steer users away from execute for straightforward structured edits.
Tool names mix two conventions: bare verbs (build, describe, execute, mutate, verify) and verb_noun with underscore (describe_sdk, render_ascii, render_png, render_svg). While readable and lower-case throughout, the inconsistency prevents a higher score.
9 tools is well within the 3-15 sweet spot and covers the domain of diagram authoring, editing, inspecting, verifying, and rendering without bloat. Each tool earns its place: build/mutate/execute for editing, describe/verify for analysis, render_* for output, and describe_sdk for schema discovery.
The tool set forms a complete lifecycle: create (build), edit (mutate, execute), inspect (describe, verify), and output (render_svg/png/ascii). describe_sdk provides schema discovery so agents can author valid operations. There are no obvious dead ends; even unsupported families are handled gracefully in the broader SDK design.
Available Tools
9 toolsbuildBuild Mermaid diagramARead-onlyIdempotentInspect
Author a new Mermaid diagram from blank by folding a list of structured ops
over an empty diagram of family. The declarative counterpart to hand-writing
source. Returns the same envelope as mutate:
{ ok, family, source, verify } or { ok:false, family, opIndex, error }.
Call describe_sdk for the family before authoring unfamiliar ops.
| Name | Required | Description | Default |
|---|---|---|---|
| ops | Yes | Non-empty ordered list of ops; each is { kind, ...fields }. | |
| family | Yes | Diagram family to author (one of: flowchart, state, sequence, timeline, class, er, journey, architecture, xychart, pie, quadrant, gantt, mindmap, gitgraph, radar). |
Tool Definition Quality
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description discloses the return envelope in both success and failure cases, and notes a prerequisite (`describe_sdk`). Annotations already indicate readOnly, idempotent, and non-destructive behavior, so the description adds value by explaining the process of folding ops and the exact response shape.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is three sentences long, front-loaded with the primary action, and each sentence earns its place: the core action, a clarifying analog, and the return/usage caveat. No wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
No output schema exists, but the description fully covers the return values, error format, and necessary prerequisites. With only two parameters and good annotations, the description gives the agent enough to understand behavior and integration with siblings.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
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 adds meaning by explaining that ops are 'folded' over an empty diagram, giving operational context beyond the schema's listing of `{ kind, ...fields }`. It also clarifies the role of `family` by naming it as the diagram type.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: author a new Mermaid diagram from blank using structured ops. It distinguishes itself from siblings by being 'the declarative counterpart to hand-writing source' and returns the same envelope as `mutate`, implying a different operation from that mutation tool.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies when to use this tool: when authoring a new diagram declaratively via ops rather than writing source directly. It also advises calling `describe_sdk` for unfamiliar ops. It does not explicitly name alternatives, but the reference to `mutate` and the broader sibling list provide enough context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
describeDescribe Mermaid diagramARead-onlyIdempotentInspect
Describe a Mermaid diagram. format=text returns { ok, text } with one or two summary sentences; format=json returns { ok, tree } with the AX tree; format=facts returns { ok, facts } with deterministic semantic fact lines for machine checking (for example edge A -> B : label, member Duck +quack()).
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | text (default), json AX tree, or facts semantic read-back. | |
| source | Yes | Mermaid source. |
Tool Definition Quality
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already establish read-only/idempotent behavior. The description adds value by disclosing the exact response shapes for each format and the deterministic nature of facts, which is beyond annotation coverage. No contradiction.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three compact sentences, front-loaded with the verb+resource, and every clause adds functional detail (format behaviors, response shapes, example). No fluff.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the simple 2-parameter schema and idempotent/read-only annotations, the description fully covers expected behavior for all three formats, including return shapes. No output schema is present, so this return-shape documentation is essential and sufficient.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema covers 100% of parameters, so baseline is 3. The description goes beyond schema by spelling out return objects for each format and giving a concrete fact example, though it does not add much to the 'source' parameter beyond schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb and resource ('Describe a Mermaid diagram') and the format parameter clarifies three distinct output modes. This clearly differentiates from siblings like describe_sdk and render_*.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives clear format-specific use context (e.g., facts for machine checking) but never explicitly states when to choose this tool over sibling tools such as render_* or verify. Usage is implied rather than directly contrasted.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
describe_sdkDescribe Mermaid SDK operationsARead-onlyIdempotentInspect
Return version-matched mutation operations for one diagram family. Use detail=signatures for the compact op menu or detail=fields (default) for exact field types, required flags, enum values, defaults, and constraints. Call this before build, mutate, or execute when the family schema is not already known.
| Name | Required | Description | Default |
|---|---|---|---|
| detail | No | signatures for a compact menu; fields for the complete schema (default). | |
| family | Yes | Diagram family whose mutation operations are needed. |
Tool Definition Quality
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare the tool as read-only, idempotent, and non-destructive, so the description does not need to repeat that. It adds useful behavioral context by describing the two output modes and the version-matched nature of the returned operations, which goes beyond the basic safety profile.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is three sentences long and every sentence earns its place: the first defines the core action, the second explains parameter choices, and the third gives invocation context. It is well-front-loaded and free of redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the lack of an output schema, the description does a good job of outlining what information will be returned (field types, required flags, enum values, defaults, constraints) and when to call it. However, it does not specify the exact return format (e.g., JSON), which is a minor gap for an agent that needs to parse the response.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema already covers both parameters fully (100% schema description coverage), so the baseline is 3. The description enhances this by explicitly explaining the purpose of each 'detail' value and how they change the output, which helps the agent choose correctly.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool returns version-matched mutation operations for a specific diagram family. It distinguishes itself from the sibling tools by explicitly positioning it as a prerequisite for build, mutate, or execute, and the name 'describe_sdk' differentiates it from the generic 'describe' sibling.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicit guidance is provided: 'Call this before build, mutate, or execute when the family schema is not already known.' It also instructs when to use each detail mode ('signatures' for compact menu, 'fields' for exact types), making the usage context clear and actionable.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
executeExecute Mermaid SDK codeARead-onlyInspect
Run JavaScript in an isolated sandbox; return a value. One call composes edits. Submit JavaScript; declaration types are guidance. No promises, async/await, dynamic import, or type annotations. Hosted note: execute runs in an on-demand isolate and costs more than the direct render_svg/render_ascii/render_png/verify/describe tools — prefer those for plain render/verify calls. For straightforward structured edits, prefer the declarative mutate/build tools; reserve execute for logic the ops don't express. Hosted mermaid.renderMermaidSVG*, renderMermaidASCII*, and layoutMermaidWithReceipt calls force security:'strict' and embedFontImport:false; caller code cannot weaken that host policy.
SDK declaration:
type DiagramKind = 'flowchart' | 'state' | 'sequence' | 'timeline' | 'class' | 'er' | 'journey' | 'architecture' | 'xychart' | 'pie' | 'quadrant' | 'gantt' | 'mindmap' | 'gitgraph' | 'radar'
type MutationOp = { kind: string; [field: string]: unknown }
type Result<T, E = { code: string; message: string }> = { ok: true; value: T } | { ok: false; error: E }
interface SourceLocation { readonly line: number; readonly col: number }
interface SourceMapSpans { readonly preserved: PreservedSourceSpans; readonly nodes: ReadonlyMap<string, SourceSpan>; readonly edges: ReadonlyMap<string, SourceSpan>; readonly groups: ReadonlyMap<string, SourceSpan>; readonly labels: ReadonlyMap<string, SourceSpan> }
interface SourceMap { readonly nodes: ReadonlyMap<string, SourceLocation>; readonly edges: ReadonlyMap<string, SourceLocation>; readonly groups: ReadonlyMap<string, SourceLocation>; readonly labels: ReadonlyMap<string, SourceLocation>; readonly spans?: SourceMapSpans }
interface ValidDiagram { readonly kind: DiagramKind; readonly source: SourceMap }
type ExternalFamilyId = family:${string}
interface ExtensionCompatibility {
readonly [contract: string]: string | undefined
readonly core?: string
readonly scene?: string
}
interface ExtensionProvenance { readonly owner: string; readonly source: string; readonly reference?: string }
interface ExtensionIdentity {
readonly id: ${Kind}:${string}
readonly kind: Kind
readonly version: string
readonly compatibility: ExtensionCompatibility
readonly provenance: ExtensionProvenance
}
interface SourceSpanPoint { readonly offset: number; readonly line: number; readonly col: number }
interface SourceSpan { readonly start: SourceSpanPoint; readonly end: SourceSpanPoint }
interface PreservedSourceSpans {
readonly source: SourceSpan
readonly wrapper?: SourceSpan
readonly frontmatter?: SourceSpan
readonly initDirectives?: readonly SourceSpan[]
readonly accessibilityDirectives?: readonly SourceSpan[]
readonly header: SourceSpan
readonly body: SourceSpan
}
interface SourcePreservationReceipt {
readonly version: 1
readonly classification: 'unsupported' | 'inventory-only' | 'unknown'
readonly source: string
readonly header: string
readonly upstreamFamilyId?: string
readonly mermaidVersion: string
readonly spans?: PreservedSourceSpans
}
interface ParseError {
readonly code: string
readonly message: string
readonly line?: number
readonly col?: number
readonly preservation?: SourcePreservationReceipt
readonly help?: string
}
interface ExtensionValidDiagram {
readonly kind: ExternalFamilyId
readonly descriptorIdentity: ExtensionIdentity<'family'>
readonly source: SourceMap
}
interface PreservedValidDiagram {
readonly kind: ExternalFamilyId
readonly source: SourceMap
readonly body: {
readonly kind: 'preserved'
readonly representation: 'opaque' | 'unknown'
readonly source: string
readonly preservation: SourcePreservationReceipt
readonly spans: PreservedSourceSpans
readonly diagnostic: {
readonly code: 'UNSUPPORTED_FAMILY' | 'UNKNOWN_HEADER' | 'FAMILY_DESCRIPTOR_MISMATCH'
readonly message: string
readonly help: string
}
}
}
type ParsedDiagram = ValidDiagram | ExtensionValidDiagram | PreservedValidDiagram
type RenderedRegionKind='node'|'edge'|'label'|'canvas'|'group'|'cluster'|'lane'|'band'|'compartment'|'plot'|'ring'
type DiagramActionSecurity='safe'|'unsafe'|'source-only'|'unsupported'
interface RenderedRegion { id:string;kind:RenderedRegionKind;elementId?:string;parentId?:string;bounds:{x:number;y:number;w:number;h:number};sourceLine?:number }
interface DiagramActionRecord { id?:string;regionId?:string;family:DiagramKind;target:string;action:'href'|'call'|'callback';raw:string;line?:number;href?:string;security:DiagramActionSecurity;executable:false;message?:string }
interface RenderedLayout { version: 1; kind: DiagramKind | ExternalFamilyId; bounds: { w: number; h: number }; nodes: unknown[]; edges: unknown[]; groups: unknown[]; regions?: RenderedRegion[]; actions?: DiagramActionRecord[] }
interface VerifyResult { ok: boolean; warnings: unknown[]; layout: RenderedLayout }
type CheckMermaidSpec = string[] | { include?: string[]; exclude?: string[]; exact?: boolean }
interface CheckMermaidResult { ok: boolean; missing: string[]; unexpected: string[]; facts: string[] }
type MermaidConfigScalar = string | number | boolean | null
type MermaidConfigValue = MermaidConfigScalar | MermaidConfigValue[] | { [key: string]: MermaidConfigValue | undefined }
type MermaidRuntimeConfig = { [key: string]: MermaidConfigValue | undefined }
interface StyleColors {bg?:string;fg?:string;line?:string;accent?:string;muted?:string;surface?:string;border?:string} type SceneStyleRole="node"|"edge"|"edge-label"|"group"|"group-header"|"label"|"actor"|"lifeline"|"activation"|"message"|"block"|"note"|"class-box"|"member"|"entity"|"attribute"|"relationship"|"cardinality"|"pie-slice"|"legend"|"bar"|"series"|"point"|"axis"|"grid"|"plate"|"section"|"task"|"milestone"|"marker-line"|"rail"|"period"|"event"|"score"|"actor-pill"|"service"|"junction"|"icon"|"title"|"defs"|"prelude"|"chrome" type ExactSceneStyleRole="node"|"edge"|"group"|"group-header"|"label"|"actor"|"relationship"|"pie-slice"|"legend"|"bar"|"series"|"point"|"task"|"milestone" type BindableSceneStyleRole="group-header"|"actor"|"relationship"|"pie-slice"|"legend"|"bar"|"series"|"point"|"task"|"milestone" type RoleStyleSpec={"fontFamily"?:string;"fontSize"?:number;"fontWeight"?:number;"letterSpacing"?:number;"textTransform"?:"uppercase"|"lowercase"|"capitalize";"textColor"?:string;"paddingX"?:number;"paddingY"?:number;"cornerRadius"?:number;"lineWidth"?:number;"bendRadius"?:number;"fillColor"?:string;"borderColor"?:string;"strokeColor"?:string;"headerFillColor"?:string;"cue"?:"none"|"outline"|"double-line"|"pattern"} type RoleStyleFor=R extends "node"|"actor"?Pick<RoleStyleSpec,"borderColor"|"cornerRadius"|"fillColor"|"fontSize"|"fontWeight"|"letterSpacing"|"lineWidth"|"paddingX"|"paddingY"|"textColor"|"textTransform">:R extends "edge"|"relationship"?Pick<RoleStyleSpec,"bendRadius"|"fontSize"|"fontWeight"|"letterSpacing"|"lineWidth"|"strokeColor"|"textColor"|"textTransform">:R extends "group"?Pick<RoleStyleSpec,"borderColor"|"cornerRadius"|"fillColor"|"fontFamily"|"fontSize"|"fontWeight"|"headerFillColor"|"letterSpacing"|"lineWidth"|"paddingX"|"paddingY"|"textColor"|"textTransform">:R extends "group-header"?Pick<RoleStyleSpec,"borderColor"|"cue"|"fillColor"|"fontFamily"|"fontSize"|"fontWeight"|"letterSpacing"|"lineWidth"|"strokeColor"|"textColor"|"textTransform">:R extends "label"?Pick<RoleStyleSpec,"fontSize"|"fontWeight"|"letterSpacing"|"textColor"|"textTransform">:R extends "pie-slice"|"task"|"milestone"?Pick<RoleStyleSpec,"borderColor"|"cue"|"fillColor"|"lineWidth"|"strokeColor">:R extends "legend"?Pick<RoleStyleSpec,"borderColor"|"fillColor"|"lineWidth"|"strokeColor"|"textColor">:R extends "bar"|"point"?Pick<RoleStyleSpec,"borderColor"|"fillColor"|"lineWidth"|"strokeColor">:R extends "series"?Pick<RoleStyleSpec,"borderColor"|"lineWidth"|"strokeColor">:never type RoleStyles={[R in ExactSceneStyleRole]?:Readonly<RoleStyleFor>} type SemanticBindingChannel="category" interface SemanticBinding {channel:SemanticBindingChannel;value:string;slot:string;role?:BindableSceneStyleRole} type BrandConstraint={kind:"contrast";action:'warn'|'error';role?:SceneStyleRole;minimum?:number}|{kind:"accent-area";action:'warn'|'error';maxFraction:number}|{kind:"mono-role";action:'warn'|'error';role:SceneStyleRole} interface StyleSpec {"formatVersion"?:1;"$schema"?:string;"name"?:string;"blurb"?:string;"colors"?:StyleColors;"font"?:string;"roles"?:RoleStyles;"semanticSlots"?:Readonly<Record<string,Readonly>>;"bindings"?:readonly SemanticBinding[];"constraints"?:readonly BrandConstraint[];"stroke"?:"crisp"|"jittered"|"freehand";"roughness"?:number;"bowing"?:number;"passes"?:number;"strokeWidth"?:number;"fill"?:"none"|"hachure"|"solid"|"wash";"hachureAngle"?:number;"hachureGap"?:number;"fillWeight"?:number;"washOpacity"?:number;"washEdge"?:number;"backdrop"?:"plain"|"paper-ruled"|"grid";"intent"?:"premium"|"draft"|"lofi";"mono"?:boolean} type StyleInput=string|StyleSpec type ArchitectureVisualOverrides = Readonly<Record<string, unknown>>
interface SharedRenderOptions { bg?:string;fg?:string;line?:string;accent?:string;muted?:string;surface?:string;border?:string;font?:string;style?:StyleInput | StyleInput[];padding?:number;nodeSpacing?:number;layerSpacing?:number;wrappingWidth?:number;componentSpacing?:number;transparent?:boolean;interactive?:boolean;shadow?:boolean;class?:{ hierarchicalNamespaces?:boolean };architecture?:{ visual?:ArchitectureVisualOverrides };timeline?:{ maxWidth?:number };journey?:{ experienceCurve?:boolean };gantt?:{ dependencyArrows?:boolean; criticalPath?:boolean };mermaidConfig?:MermaidRuntimeConfig;embedFontImport?:boolean;compact?:boolean;idPrefix?:string;security?:'default' | 'strict';ganttToday?:string;seed?:number;}
interface ConfigDiagnostic { code: 'INEFFECTIVE_CONFIG'; field: string; message: string } interface TerminalProjectionDiagnostic { code: string; feature: string; message: string } interface SvgRenderOptions extends SharedRenderOptions { onConfigDiagnostic?:(diagnostic: ConfigDiagnostic) => void;} interface AsciiRenderOptions extends SharedRenderOptions { useAscii?:boolean;paddingX?:number;paddingY?:number;boxBorderPadding?:number;colorMode?:'auto' | 'none' | 'ansi16' | 'ansi256' | 'truecolor' | 'html';theme?:{ fg?:string; border?:string; line?:string; arrow?:string; accent?:string; bg?:string; corner?:string; junction?:string };maxWidth?:number;targetWidth?:number;onConfigDiagnostic?:(diagnostic: ConfigDiagnostic) => void;onProjectionDiagnostic?:(diagnostic: TerminalProjectionDiagnostic) => void;} interface LayoutRenderOptions extends SharedRenderOptions { debug?:boolean;regions?:boolean;actions?:boolean;onConfigDiagnostic?:(diagnostic: ConfigDiagnostic) => void;}
interface RenderArtifactDiagnostic { code: string; message?: string; reference?: string; feature?: string; input?: string; canonicalId?: string; removal?: { release: string; date: string } }
interface CapabilityResolution { readonly id: ${string}:${string}; readonly range: string; readonly level: 'required' | 'preferred' | 'optional'; readonly status: 'selected' | 'unsupported' | 'incompatible'; readonly version?: string }
interface CapabilityDecision { readonly version: 1; readonly accepted: boolean; readonly resolutions: readonly CapabilityResolution[] }
interface RenderExecutionDecision { readonly family: { readonly id: string; readonly version: string };readonly backend: { readonly mode: 'scene'; readonly requestedId: string; readonly selectedId: string; readonly version: string; readonly hostPolicy: boolean } | { readonly mode: 'family-svg' };readonly digest: string;}
interface RenderRequestReceipt { version: 2; output: 'svg' | 'png' | 'ascii' | 'unicode' | 'html' | 'layout'; sharedRequestDigest: string; requestDigest: string; appearanceDigest: string; capabilityDecision: CapabilityDecision; diagnostics?: readonly RenderArtifactDiagnostic[]; graphicalProjectionDigest?: string; executionDecision?: RenderExecutionDecision }
interface RenderedSvg { svg: string; receipt: RenderRequestReceipt } interface RenderedAscii { text: string; receipt: RenderRequestReceipt; terminalStyle: Record<string, unknown>; outputPolicy: Record<string, unknown> } interface RenderedLayoutArtifact { layout: VerifyResult['layout']; receipt: RenderRequestReceipt }
declare const mermaid: { parseRegisteredMermaid(source: string): Result<ParsedDiagram, ParseError[]> createMermaid(kind: DiagramKind, opts?: { direction?: 'TD' | 'TB' | 'LR' | 'BT' | 'RL' }): ValidDiagram buildMermaid(kind: DiagramKind, ops: MutationOp[], opts?: { direction?: 'TD' | 'TB' | 'LR' | 'BT' | 'RL' }): Result<ValidDiagram, { code: string; message: string; opIndex: number }> asFlowchart(diagram: ValidDiagram): ValidDiagram | null asState(diagram: ValidDiagram): ValidDiagram | null asSequence(diagram: ValidDiagram): ValidDiagram | null asTimeline(diagram: ValidDiagram): ValidDiagram | null asClass(diagram: ValidDiagram): ValidDiagram | null asEr(diagram: ValidDiagram): ValidDiagram | null asJourney(diagram: ValidDiagram): ValidDiagram | null asArchitecture(diagram: ValidDiagram): ValidDiagram | null asXyChart(diagram: ValidDiagram): ValidDiagram | null asPie(diagram: ValidDiagram): ValidDiagram | null asQuadrant(diagram: ValidDiagram): ValidDiagram | null asGantt(diagram: ValidDiagram): ValidDiagram | null asMindmap(diagram: ValidDiagram): ValidDiagram | null asGitGraph(diagram: ValidDiagram): ValidDiagram | null asRadar(diagram: ValidDiagram): ValidDiagram | null mutate(diagram: ValidDiagram, op: MutationOp): Result verifyMermaid(input: ParsedDiagram | string, opts?: { suppress?: string[]; labelCharCap?: number; renderOptions?: SharedRenderOptions }): VerifyResult analyzeMermaid(diagram: ValidDiagram): Record<string, unknown> analyzeMermaidSource(source: string): Result<Record<string, unknown>> describeMermaidFacts(diagram: ValidDiagram): string[] describeMermaidFactsSource(source: string): Result<string[]> checkMermaid(diagram: ValidDiagram, spec: CheckMermaidSpec): CheckMermaidResult checkMermaidSource(source: string, spec: CheckMermaidSpec): Result serializeMermaid(diagram: ParsedDiagram): string renderMermaidSVG(input: ParsedDiagram | string, opts?: SvgRenderOptions): string renderMermaidSVGWithReceipt(input: ParsedDiagram | string, opts?: SvgRenderOptions): RenderedSvg renderMermaidASCII(input: ParsedDiagram | string, opts?: AsciiRenderOptions): string renderMermaidASCIIWithReceipt(input: ParsedDiagram | string, opts?: AsciiRenderOptions): RenderedAscii layoutMermaidWithReceipt(input: ParsedDiagram | string, opts?: LayoutRenderOptions): RenderedLayoutArtifact describeOps(family: DiagramKind): Record<string, { name: string; required: boolean; type: string; note?: string }[]> opSignatures(family: DiagramKind): string[] }
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | JavaScript to execute; mermaid.* SDK is global. | |
| timeoutMs | No | Optional CPU-time budget (default 5000ms, max 30000ms). |
Tool Definition Quality
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations declare readOnlyHint=true, but the description adds substantial behavioral context: the sandbox is isolated, one call composes edits, promises/async/await/dynamic import/type annotations are unsupported, hosted runs cost more, and host policies force security:'strict' and embedFontImport:false. This goes far beyond what annotations provide.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The human-readable prose is concise, front-loaded, and well-structured. However, the SDK type declaration is extremely long and could overwhelm the model context for a tool-selection task. While useful as reference, it is not concise and includes many details that are not necessary for deciding when to invoke this tool.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
This is a complex code-execution tool with no output schema. The description covers environment constraints, security policy, cost trade-offs, alternatives, and API surface. It gives an agent everything needed to determine if and how to use execute correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% coverage for both parameters, so the baseline is 3. The description adds meaningful semantics for the 'code' parameter by documenting the complete mermaid.* SDK surface, which tells the agent what methods and types are available during execution. This is extra value beyond basic parameter descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
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: 'Run JavaScript in an isolated sandbox; return a value.' It clearly distinguishes the tool from siblings by stating that direct render/verify and declarative mutate/build tools should be preferred for simpler operations, positioning execute as the escape hatch for complex logic.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit when-to-use and when-not-to-use guidance, naming alternatives: 'prefer those for plain render/verify calls' and 'prefer the declarative mutate/build tools; reserve execute for logic the ops don't express.' This is exactly the kind of clear decision-making context needed.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
mutateEdit Mermaid diagramARead-onlyIdempotentInspect
Apply a list of structured edit ops to an existing Mermaid source and
return the edited diagram. This is the declarative counterpart to execute:
plain JSON in, plain JSON out, no sandbox. Prefer it for straightforward edits;
reserve execute for logic the ops don't express.
Returns { ok, family, source, verify:{ ok, warnings } } on success, or
{ ok:false, family, opIndex, error } — where error names the offending field
and lists the valid ones — when an op is malformed or cannot apply. Ops apply in
order and are all-or-nothing: the first failing op stops the batch (its position
is opIndex) and the input is left untouched.
Each op is { "kind": , …fields }. Call describe_sdk for the detected
family before authoring unfamiliar ops; it returns compact signatures or exact
field types, enum values, defaults, and constraints.
| Name | Required | Description | Default |
|---|---|---|---|
| ops | Yes | Non-empty ordered list of edit ops; each is { kind, ...fields }. | |
| source | Yes | Mermaid source to edit. |
Tool Definition Quality
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Even though annotations already declare the tool read-only and idempotent, the description adds crucial behavioral details: ops apply in order, are all-or-nothing, the first failing op stops the batch, and the input is left untouched. It also specifies the exact error shape and that `opIndex` indicates the failing op. No contradiction with annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Every sentence contributes unique information: purpose, relationship to `execute`, usage guidance, return/error behavior, and op format. The description is detailed but tightly structured, front-loaded with the core purpose and followed by necessary qualifications.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema, the description fully specifies success and failure return shapes, the meaning of `opIndex`, and the all-or-nothing behavior. It also references `describe_sdk` for op signatures, making it complete for a complex mutation tool with a generic item schema. Sibling tool distinctions are clearly handled.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema only defines `source` and `ops` generically, but the description adds essential semantics: each op is `{ kind, ...fields }`, ops are ordered, and the batch is atomic. It also explains how the parameters relate to the output and error handling, going well beyond the schema's coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description leads with a specific verb and resource: 'Apply a list of structured edit ops to an existing Mermaid source and return the edited diagram.' It clearly distinguishes itself from the sibling `execute` by calling itself the declarative counterpart, making its role unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicit guidance is provided: prefer `mutate` for straightforward edits and reserve `execute` for logic the ops don't express. It also advises calling `describe_sdk` before authoring unfamiliar ops, giving clear when-to-use and when-not-to-use instructions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
render_asciiRender Mermaid as textARead-onlyIdempotentInspect
Render a Mermaid source string to text. Returns { ok, text }. useAscii true → plain ASCII (+,-,|); false/absent → Unicode box drawing (┌,─,│). targetWidth sets a hard terminal display-cell bound; impossible bounds return a typed error.
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes | Mermaid source. | |
| options | No | Shared advanced RenderOptions object, including style/palette/config/security. | |
| useAscii | No | true = ASCII characters, false = Unicode (default). | |
| targetWidth | No | Hard maximum line width in terminal display cells. |
Tool Definition Quality
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true and idempotentHint=true, lowering the burden. The description adds valuable behavioral context: return shape, concrete ASCII vs Unicode glyphs (+,-,| vs ┌,─,│), default behavior when useAscii is absent, and a typed error for impossible targetWidth bounds. There is no contradiction with annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three sentences, front-loaded with the core purpose, and each subsequent sentence adds essential behavioral detail. No filler or repetition of schema content; it is efficiently structured.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
There is no output schema, so the description properly covers return shape and error behavior. It does not explain the extensive options object, but the schema already does, and the most terminal-relevant options (useAscii, targetWidth) are highlighted. This is complete enough for an agent to use the tool correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
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 description adds meaningful details beyond the schema: it shows exact ASCII characters, specifies that absent useAscii defaults to Unicode, and reveals the error condition for targetWidth. These enrich the schema's brief descriptions without redundancy.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with 'Render a Mermaid source string to text,' clearly identifying the verb, resource, and output format. It distinguishes from sibling renderers (render_png/render_svg) by specifically targeting text output and even states the return shape ({ ok, text }).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description does not explicitly name alternatives, but phrases like 'to text' and 'terminal display-cell bound' make the intended context (plain text/terminal rendering) very clear. It stops short of explicitly saying 'use this instead of render_png/render_svg,' so it is not a 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
render_pngRender Mermaid as PNGARead-onlyIdempotentInspect
Rasterize a Mermaid source string to PNG. Returns { ok, png_base64 }. Hosted rendering uses resvg-wasm with bundled fonts; bytes may differ from the local napi renderer, so hosted PNG is a convenience surface, not part of the byte-determinism contract. For file/URL artifacts use the local stdio server.
| Name | Required | Description | Default |
|---|---|---|---|
| fitTo | No | Exactly one output width or height constraint. | |
| scale | No | Positive output scale used when no fitTo constraint is supplied. | |
| source | Yes | Mermaid source. | |
| options | No | Shared advanced RenderOptions object. | |
| background | No | Portable basic color or hex color painted behind the raster artifact. |
Tool Definition Quality
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already establish read-only, idempotent, non-destructive behavior. The description adds valuable context: hosted rendering uses resvg-wasm with bundled fonts, bytes may differ from the local napi renderer, and the return shape is { ok, png_base64 }. This goes beyond the annotations without contradicting them.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is three sentences with no fluff. The first sentence states the core purpose and return format, the second adds a critical determinism caveat, and the third points to an alternative for different artifact types. Every sentence earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the absence of an output schema, the description usefully states the return shape. It also covers the hosted/local distinction and determinism caveat. The schema is very rich and already documents all parameters. Minor gaps remain (e.g., error behavior, size limits), but overall the description is complete enough for an agent to invoke and interpret results.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so each parameter already has a description. The tool description adds little new parameter-level meaning beyond confirming the source is a string and mentioning a distinction for file/URL artifacts. Since the schema carries the parameter burden, a baseline of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a specific verb+resource: 'Rasterize a Mermaid source string to PNG.' It also states the return shape '{ ok, png_base64 }' and explicitly distinguishes this tool from image-byte determinism and the local stdio server, making its scope clear relative to sibling tools like render_svg and render_ascii.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives clear context: this is the hosted PNG renderer for Mermaid source strings, and it warns that hosted output is not part of the byte-determinism contract. It also provides an exclusion: 'For file/URL artifacts use the local stdio server.' It doesn't explicitly name sibling tools like render_svg, but the guidance is sufficient for most selection decisions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
render_svgRender Mermaid as SVGARead-onlyIdempotentInspect
Render a Mermaid source string to themeable SVG. Returns { ok, svg }. Layout is deterministic: identical input produces identical geometry. The hosted boundary forces security:'strict' and embedFontImport:false.
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes | Mermaid source. | |
| options | No | Shared advanced RenderOptions object. Styles accept a registered Look (crisp, hand-drawn, excalidraw, pen-and-ink, freehand, watercolor, blueprint, look:tufte, accessible-high-contrast, patent-drawing, status-dashboard, ops-schematic, chalkboard, risograph, architectural-plan, publication-figure), Palette (paper, dusk, zinc-light, zinc-dark, tokyo-night, tokyo-night-storm, tokyo-night-light, catppuccin-mocha, catppuccin-latte, nord, nord-light, dracula, github-light, github-dark, solarized-light, solarized-dark, one-dark, salmon, salmon-dark, tufte-dark), inline record, or left-to-right stack. |
Tool Definition Quality
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false. The description adds meaningful behavioral details beyond those: deterministic layout ('identical input produces identical geometry') and hosted-boundary constraints ('forces security:\'strict\' and embedFontImport:false'). No contradiction with annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is three tight sentences: purpose, return shape, and behavioral constraints. It is front-loaded with the action and avoids redundant restatement of the title or annotations.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with a very large options schema, the description captures the core behavior, return shape, determinism, and security constraints. It does not cover error behavior or supported Mermaid families, but the schema and annotations compensate for most gaps, and the absence of an output schema is mitigated by the explicit { ok, svg } return note.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
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 description adds only the phrase 'source string' and 'themeable SVG,' while the schema fully documents both parameters and all nested option properties. No additional semantic value is provided beyond what the schema already contains.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
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: 'Render a Mermaid source string to themeable SVG.' It also names the return shape ({ ok, svg }), clearly distinguishing this tool from sibling renderers like render_ascii and render_png by output format.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives clear context that this tool produces SVG output, which differentiates it from ASCII and PNG rendering siblings. It does not explicitly name alternatives or provide when-to-use/when-not-to-use guidance, but the output-type framing is sufficient for basic selection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
verifyVerify Mermaid diagramARead-onlyIdempotentInspect
Parse and verify a Mermaid diagram without rendering it. Returns
{ ok, family, summary, warnings, layout: { bounds, nodes, edges } } for valid
diagrams and { ok: false, errors } for parse failures. family is the detected
diagram family and summary a one-line description — check them: ok:true only
means the diagram is structurally valid, not that it is the kind you intended.
Warnings use the layout-rubric codes.
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes | Mermaid source. |
Tool Definition Quality
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description goes beyond annotations by specifying the exact return shape for both success and failure, and it discloses a non-obvious behavioral nuance: ok:true does not guarantee the diagram is the intended type. This is critical for correct use and is not captured by the readOnly/idempotent hints.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is compact and well-structured: it starts with the primary action, then the return format, and then the key caveat about interpretation. Every sentence earns its place without redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a single-parameter tool with no output schema, the description is complete. It explains the return values, the distinction between structural validity and intent, and the warning codes. No critical information is missing for an agent to decide when and how to use this tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema covers the single parameter 'source' with a description ('Mermaid source'), so schema coverage is 100%. The tool description adds no additional parameter semantics beyond what is in the schema, hence the baseline score.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Parse and verify a Mermaid diagram without rendering it,' which pairs a specific verb with a resource and scope. It distinguishes itself from sibling render tools by explicitly excluding rendering, making its purpose unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives clear context for when to use this tool (verifying without rendering) and provides important guidance on interpreting the ok flag (check family and summary, as ok:true only means structural validity). It does not explicitly name alternatives, so it stops 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.
Claim this connector by publishing a /.well-known/glama.json file on your server's domain with the following structure:
{
"$schema": "https://glama.ai/mcp/schemas/connector.json",
"maintainers": [{ "email": "your-email@example.com" }]
}The email address must match the email associated with your Glama account. Once published, Glama will automatically detect and verify the file within a few minutes.
Control your server's listing on Glama, including description and metadata
Access analytics and receive server usage reports
Get monitoring and health status updates for your server
Feature your server to boost visibility and reach more users
For users:
Full audit trail – every tool call is logged with inputs and outputs for compliance and debugging
Granular tool control – enable or disable individual tools per connector to limit what your AI agents can do
Centralized credential management – store and rotate API keys and OAuth tokens in one place
Change alerts – get notified when a connector changes its schema, adds or removes tools, or updates tool definitions, so nothing breaks silently
For server owners:
Proven adoption – public usage metrics on your listing show real-world traction and build trust with prospective users
Tool-level analytics – see which tools are being used most, helping you prioritize development and documentation
Direct user feedback – users can report issues and suggest improvements through the listing, giving you a channel you would not have otherwise
The connector status is unhealthy when Glama is unable to successfully connect to the server. This can happen for several reasons:
The server is experiencing an outage
The URL of the server is wrong
Credentials required to access the server are missing or invalid
If you are the owner of this MCP connector and would like to make modifications to the listing, including providing test credentials for accessing the server, please contact support@glama.ai.
Discussions
No comments yet. Be the first to start the discussion!
Related MCP Servers
- Alicense-qualityDmaintenanceProvides MCP tools to validate Mermaid diagram syntax, render diagrams to SVG, and get documentation links.Last updated9016MIT
- Flicense-qualityDmaintenanceEnables AI to create, edit, and manage Mermaid diagrams via MCP, with real-time preview in a browser-based editor.Last updated3
- AlicenseAqualityBmaintenanceMCP Server to previewing mermaid diagrams. https://github.com/veelenga/claude-mermaid/Last updated2726196MIT
- Alicense-qualityCmaintenanceEnables AI agents to interact with a local Mermaid diagram editor via MCP, allowing them to get and set diagrams programmatically.Last updated11,998,44111Apache 2.0