Skip to main content
Glama

run_experiment

Run a BehaviorSpace experiment headlessly to collect metrics and per-combination results. Specify an experiment by name or define variables, metrics, and repetitions inline.

Instructions

Run a BehaviorSpace experiment headlessly and return summarized results.

Two ways to specify the experiment:

  • By name — pass experiment_name matching a saved experiment in the loaded model (.nlogox <experiments> section). All other experiment-shape args are ignored.

  • Inline — omit experiment_name. Required: metrics. Optional: variables (list of {"name", "values"} or {"name", "first", "step", "last"}), repetitions, time_limit, setup_commands, go_commands, stop_condition.

Variable shapes (Cartesian product of all expanded values is run for each repetition)::

[{"name": "density", "values": [50, 60, 70]},
 {"name": "growth-rate", "first": 0.1, "step": 0.05, "last": 0.3}]

Long-run controls: - max_total_runs — refuse to start if total_runs exceeds this. - timeout_seconds — kill the launcher after this many seconds. Partial results in the table CSV are preserved. - threads — parallel runs (0 = let NetLogo decide; default ~75% of CPUs).

The launcher runs in a SEPARATE JVM, so the GUI workspace this server is hosting is unaffected. Run before calling this only matters insofar as the model file must be saved on disk (it is, after open_model / create_model / open_comses_model).

Returns JSON with: output_csv, runs, metrics_summary, per_combination, duration_seconds, command, timed_out. The full per-tick data is in output_csv for offline analysis.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
metricsNo
threadsNo
variablesNo
model_pathNo
time_limitNo
go_commandsNogo
output_nameNo
repetitionsNo
max_total_runsNo
setup_commandsNosetup
stop_conditionNo
experiment_nameNo
timeout_secondsNo
sequential_run_orderNo
run_metrics_every_stepNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description fully discloses behavior: runs in separate JVM, unaffected GUI, timeouts, max runs, and return format. It lacks details on authentication or rate limits but is otherwise transparent.

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 description is well-structured with sections for modes, variable shapes, and long-run controls. It is front-loaded with the main purpose and avoids redundancy, though slightly verbose in examples.

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?

Given 15 parameters and no schema descriptions, the description covers most aspects: two usage modes, variable shaping, run controls, and return values. Missing details on a few parameters and no explanation of output schema, but still comprehensive.

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 coverage is 0%, so the description must compensate. It explains most key parameters (metrics, variables, repetitions, etc.) with examples, but misses output_name, sequential_run_order, and run_metrics_every_step. Overall, it adds significant meaning beyond the schema.

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

Purpose4/5

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

The description clearly states 'Run a BehaviorSpace experiment headlessly and return summarized results,' specifying the verb, resource, and mode. It distinguishes from siblings like 'run_simulation' by mentioning headless execution and separate JVM, though no explicit differentiation is made.

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?

The description explains two ways to specify the experiment (by name or inline) and provides long-run controls (max_total_runs, timeout_seconds). It notes prerequisites (model file saved) but does not explicitly state when not to use the tool or suggest alternatives.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Razee4315/NetLogo-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server