Skip to main content
Glama

Ask a run to stop

stop_run
DestructiveIdempotent

Requests a running topology optimization run to stop after its current pass by writing a stop file, then returns immediately without interrupting or waiting.

Instructions

Ask a running run to stop at the end of its current pass. Returns at once; sends no signal; waits for nothing.

The tool writes the file job.stop in the run folder. The run then ends with exit code 5. There is no post step and no result/. The history, the snapshots and the checkpoint are those of a run that goes on, so run_topopt with resume=true (no allow_changed_inputs) gives the same result as a run that was not stopped. run_dir: the run folder. Default: the run that this server started and that still works; else the one run in the work folder (or its runs/ folder) that a live process holds the job lock of (this finds a run that the CLI started). If several runs are live, the reply lists them and writes nothing: give run_dir. The reply has state: stop_requested: the request is written. pid, iteration (the pass at the last status), message, options. already_requested: a request is in the folder already (stop_request has its time); it is not written again. postprocess: the run is in the post step or the refine step: all passes are done, nothing is written. Options: wait, or end the process yourself (resume=true then repeats the post step only). nothing_to_stop: the run is done, stopped or failed already: nothing is written. process_alive says whether a process of this server is alive and only serves the dashboard. options has the resume route where a checkpoint is there. gone: a lock whose process is not running, or a record that says running and has no lock: nothing is written. checkpoint and the option resume=true (it replaces the stale lock, with a fact). Also the run process of this server that ended before it took the job lock: the message has its exit and the log file. none: no run in this folder: no job files and no live process, or the folder does not exist, or a live job lock of a job that is not a topopt run (the message names the marker, for example ratchet.json). Nothing is written. several: several live runs: the list is in runs. Every reply has note: a topopt build from before this change does not read job.stop, and a run of such a build ignores the request. found_by says how the run was found (run_dir, this server, the lock scan). The run reads job.stop after the checkpoint of each pass (one file read per pass, no polling). It then saves its verdict (state stopped_by_request), writes the status stopped and the job marker job.STOPPED, and releases the job lock. A pass that is long (a big grid, a buckling row) delays the stop by up to one pass. A solve that hangs never reads the request: the reply has the pid. With run_topopt fine_pass=true and no run_dir, the fine pass is stopped when it runs; while the first run works, that run is stopped and the fine pass does not start. From the post step of the first run until the fine pass has started, the request is written in the fine folder (state stop_requested, run_dir the fine folder): the process reads it before the fine pass starts, ends without starting it (exit code 5) and says so in the log. Only run folders count for run_dir: a folder with status.json or run.json, as in list_runs. The folder of a ratchet job holds a job lock too, and it is not a run.

Input Schema

NameRequiredDescriptionDefault
run_dirNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations declare destructiveHint=true, readOnlyHint=false, and idempotentHint=true; the description is fully consistent with those traits and adds extensive operational detail. It discloses the job.stop file mechanism, exit code 5, absence of post step and result/, checkpoint/snapshot preservation, idempotent already_requested handling, stale-lock behavior, and the fact that a long or hung pass may delay or never observe the request.

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 front-loaded with the key behavior, then organized around run_dir, reply states, and special cases. It is necessarily long because the tool exposes many state-machine outcomes, but it is dense and some passages could be tightened. Still, most sentences carry operational information rather than filler.

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?

There is no output schema, yet the description documents reply states such as stop_requested, already_requested, postprocess, nothing_to_stop, gone, none, and several, plus note, found_by, pid, iteration, and options. Given the complex edge cases, the description provides enough context for an agent to call the tool and interpret results correctly.

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

Parameters5/5

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

Schema coverage for run_dir is 0%, so the description must compensate, and it does. It explains the default resolution logic, live-lock scanning, multiple-live-run behavior, fine-pass folder handling, and the restriction that only run folders with status.json or run.json count. This is substantially more than the schema provides.

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 first sentence states a specific verb and resource: ask a running run to stop at the end of its current pass. It immediately distinguishes its behavior from alternatives by saying it returns at once, sends no signal, and waits for nothing. The purpose is unambiguous without needing the schema.

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?

The description gives explicit usage conditions for default run discovery, multiple live runs, post-process states, already-completed runs, stale locks, and fine-pass interleaving. It tells the caller when to pass run_dir and what happens if several runs are live. It also names resume=true as the route for inspectable finished/post-process runs.

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