# Kroki diagram to SVG

Render a text diagram (Mermaid, PlantUML, C4, Graphviz DOT, D2, BPMN, DBML, Vega-Lite, WaveDrom, Excalidraw and more) to SVG on the free kroki.io service. Needs diagram type and source.

Render a text diagram (Mermaid, PlantUML, C4, Graphviz DOT, D2, BPMN, DBML, Vega-Lite, WaveDrom, Excalidraw and more) to SVG on the free kroki.io service. Returns the SVG markup as text, ready to save as a .svg file or embed in HTML or Markdown. A syntax error in the source answers 400. The source is sent to kroki.io: do not send confidential content.

- Tool ID: `kroki/render-diagram`
- Provider: [Kroki](/providers/kroki.md)
- Capability: [GitHub, npm & PyPI](/tools/developer-data/code.md)
- Price: no charge per call
- Authentication: an authorised Agentik workspace is required for execution, including zero-price tools.

## Pricing contract

No charge per call. A workspace is still needed so your agent can call it.


```json
{
  "model": "per_call",
  "amountUsd": 0
}
```

## Complete input schema


```json
{
  "type": "object",
  "properties": {
    "diagram_type": {
      "type": "string",
      "enum": [
        "mermaid",
        "plantuml",
        "c4plantuml",
        "graphviz",
        "d2",
        "bpmn",
        "dbml",
        "erd",
        "excalidraw",
        "nomnoml",
        "pikchr",
        "structurizr",
        "svgbob",
        "vega",
        "vegalite",
        "wavedrom",
        "wireviz",
        "blockdiag",
        "seqdiag",
        "actdiag",
        "nwdiag",
        "packetdiag",
        "rackdiag",
        "bytefield",
        "ditaa",
        "symbolator",
        "tikz",
        "umlet"
      ],
      "description": "Diagram language, e.g. 'mermaid'"
    },
    "source": {
      "type": "string",
      "minLength": 1,
      "maxLength": 20000,
      "description": "Diagram source text, e.g. 'graph TD; Lead --> Customer;'"
    }
  },
  "required": [
    "diagram_type",
    "source"
  ],
  "additionalProperties": false
}
```

## Published example

This is the provider tool’s published example. Replace example values with the user’s requested inputs, respecting the schema; do not execute an example merely to test a connection.


```json
{
  "tool_id": "kroki/render-diagram",
  "input": {
    "diagram_type": "mermaid",
    "source": "graph TD; Lead --> Trial; Trial --> Customer;"
  }
}
```

## Execute and retrieve

Inspect again before execution, explain the price and obtain the required authority. Use MCP run_tool or POST /v1/run with this tool ID, valid input and an idempotency key. Save the returned run ID and follow the actual state. If Agentik answers that the tool is temporarily unavailable, do not retry it blindly; use discovery to propose an alternative.

A partial or uncertain result can still have consumed provider resources. Consult [billing](/docs/billing.md), [idempotency](/docs/idempotency.md) and [asynchronous results](/docs/async.md).

Licence: Kroki is MIT-licensed open source, offered as a free service at kroki.io.

[Provider documentation](https://docs.kroki.io/kroki/setup/http-clients/)

[REST inspection](https://api.agentik.cc/v1/tools/kroki/render-diagram) · [OpenAPI](/openapi.json) · [Connection guide](/connect.md)

---

[HTML page](/providers/kroki/render-diagram) · [Agent index](/llms.txt)
