# Graphviz diagram renderer

Draw a diagram from Graphviz DOT source as SVG or PNG: flowcharts, trees, networks and dependency graphs.

Runs the Graphviz layout program on your DOT source and returns the drawing as a file. The source is checked first, and the program runs with file loading switched off.

- Endpoint: `POST https://setget.net/v1/tools/graphviz` with JSON `{"input": {...}}` (add `"wait": 30` to hold the reply until the job finishes)
- MCP: `run_tool` with `slug` = `graphviz`
- Page: https://setget.net/tools/graphviz

## Files in, files out

This is a file tool. Its file inputs take file references, not file contents and not web addresses.

- Get a reference by uploading: `curl -T FILE https://setget.net/drop/` prints a line `ref  <id>/f1`. Or `POST https://setget.net/v1/drops` with `{"files":[{"name","size"}]}`, PUT the bytes to the returned `upload.url` with the listed headers, and use the file's `ref`. Over MCP use the `drop` tool. A file under about 700 KB can also be sent in place as a `data:<type>;base64,<content>` URI.
- Uploads are at most 100 MB per file, are readable by anyone with the link, and expire (one hour by default). Programs are refused.
- The tool runs as a job. The reply is `{"tool", "ms", "result", "files", "job"}`: `result` is JSON, and every result file comes back in `files` as `{"name", "size", "content_type", "kind", "url", "ref"}`. Download it from `url`, or pass `ref` as the input of another file tool.
- A job still running when the wait ends answers 202 with `job`. Follow it with `GET https://setget.net/v1/jobs/<id>?wait=30`, or stream progress from `GET https://setget.net/v1/jobs/<id>/events` (over MCP: the `job` tool). A person can watch it at `job.url`.

## Inputs

- `source` (required, string): The graph in the DOT language.
- `engine` (optional, string, one of `dot`, `neato`, `fdp`, `circo`, `twopi`, default `"dot"`): Layout style: dot for layered flowcharts and trees, neato and fdp for networks, circo for circles, twopi for rings around a centre.
- `format` (optional, string, one of `svg`, `png`, default `"svg"`): svg stays sharp at any size; png is a fixed-size picture.
- `dpi` (optional, integer, default `96`, range 48..300): Resolution of a PNG, in dots per inch. Ignored for SVG.

## Example 1: A small flowchart as SVG

```json
{"input":{"source":"digraph { rankdir=LR; Plan -> Build -> Test -> Ship; Test -> Build [label=\"fix\"]; }"},"wait":30}
```

## Example 2: A circular layout as PNG

```json
{"input":{"source":"graph { a -- b -- c -- d -- a; a -- c; node [shape=circle]; }","engine":"circo","format":"png","dpi":120},"wait":30}
```

**Can my graph use pictures, custom shapes or font files?** No. Only what is written in the source is drawn. The "image", "shapefile", "imagepath" and "fontpath" settings and IMG elements in labels are refused, because they read files from the machine that draws the graph.

**What happens to links in my graph?** URL and href settings are removed from SVG results, so the drawing never points anywhere. The result says how many were removed.

**What are the limits?** 50,000 characters of source, about 1,000 nodes and 3,000 edges, and 20 seconds to work out the layout. Large networks lay out fastest with the dot engine.

**How do I get a JPG or WebP?** Render to PNG here, then pass the result to image-convert.
