Skip to main content
Glama

cancel_trial

Cancel a running trial or abandon a designed one to stop execution, mark failure, and preserve clean terminal states.

Instructions

Cancel a running trial, or abandon a designed one.

running → failed: kills the subprocess, marks failed. The record's failed here reflects the cancellation act, not an observed execution failure — cancelled: true in the payload marks the distinction, and an already finished executor reply means the executor completed first. A cancel landing before the task registers tombstones the id so no child can spawn under the terminal row. designed → abandoned: no executor to kill, no evidence lost — the honest terminal for a design that will never run (e.g. a bundle locked to code that no longer exists). The FSM has always permitted designed → abandoned; close_programme uses the same transition for programme-scoped sweeps.

Enforcement: commitment 1 — the loop is the unit (orphan check).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
trial_idYesID of the target trial.
programme_idYesID of the target research programme.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
statusNo
trial_idNo
cancelledNo
executor_outputNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.28

TDQS

A4.2/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and delivers: it discloses the kill-subprocess side effect, the fact that 'failed' reflects the cancellation act rather than an observed failure, the cancelled:true payload marker, the 'already finished' executor reply, the tombstoning of ids that land before registration, and that designed→abandoned loses no evidence. This is unusually rich side-effect and edge-case disclosure beyond the schema.

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

Conciseness3/5

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

The core purpose is front-loaded, but the body is long, jargon-dense (FSM, tombstones, orphan check), and includes historical/tangential notes like the FSM always permitting the transition and close_programme reusing it. These are informative but not proportionate to tool selection.

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?

An output schema exists, so return values need not be described, and the description still covers both terminal transitions and the key edge cases. Remaining gaps are minor (e.g., permission or retry semantics), so it is nearly complete for an agent to call correctly.

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

Parameters3/5

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

Schema description coverage is 100%, so both trial_id and programme_id are already documented in the schema. The description adds no syntax, format, or scoping detail about either parameter, so the baseline 3 applies.

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?

Opens with a specific verb+resource ('Cancel a running trial, or abandon a designed one') and splits the resource into its two distinguishable states. This routes clearly against siblings like close_programme and abandon_hypothesis without opening either 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?

Gives explicit conditions for each mode: running trials get cancelled/killed, designed trials get abandoned as 'the honest terminal for a design that will never run.' It also notes close_programme shares the designed→abandoned transition for programme-scoped sweeps, which helps disambiguate. No explicit 'do not use this when...' exclusion, so it stops 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.