Make Sankey diagram
make_sankeyUse this when the user wants a Sankey diagram, flow diagram or alluvial-style chart of amounts moving between stages, for example a budget (income to spending), an energy balance, a sales funnel or website traffic paths. Takes flows as from, to and amount (pasted text or a list), up to 200 flows and 100 nodes, plus a title, unit, node order, link colour and PDF page size. Returns node totals, a balance table, totals per column, a proportion check of link widths and node heights, label overlap results, an interactive diagram, and SVG, PDF and CSV downloads. Refuses loops, flows from a node to itself, zero or negative amounts and ambiguous amounts such as 1,234 without a decimal_mark. Does not read files, fetch data from other apps or save diagrams.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "make_sankey"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| unit | No | Unit or currency shown with amounts, e.g. "$", "€", "kWh" or "users". A single currency symbol goes before the number, other units after it. | |
| flows | No | Alternative to flows_text: [{"from":"Salary","to":"Budget","amount":"4000"}]. The amount may be text ("1,250.50") or a number. Up to 200 flows and 100 different nodes. | |
| title | No | Diagram title, e.g. "Monthly budget". Default "Sankey diagram". | |
| color_by | No | Link colour, e.g. source (default: each link takes the colour of the node it leaves) or target (the node it enters). | |
| page_size | No | PDF page: auto (default, the page fits the diagram at full size up to the 200 in PDF page limit; a larger diagram is scaled down and the result says so), letter or a4 (scaled to one page). | |
| flows_text | No | Flows pasted as text, one per line: from, to, amount, e.g. "Salary,Budget,4000\nBudget,Rent,1500\nBudget,Savings,800". Comma, tab or semicolon between values; an optional header row is skipped; names with commas go in double quotes. Up to 200 lines. Give this or flows. | |
| node_order | No | auto (default): nodes in each column are arranged to reduce crossings; given: nodes keep the order they first appear in the flows. | |
| decimal_mark | No | Decimal mark of the amounts, "." (1,234.50) or "," (1.234,50). Needed only when an amount such as 1,234 or 1.234 could be read both ways; otherwise it is read from the amounts. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| Yes | |||
| unit | Yes | ||
| nodes | Yes | ||
| title | Yes | ||
| labels | Yes | ||
| balance | Yes | ||
| size_px | Yes | ||
| color_by | Yes | ||
| warnings | Yes | ||
| downloads | Yes | ||
| page_size | Yes | ||
| flow_count | Yes | ||
| link_count | Yes | ||
| node_count | Yes | ||
| node_order | Yes | ||
| sinks_total | Yes | ||
| column_count | Yes | ||
| decimal_mark | Yes | ||
| layout_check | Yes | ||
| column_totals | Yes | ||
| preview_count | No | ||
| sources_total | Yes | ||
| duplicates_merged | Yes |