Skip to main content
Glama
Keesan12

MartinLoop — Stop Runaway Loops, Bad Code & Token Waste

martin_status

Read-onlyIdempotent

Review live budget status, cost, remaining limits, and stop pressure to prevent runaway token spend.

Instructions

Read the current budget, cost, remaining limits, and stop pressure for one MartinLoop run. Provide exactly one selector: loopJson for an inline record, file for a saved record, loopId for a run-store ID, or latest for the newest run; runsDir only changes the run-store root. Use for a compact budget check. Do not use for full events or artifacts; use martin_get_run or martin_run_dossier instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileNoPath under the Martin runs root to a loop-record.json file, a legacy .jsonl file, or a run-store directory. Mutually exclusive with loopJson, loopId, and latest.
latestNoWhen true, loads the most recently updated loop record. Mutually exclusive with loopJson, file, and loopId.
loopIdNoLoop ID resolved as <runsDir>/<loopId>/loop-record.json. Mutually exclusive with loopJson, file, and latest.
runsDirNoOptional runs-root override resolved under the default Martin runs root.
loopJsonNoJSON-serialized LoopRecord.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
budgetYes
loopIdYes
sourceYes
statusYes
costUsdYes
attemptsYes
pressureYes
avoidedUsdYes
inspectionYes
shouldStopYes
lifecycleStateYes
remainingTokensNo
remainingBudgetUsdYes
remainingIterationsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.6.6
    • removedInput schema / oneOf
      Removed value: -[
      -  {
      -    "required": [
      -      "loopJson"
      -    ]
      -  },
      -  {
      -    "required": [
      -      "file"
      -    ]
      -  },
      -  {
      -    "required": [
      -      "loopId"
      -    ]
      -  },
      -  {
      -    "required": [
      -      "latest"
      -    ]
      -  }
      -]
  2. Changed1 schema field changedv0.6.5
    • addedOutput schema / properties / inspection / properties / loop / properties / activeAttemptId
      Added value: +{
      +  "description": "ID of the currently active attempt, when a run is in progress.",
      +  "type": "string"
      +}
  3. Changed3 schema fields changedv0.5.9
    • changedInput schema / properties / file / description
      Previous value: -"Optional path under the Martin runs root to a loop-record.json file, a legacy .jsonl file, or a run-store directory."New value: +"Path under the Martin runs root to a loop-record.json file, a legacy .jsonl file, or a run-store directory. Mutually exclusive with loopJson, loopId, and latest."
    • changedInput schema / properties / latest / description
      Previous value: -"When true, loads the most recently updated loop record in the runs directory."New value: +"When true, loads the most recently updated loop record. Mutually exclusive with loopJson, file, and loopId."
    • changedInput schema / properties / loopId / description
      Previous value: -"Loop ID resolved as <runsDir>/<loopId>/loop-record.json."New value: +"Loop ID resolved as <runsDir>/<loopId>/loop-record.json. Mutually exclusive with loopJson, file, and latest."
  4. Changed3 schema fields changedv0.5.6
    • changedOutput schema / properties / budget / required
      Previous value: -[
      -  "maxUsd",
      -  "softLimitUsd",
      -  "maxIterations",
      -  "maxTokens"
      -]New value: +[
      +  "maxUsd",
      +  "softLimitUsd",
      +  "maxIterations"
      +]
    • changedOutput schema / properties / inspection / properties / loop / required
      Previous value: -[
      -  "loopId",
      -  "title",
      -  "objective",
      -  "status",
      -  "lifecycleState",
      -  "attempts",
      -  "costUsd",
      -  "avoidedUsd",
      -  "pressure",
      -  "shouldStop",
      -  "remainingBudgetUsd",
      -  "remainingIterations",
      -  "remainingTokens"
      -]New value: +[
      +  "loopId",
      +  "title",
      +  "objective",
      +  "status",
      +  "lifecycleState",
      +  "attempts",
      +  "costUsd",
      +  "avoidedUsd",
      +  "pressure",
      +  "shouldStop",
      +  "remainingBudgetUsd",
      +  "remainingIterations"
      +]
    • changedOutput schema / required
      Previous value: -[
      -  "source",
      -  "loopId",
      -  "status",
      -  "lifecycleState",
      -  "attempts",
      -  "costUsd",
      -  "avoidedUsd",
      -  "pressure",
      -  "shouldStop",
      -  "remainingBudgetUsd",
      -  "remainingIterations",
      -  "remainingTokens",
      -  "budget",
      -  "inspection"
      -]New value: +[
      +  "source",
      +  "loopId",
      +  "status",
      +  "lifecycleState",
      +  "attempts",
      +  "costUsd",
      +  "avoidedUsd",
      +  "pressure",
      +  "shouldStop",
      +  "remainingBudgetUsd",
      +  "remainingIterations",
      +  "budget",
      +  "inspection"
      +]
  5. Changed4 schema fields changedv0.5.5
    • removedOutput schema / properties / costProvenance
      Removed value: -{
      -  "enum": [
      -    "actual",
      -    "calculated",
      -    "estimated",
      -    "unavailable"
      -  ],
      -  "type": "string"
      -}
    • removedOutput schema / properties / inspection / properties / loop / properties / costProvenance
      Removed value: -{
      -  "enum": [
      -    "actual",
      -    "calculated",
      -    "estimated",
      -    "unavailable"
      -  ],
      -  "type": "string"
      -}
    • changedOutput schema / properties / inspection / properties / loop / required
      Previous value: -[
      -  "loopId",
      -  "title",
      -  "objective",
      -  "status",
      -  "lifecycleState",
      -  "attempts",
      -  "costUsd",
      -  "costProvenance",
      -  "avoidedUsd",
      -  "pressure",
      -  "shouldStop",
      -  "remainingBudgetUsd",
      -  "remainingIterations",
      -  "remainingTokens"
      -]New value: +[
      +  "loopId",
      +  "title",
      +  "objective",
      +  "status",
      +  "lifecycleState",
      +  "attempts",
      +  "costUsd",
      +  "avoidedUsd",
      +  "pressure",
      +  "shouldStop",
      +  "remainingBudgetUsd",
      +  "remainingIterations",
      +  "remainingTokens"
      +]
    • changedOutput schema / required
      Previous value: -[
      -  "source",
      -  "loopId",
      -  "status",
      -  "lifecycleState",
      -  "attempts",
      -  "costUsd",
      -  "costProvenance",
      -  "avoidedUsd",
      -  "pressure",
      -  "shouldStop",
      -  "remainingBudgetUsd",
      -  "remainingIterations",
      -  "remainingTokens",
      -  "budget",
      -  "inspection"
      -]New value: +[
      +  "source",
      +  "loopId",
      +  "status",
      +  "lifecycleState",
      +  "attempts",
      +  "costUsd",
      +  "avoidedUsd",
      +  "pressure",
      +  "shouldStop",
      +  "remainingBudgetUsd",
      +  "remainingIterations",
      +  "remainingTokens",
      +  "budget",
      +  "inspection"
      +]
  6. Changed4 schema fields changedv0.5.3
    • addedOutput schema / properties / costProvenance
      Added value: +{
      +  "enum": [
      +    "actual",
      +    "calculated",
      +    "estimated",
      +    "unavailable"
      +  ],
      +  "type": "string"
      +}
    • addedOutput schema / properties / inspection / properties / loop / properties / costProvenance
      Added value: +{
      +  "enum": [
      +    "actual",
      +    "calculated",
      +    "estimated",
      +    "unavailable"
      +  ],
      +  "type": "string"
      +}
    • changedOutput schema / properties / inspection / properties / loop / required
      Previous value: -[
      -  "loopId",
      -  "title",
      -  "objective",
      -  "status",
      -  "lifecycleState",
      -  "attempts",
      -  "costUsd",
      -  "avoidedUsd",
      -  "pressure",
      -  "shouldStop",
      -  "remainingBudgetUsd",
      -  "remainingIterations",
      -  "remainingTokens"
      -]New value: +[
      +  "loopId",
      +  "title",
      +  "objective",
      +  "status",
      +  "lifecycleState",
      +  "attempts",
      +  "costUsd",
      +  "costProvenance",
      +  "avoidedUsd",
      +  "pressure",
      +  "shouldStop",
      +  "remainingBudgetUsd",
      +  "remainingIterations",
      +  "remainingTokens"
      +]
    • changedOutput schema / required
      Previous value: -[
      -  "source",
      -  "loopId",
      -  "status",
      -  "lifecycleState",
      -  "attempts",
      -  "costUsd",
      -  "avoidedUsd",
      -  "pressure",
      -  "shouldStop",
      -  "remainingBudgetUsd",
      -  "remainingIterations",
      -  "remainingTokens",
      -  "budget",
      -  "inspection"
      -]New value: +[
      +  "source",
      +  "loopId",
      +  "status",
      +  "lifecycleState",
      +  "attempts",
      +  "costUsd",
      +  "costProvenance",
      +  "avoidedUsd",
      +  "pressure",
      +  "shouldStop",
      +  "remainingBudgetUsd",
      +  "remainingIterations",
      +  "remainingTokens",
      +  "budget",
      +  "inspection"
      +]
  7. First observedv0.3.9

