Skip to main content
Glama

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

NameRequiredDescriptionDefault
xNo
yNo
kindNoauxiliary
nameYes
nearNo
noteNo
unitYes
viewNo
sourceNo
targetNo
equationYes
model_pathYes
output_pathNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations at all, the description carries the full load and does well: it discloses the in-place write with a backup, the output_path escape hatch, the INTEG(net flow, initial value) constraint on stocks, and the non-obvious side effect that existing stocks' equations are rewritten and pipes/clouds drawn when a flow is added. It omits error behavior, name-uniqueness rules and what is returned, keeping it below 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is front-loaded in the first sentence and the remaining sentences each carry distinct operational detail with no filler. It is dense and slightly run-on in the stock/flow clause, but nothing is redundant.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 13-parameter mutation tool with no annotations and no output schema, the definition covers the risky and non-obvious parts: write semantics, backup behavior, graph side effects and equation constraints. It stops short of describing failure modes or confirming what a successful call yields, which an agent would still want.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% across 13 parameters, so the description must supply the meaning and it largely does: kind's accepted values, equation's required form for stocks and flows, source/target semantics including the cloud fallback, near versus x/y placement, and output_path. It leaves note, view, unit and model_path unexplained, which is a real gap for a required parameter like unit.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb plus resource ('Add a variable to an existing .mdl') and a second concrete effect ('draw it on the diagram with its arrows'). That distinguishes it cleanly from set_vensim_equation, rename_vensim_variable and delete_vensim_variable without needing to open any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives clear conditions: use kind to pick auxiliary/constant/level/flow, supply source/target for flows, omit placement coordinates for automatic layout or pass x/y to place exactly, and expect in-place writes unless output_path is given. It never names an alternative tool or an explicit when-not case, so it falls short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.