add_vensim_variable
Add a variable to an existing Vensim .mdl model and draw it on the diagram with arrows, equations, units, and automatic or exact placement; stock/flow connections update linked equations.
Instructions
Add a variable to an existing .mdl and draw it on the diagram with its arrows.
kind is auxiliary, constant, level (stock) or flow. A stock's equation must be
INTEG(net flow, initial value). A flow needs a source and/or target stock (a missing
end becomes a cloud); the stocks' INTEG equations are updated to include it, and its
valve, pipes and clouds are drawn. Placement is automatic, next to the variables it
uses or near another variable; pass x and y to place it exactly. Writes in place (a
backup is kept) unless output_path is given.
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": "<name>",
"equation": "<equation>",
"unit": "<unit>"
},
"name": "add_vensim_variable"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | ||
| y | No | ||
| kind | No | auxiliary | |
| name | Yes | ||
| near | No | ||
| note | No | ||
| unit | Yes | ||
| view | No | ||
| source | No | ||
| target | No | ||
| equation | Yes | ||
| model_path | Yes | ||
| output_path | No |