Skip to main content
Glama
Keesan12

MartinLoop — Stop Runaway Loops, Bad Code & Token Waste

martin_cancel

Destructive

Cancel a MartinLoop run by file, loop ID, or latest, and write an auditable cancellation receipt with reason and requester.

Instructions

Write a durable cancellation receipt for one canonical MartinLoop run. Provide exactly one selector: file, loopId, or latest; runsDir changes the run-store root, while reason and requestedBy add audit context. Use when work must be abandoned, not temporarily held. This records a request and does not kill a process; use martin_pause for a reversible hold.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileNoPath to one canonical run record or directory. Mutually exclusive with loopId and latest.
latestNoWhen true, targets the latest canonical run. Mutually exclusive with file and loopId.
loopIdNoCanonical MartinLoop run identifier. Mutually exclusive with file and latest.
reasonNoOptional non-empty reason recorded in the cancellation receipt.
runsDirNoOptional run-store root override used to resolve loopId or latest.
requestedByNoOptional human or runtime identity label recorded for audit context.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesThe control action that was recorded.
loopIdYesMartinLoop run identifier the control was applied to.
reasonNoHuman-readable reason for the control, if provided.
controlIdYesUnique receipt ID for this control action.
requestedAtYesISO 8601 timestamp when the control was recorded.
requestedByNoIdentity that requested the control, if provided.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.6.6
    • removedInput schema / oneOf
      Removed value: -[
      -  {
      -    "required": [
      -      "file"
      -    ]
      -  },
      -  {
      -    "required": [
      -      "loopId"
      -    ]
      -  },
      -  {
      -    "required": [
      -      "latest"
      -    ]
      -  }
      -]
  2. Changed6 schema fields changedv0.5.9
    • addedInput schema / properties / file / description
      Added value: +"Path to one canonical run record or directory. Mutually exclusive with loopId and latest."
    • addedInput schema / properties / latest / description
      Added value: +"When true, targets the latest canonical run. Mutually exclusive with file and loopId."
    • addedInput schema / properties / loopId / description
      Added value: +"Canonical MartinLoop run identifier. Mutually exclusive with file and latest."
    • addedInput schema / properties / reason / description
      Added value: +"Optional non-empty reason recorded in the cancellation receipt."
    • addedInput schema / properties / requestedBy / description
      Added value: +"Optional human or runtime identity label recorded for audit context."
    • addedInput schema / properties / runsDir / description
      Added value: +"Optional run-store root override used to resolve loopId or latest."
  3. Changed3 schema fields changedv0.5.6
    • changedOutput schema / additionalProperties
      Previous value: -trueNew value: +false
    • addedOutput schema / properties
      Added value: +{
      +  "action": {
      +    "description": "The control action that was recorded.",
      +    "enum": [
      +      "pause",
      +      "cancel",
      +      "continue"
      +    ],
      +    "type": "string"
      +  },
      +  "controlId": {
      +    "description": "Unique receipt ID for this control action.",
      +    "type": "string"
      +  },
      +  "loopId": {
      +    "description": "MartinLoop run identifier the control was applied to.",
      +    "type": "string"
      +  },
      +  "reason": {
      +    "description": "Human-readable reason for the control, if provided.",
      +    "type": "string"
      +  },
      +  "requestedAt": {
      +    "description": "ISO 8601 timestamp when the control was recorded.",
      +    "type": "string"
      +  },
      +  "requestedBy": {
      +    "description": "Identity that requested the control, if provided.",
      +    "type": "string"
      +  }
      +}
    • addedOutput schema / required
      Added value: +[
      +  "loopId",
      +  "action",
      +  "controlId",
      +  "requestedAt"
      +]
  4. First observedv0.3.9

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already mark the tool as destructive and non-idempotent, and the description adds useful context beyond that: the receipt is durable, the operation records a request rather than killing a process, and reason/requestedBy provide audit context. This helps an agent understand the side-effect profile without contradicting the annotations.

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

Conciseness5/5

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

The description is compact, front-loaded with the core purpose, and every sentence earns its place. It covers purpose, selector rule, usage condition, alternative, and a key non-behavior without repetition.

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?

The definition is complete for a cancellation tool of this complexity: it explains the selector constraint, the audit parameters, the durable nature of the receipt, and the distinction from pausing. Since an output schema is present, the description need not detail return values.

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 100%, so the baseline is 3, but the description adds meaningful parameter semantics: it states that exactly one selector (file, loopId, or latest) must be provided, explains that runsDir changes the run-store root, and clarifies that reason and requestedBy are audit context. This goes beyond the schema's individual property descriptions.

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 names a specific action ('Write a durable cancellation receipt') and a specific resource ('one canonical MartinLoop run'), and it differentiates this tool from martin_pause by stating that cancellation is for abandoned work, not temporary holds. The selector options are also clearly summarized.

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 explicitly says when to use the tool ('when work must be abandoned, not temporarily held') and identifies the alternative ('use martin_pause for a reversible hold'). It also clarifies a non-goal: this records a request and does not kill a process.

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