Diagram Rendering (Mermaid)
diagram_renderRender Mermaid diagram code to SVG and/or PNG: flowchart, sequence, class, state, ER, gantt, pie, mindmap, timeline and more. Invalid syntax returns HTTP 400 with the Mermaid parse error (not charged), so an agent can fix and retry. Params: code (Mermaid source, required), format (svg default, png or both), theme (default, dark, neutral, forest, base), width (200 to 4000, default 1200), background. Price: $0.01 USDC per call, paid inside this MCP call via x402 (USDC on Base, Solana, Polygon or Arbitrum). x402 MCP clients such as @x402/mcp pay automatically. Free sample: call with the example input {"code":"flowchart LR\n A[Agent] -->|HTTP 402| B(agentsvc.io)\n B --> C{Paid?}\n C -->|yes| D[JSON result]","format":"svg"}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Mermaid diagram source | |
| theme | No | default | |
| width | No | ||
| format | No | svg | |
| background | No |