Skip to main content
Glama
MartinLoop — Stop Runaway Loops, Bad Code & Token Waste

MartinLoop — Stop Runaway Loops, Bad Code & Token Waste

martin_status

Read-onlyIdempotent

Check the current budget, cost, remaining limits, and stop pressure for a single MartinLoop run by supplying one selector: inline record, saved file, run ID, or latest.

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.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "martin_status"
  }
}

Input 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

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

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.9.0
    • addedOutput schema / properties / live
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "appliedControlState": {
      +      "description": "Control state reconciled from validated executor application evidence.",
      +      "enum": [
      +        "active",
      +        "paused",
      +        "cancellation_pending",
      +        "terminal"
      +      ],
      +      "type": "string"
      +    },
      +    "approvalState": {
      +      "enum": [
      +        "not_required",
      +        "resume_requested"
      +      ],
      +      "type": "string"
      +    },
      +    "commandsRun": {
      +      "type": "integer"
      +    },
      +    "filesTouched": {
      +      "type": "integer"
      +    },
      +    "pauseState": {
      +      "description": "Backwards-compatible applied control state; pending pause requests remain active.",
      +      "enum": [
      +        "active",
      +        "paused",
      +        "cancellation_requested"
      +      ],
      +      "type": "string"
      +    },
      +    "phase": {
      +      "type": "string"
      +    },
      +    "requestedControlState": {
      +      "description": "Latest durable operator request; this does not prove executor application.",
      +      "enum": [
      +        "active",
      +        "paused",
      +        "cancellation_requested",
      +        "terminal"
      +      ],
      +      "type": "string"
      +    },
      +    "verifierStep": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "phase",
      +    "requestedControlState",
      +    "appliedControlState",
      +    "pauseState",
      +    "approvalState",
      +    "commandsRun",
      +    "filesTouched"
      +  ],
      +  "type": "object"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "source",
      -  "loopId",
      -  "status",
      -  "lifecycleState",
      -  "attempts",
      -  "costUsd",
      -  "avoidedUsd",
      -  "pressure",
      -  "shouldStop",
      -  "remainingBudgetUsd",
      -  "remainingIterations",
      -  "budget",
      -  "inspection"
      -]New value: +[
      +  "source",
      +  "loopId",
      +  "status",
      +  "lifecycleState",
      +  "attempts",
      +  "costUsd",
      +  "avoidedUsd",
      +  "pressure",
      +  "shouldStop",
      +  "remainingBudgetUsd",
      +  "remainingIterations",
      +  "budget",
      +  "inspection",
      +  "live"
      +]
  2. Changed1 schema field changedv0.6.6
    • removedInput schema / oneOf
      Removed value: -[
      -  {
      -    "required": [
      -      "loopJson"
      -    ]
      -  },
      -  {
      -    "required": [
      -      "file"
      -    ]
      -  },
      -  {
      -    "required": [
      -      "loopId"
      -    ]
      -  },
      -  {
      -    "required": [
      -      "latest"
      -    ]
      -  }
      -]
  3. 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"
      +}
  4. 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."
  5. 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"
      +]
  6. 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"
      +]
  7. 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"
      +]
  8. First observedv0.3.9

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint and idempotentHint, so the safety profile is covered; the description adds the useful constraint that selectors are exclusive and that runsDir only shifts the run-store root rather than selecting a record. It stops short of saying what happens when zero or multiple selectors are supplied, which is the main remaining behavioral gap.

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 purpose and the selector rule are front-loaded, and the alternative-tool routing is compressed into a single final clause. No sentence is redundant with the schema or annotations.

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?

With an output schema covering return values and annotations covering safety, the description supplies the only missing pieces: selector exclusivity and sibling routing. The one unstated item is the failure mode when zero or multiple selectors are passed.

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 per-parameter meanings are already documented; the description still adds value by framing four of the five parameters as mutually exclusive selectors and clarifying that runsDir is a modifier, not a selector. That is a real semantic constraint beyond the field-level text.

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 ('Read the current budget, cost, remaining limits, and stop pressure for one MartinLoop run') and immediately contrasts with siblings martin_get_run and martin_run_dossier. An agent can distinguish this compact-status tool from the heavier event/artifact readers without opening any 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?

Gives an explicit positive case ('Use for a compact budget check') and an explicit negative case with named alternatives ('Do not use for full events or artifacts; use martin_get_run or martin_run_dossier instead'). It also states the selection rule ('Provide exactly one selector'), leaving nothing to inference.

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