Dot/Graphviz — 18 Operations for AI Agents
DOT files are graphs as text — architecture diagrams, dependency maps, state machines rendered from source. act101 reads nodes and edges as structure, so agents modify the graph's meaning, not just its markup.
This page is the canonical reference an AI coding agent uses to refactor, query, and analyze Dot/Graphviz code through the act MCP server. 18 operations available: 0 refactor, 18 query, 0 analysis. Each operation is callable from Claude Code, Cursor, Codex, OpenCode, or any MCP-compatible agent host. Click any operation for a stable anchor link suitable for citation.
Worked Dot/Graphviz examples
act101 reads a Graphviz digraph's named structure — the graph itself and every named subgraph it contains — as its declarations: the skeleton reports the graph and each subgraph as a block. symbols reports the same subgraphs alongside every node declared with its own attribute statement, such as SEA [label="..."];; a node that appears only inside an edge statement, without a standalone declaration, is not reported. The unit of structure in this grammar is the named block: act101 does not read edge statements themselves, only the graph, subgraph, and node declarations that anchor them. Each example below is the verbatim output of the command shown, run against the file shown. Query outputs are pretty-printed with the timing block omitted.
Read a graph's named blocks without its edges
flight-routes.dot is a directed graph of flight routes organized into two subgraphs, cluster_domestic and cluster_international, connected by four edges.
$ act query skeleton flight-routes.dot
Before
digraph flight_routes {
rankdir=LR;
subgraph cluster_domestic {
label="Domestic";
SEA [label="Seattle-Tacoma"];
ORD [label="Chicago O'Hare"];
JFK [label="John F. Kennedy"];
SEA -> ORD;
ORD -> JFK;
}
subgraph cluster_international {
label="International";
LHR [label="London Heathrow"];
HND [label="Tokyo Haneda"];
JFK -> LHR;
SEA -> HND;
}
}
Output
{
"type": "Skeleton",
"declarations": [
{
"kind": "block",
"name": "flight_routes",
"range": {
"start": {
"file": "flight-routes.dot",
"line": 1,
"column": 1,
"byte_offset": 0
},
"end": {
"file": "flight-routes.dot",
"line": 21,
"column": 1,
"byte_offset": 398
}
},
"name_range": {
"start": {
"file": "flight-routes.dot",
"line": 1,
"column": 9,
"byte_offset": 8
},
"end": {
"file": "flight-routes.dot",
"line": 1,
"column": 22,
"byte_offset": 21
}
}
},
{
"kind": "block",
"name": "cluster_domestic",
"range": {
"start": {
"file": "flight-routes.dot",
"line": 4,
"column": 3,
"byte_offset": 41
},
"end": {
"file": "flight-routes.dot",
"line": 11,
"column": 4,
"byte_offset": 229
}
},
"name_range": {
"start": {
"file": "flight-routes.dot",
"line": 4,
"column": 12,
"byte_offset": 50
},
"end": {
"file": "flight-routes.dot",
"line": 4,
"column": 28,
"byte_offset": 66
}
}
},
{
"kind": "block",
"name": "cluster_international",
"range": {
"start": {
"file": "flight-routes.dot",
"line": 13,
"column": 3,
"byte_offset": 233
},
"end": {
"file": "flight-routes.dot",
"line": 19,
"column": 4,
"byte_offset": 395
}
},
"name_range": {
"start": {
"file": "flight-routes.dot",
"line": 13,
"column": 12,
"byte_offset": 242
},
"end": {
"file": "flight-routes.dot",
"line": 13,
"column": 33,
"byte_offset": 263
}
}
}
]
}
The skeleton reports three block declarations: the top-level graph flight_routes and its two subgraphs cluster_domestic and cluster_international; the SEA -> ORD edge statements never appear.
List subgraphs alongside their explicitly declared nodes
cluster_domestic declares three airports with their own attribute statements — SEA, ORD, and JFK — while cluster_international declares two more, LHR and HND.
$ act query symbols flight-routes.dot
Before
digraph flight_routes {
rankdir=LR;
subgraph cluster_domestic {
label="Domestic";
SEA [label="Seattle-Tacoma"];
ORD [label="Chicago O'Hare"];
JFK [label="John F. Kennedy"];
SEA -> ORD;
ORD -> JFK;
}
subgraph cluster_international {
label="International";
LHR [label="London Heathrow"];
HND [label="Tokyo Haneda"];
JFK -> LHR;
SEA -> HND;
}
}
Output
{
"type": "Symbols",
"symbols": [
{
"name": "cluster_domestic",
"kind": "unknown",
"range": {
"start": {
"file": "flight-routes.dot",
"line": 4,
"column": 12,
"byte_offset": 50
},
"end": {
"file": "flight-routes.dot",
"line": 4,
"column": 28,
"byte_offset": 66
}
},
"visibility": "unknown"
},
{
"name": "SEA",
"kind": "variable",
"range": {
"start": {
"file": "flight-routes.dot",
"line": 6,
"column": 5,
"byte_offset": 95
},
"end": {
"file": "flight-routes.dot",
"line": 6,
"column": 8,
"byte_offset": 98
}
},
"visibility": "unknown"
},
{
"name": "ORD",
"kind": "variable",
"range": {
"start": {
"file": "flight-routes.dot",
"line": 7,
"column": 5,
"byte_offset": 129
},
"end": {
"file": "flight-routes.dot",
"line": 7,
"column": 8,
"byte_offset": 132
}
},
"visibility": "unknown"
},
{
"name": "JFK",
"kind": "variable",
"range": {
"start": {
"file": "flight-routes.dot",
"line": 8,
"column": 5,
"byte_offset": 163
},
"end": {
"file": "flight-routes.dot",
"line": 8,
"column": 8,
"byte_offset": 166
}
},
"visibility": "unknown"
},
{
"name": "cluster_international",
"kind": "unknown",
"range": {
"start": {
"file": "flight-routes.dot",
"line": 13,
"column": 12,
"byte_offset": 242
},
"end": {
"file": "flight-routes.dot",
"line": 13,
"column": 33,
"byte_offset": 263
}
},
"visibility": "unknown"
},
{
"name": "LHR",
"kind": "variable",
"range": {
"start": {
"file": "flight-routes.dot",
"line": 15,
"column": 5,
"byte_offset": 297
},
"end": {
"file": "flight-routes.dot",
"line": 15,
"column": 8,
"byte_offset": 300
}
},
"visibility": "unknown"
},
{
"name": "HND",
"kind": "variable",
"range": {
"start": {
"file": "flight-routes.dot",
"line": 16,
"column": 5,
"byte_offset": 332
},
"end": {
"file": "flight-routes.dot",
"line": 16,
"column": 8,
"byte_offset": 335
}
},
"visibility": "unknown"
}
]
}
symbols lists the two subgraphs and all five declared airport nodes — SEA, ORD, JFK, LHR, HND — each node reported as a variable; the subgraphs themselves come back kind: unknown.
Query
18 query tools, the same on every supported language. Descriptions live in the shared reference: /docs/query-tools.
callers control_flow data_flow definition diagnostics effect_closure effect_summary fix_auto get_type graph import_organize interface mutations references repo_outline skeleton symbols symbols_batch