TDQS

A4.7/5.0
Behavior4/5

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

The annotations already declare readOnlyHint and idempotentHint, so the safety profile is covered. The description adds a useful boundary beyond that: it returns only a compact budget snapshot for one run and not full events/artifacts, and clarifies that runsDir only changes the run-store root. No behavioral contradiction with 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?

Three sentences with no filler: purpose first, selector rule second, usage boundary third. Every sentence earns its place and the most important operational constraint ('exactly one selector') is stated prominently.

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?

Given the output schema, annotations, and fully covered parameters, the description covers the remaining operational rules: exactly one selector, what each selector points to, runsDir's scoped effect, and when to route to siblings. There is no critical missing information an agent would need to invoke it correctly.

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 semantic meaning by mapping each selector to its intended source: 'inline record' for loopJson, 'saved record' for file, 'run-store ID' for loopId, and 'newest run' for latest. It also explains the non-selector role of runsDir, which helps an agent avoid treating it as a fifth mutually exclusive option.

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 verb ('Read') and resource ('current budget, cost, remaining limits, and stop pressure for one MartinLoop run'), and proactively distinguishes from siblings by saying it is not for full events/artifacts (martin_get_run or martin_run_dossier). It is immediately clear what this tool does and what it is not.

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?

It gives a compact use case ('Use for a compact budget check') and explicit exclusions with named alternatives ('Do not use for full events or artifacts; use martin_get_run or martin_run_dossier instead'). The selector rule ('Provide exactly one selector...') also tells the agent how to choose an input path.

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