Skip to main content
Glama

Start an optimization run

run_topopt
Destructive

Starts a background topology optimization run from a problem YAML and returns immediately; monitor with run_status and fetch results with run_result.

Instructions

Start a topology optimization run in the background. Returns at once.

Use after check_problem and after you state your assumptions to the user. If the user gave no load (no object, no mass and no force), ask first. Then run_status to watch it, and run_result when it is done. Nothing calls you back when the run ends: call run_status in this turn, or end the turn and tell the user what to ask. It also returns assumptions (the strings of the YAML) and derived (forces in N, voxel size, minimum feature size, volume fraction), so you can show them. Reply keys: resource topopt://replies/run_topopt (the meaning of each key, and the fine pass: fine_from, fine_pass).

yaml_path: the problem YAML (relative paths start at the work folder; environment shows it). out_dir: the run folder. Default: runs/live in the work folder (the dashboard shows it). Without resume, a folder that holds the checkpoint of a run that did not finish loses it: the reply then has earlier_checkpoint (the pass and a note), and the run goes on. override_lock: a live process can hold the job lock of the run folder (the reply names its pid and start time). Give true to run anyway. A lock of a stopped process is replaced without it. proceed_without_brief: a YAML with a case file (made by record_brief) can have no brief, or a stale brief (a changed STL file or requirement key). Then the reply is {"state": "awaiting_user", "facts", "options", "override"} and nothing starts. Give true to run anyway: the case log records it. resume: continue the run of out_dir from its last checkpoint (run_status shows checkpoint). The history and the snapshots after it are dropped. The YAML and the region files are read again: if they or the settings changed, the reply is an error with the changes in resume.facts, and nothing is written. A run that stop_run stopped is continued the same way, with no allow_changed_inputs. continue_from: add passes to a run in a NEW run folder (out_dir); this folder is the parent and is only read. more_iterations (with continue_from): the number of passes to add (a whole number of 1 or more, no upper limit). The new run starts from the last checkpoint of the parent (pass K) and has K + more_iterations passes (settings.iterations is not used). The reply has continue. The card run_topopt:continue_from has the rest. allow_changed_inputs: with resume or continue_from, go on with the changed inputs. The run log and the verdict name the changes. With resume=true the stop of proceed_without_brief names both overrides in one option (this one and allow_changed_inputs=true). On a finished run a resume runs the post step only: a key that only it reads (for example settings.mesh_method) takes effect in seconds; a key of the passes is accepted, the part stays, and the reply has resume (with pass_keys). stop_rules: true turns the stop rules on, false turns them off. None: as settings.stop_rules of the YAML says (off by default). A rule ends the run at a pass that only measures. The verdict names the rule and its numbers. With resume, a run that was killed gives the same result as one that was not (bit-equal with one thread and a direct solver). The lost force is in check_problem (before) and in run_result or run.json (after). A moment, a remote force, a pressure or a per-axis support gives extended in check_problem; the stiffness of such a case is null with a reason.

Who decides a change of the YAML: a method setting (penal, beta schedule, solver, voxel size, iterations, a voxel guard: the memory estimate against the RAM first, above it the machine can freeze) you change without asking, and report what, why and the price. A user requirement (loads, supports, keep-outs, material, stress limits and safety factors, a mass target, print limits, symmetry) you may tighten without asking, with a report and its measured price; you loosen it only with the user's consent, and you bring the facts. A key that can be either follows its origin in record_brief. Cards: topopt://levers.

Input Schema

NameRequiredDescriptionDefault
resumeNo
out_dirNo
fine_tolNo
fine_fromNo
fine_passNo
yaml_pathYes
fine_voxelNo
stop_rulesNo
fine_passesNo
continue_fromNo
override_lockNo
more_iterationsNo
allow_changed_inputsNo
proceed_without_briefNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations say destructive and non-idempotent; the description earns that with concrete consequences: without resume, a folder holding a checkpoint of an unfinished run loses it, a live lock names pid and start time, resume drops history and snapshots, changed inputs yield an error and nothing is written, and stop_run runs continue without allow_changed_inputs. It also discloses the no-callback model ("Nothing calls you back when the run ends") and that a killed run resumes bit-equal, which no annotation conveys.

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?

Strongly front-loaded: purpose and the no-callback constraint come first, then per-parameter notes, then the YAML-change policy. It is long and dense with parenthetical asides, and a couple of sentences (the bit-equal resume claim, where the lost force is reported) are marginal. Nearly every other sentence carries operational weight, so the length is largely justified.

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

Completeness5/5

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

For a 14-parameter, destructive, long-running background job with no output schema and no schema descriptions, the description still covers start conditions, reply contents (assumptions, derived, earlier_checkpoint, continue, resume.facts), failure modes (lock, missing/stale brief, changed inputs), and restart semantics. It points to named resources (topopt://replies/run_topopt, topopt://levers) for lookup detail.

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?

With 0% schema coverage across 14 params, the description carries the burden and does so for most of them: yaml_path (relative to work folder), out_dir (default runs/live, checkpoint-loss caveat), override_lock, proceed_without_brief, resume, continue_from, more_iterations, allow_changed_inputs, stop_rules. The five fine-pass params are only named and deferred to the topopt://replies/run_topopt resource, so fine_tol, fine_voxel and fine_passes still lack meaning here.

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?

States a specific verb and resource ("Start a topology optimization run") plus the execution model ("in the background. Returns at once"), which is the fact an agent most needs. It also distinguishes itself from the siblings it hands off to (run_status to watch, run_result when done), so it is not confusable with list_runs, run_status or run_result.

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

Usage Guidelines5/5

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

Explicit preconditions ("Use after check_problem and after you state your assumptions to the user. If the user gave no load ... ask first") and explicit follow-up routing (run_status, run_result). It also gives when-to-use rules for the tricky modes: resume vs continue_from ("add passes to a run in a NEW run folder"), override_lock, proceed_without_brief, and allow_changed_inputs.

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