find_feedback_loops
Lists a Vensim model's reinforcing and balancing feedback loops, link polarities, stocks, and algebraic loops, and can annotate diagrams with R/B labels.
Instructions
List the model's feedback loops, each labelled reinforcing (R) or balancing (B).
Each loop lists its variables (starting at a stock), the polarity of every link, and the stocks it passes through. Polarity comes from the equations, assuming positive variables; a loop whose sign depends on values (an IF THEN ELSE condition, a non-monotonic lookup) is 'unknown' and names the undetermined links. Also reports algebraic loops (no stock or delay), which Vensim refuses to simulate.
With annotate=true, writes the link polarities onto the diagram's arrows and places R1/B1 labels inside the loops (up to max_labels), in place with a backup unless output_path is given. Re-running replaces earlier labels.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"model_path": "<model_path>"
},
"name": "find_feedback_loops"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| annotate | No | ||
| max_loops | No | ||
| max_labels | No | ||
| model_path | Yes | ||
| output_path | No |