Skip to main content
Glama
Keesan12

MartinLoop — Stop Runaway Loops, Bad Code & Token Waste

martin_get_run

Read-onlyIdempotent

Load a Martin run to get its budget, cost, verification, artifact, and canonical path for auditing AI agent work and preventing runaway loops.

Instructions

Load one Martin run and return its budget, cost, verification, artifact, and canonical path summary.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileNoPath to a canonical loop-record.json, legacy file, or run-store directory.
latestNoWhen true, loads the most recently updated loop record in the run store.
loopIdNoLoop ID under the run store.
runsDirNoOptional runs-root override.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
costYes
loopYes
budgetYes
sourceYes
warningsYes
artifactsYes
inspectionYes
sourceKindYes
verificationYes

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. Changed1 schema field changedv0.6.5
    • addedOutput schema / properties / loop / properties / activeAttemptId
      Added value: +{
      +  "description": "ID of the currently active attempt, when a run is in progress.",
      +  "type": "string"
      +}
  3. Changed2 schema fields changedv0.5.6
    • changedOutput schema / properties / budget / required
      Previous value: -[
      -  "maxUsd",
      -  "softLimitUsd",
      -  "maxIterations",
      -  "maxTokens"
      -]New value: +[
      +  "maxUsd",
      +  "softLimitUsd",
      +  "maxIterations"
      +]
    • changedOutput schema / 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"
      +]
  4. Changed2 schema fields changedv0.5.5
    • removedOutput schema / properties / loop / properties / costProvenance
      Removed value: -{
      -  "enum": [
      -    "actual",
      -    "calculated",
      -    "estimated",
      -    "unavailable"
      -  ],
      -  "type": "string"
      -}
    • changedOutput schema / 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"
      +]
  5. Changed4 schema fields changedv0.5.3
    • addedOutput schema / properties / cost / properties / provenance
      Added value: +{
      +  "enum": [
      +    "actual",
      +    "calculated",
      +    "estimated",
      +    "unavailable"
      +  ],
      +  "type": "string"
      +}
    • changedOutput schema / properties / cost / required
      Previous value: -[
      -  "actualUsd",
      -  "avoidedUsd",
      -  "tokensIn",
      -  "tokensOut"
      -]New value: +[
      +  "actualUsd",
      +  "avoidedUsd",
      +  "tokensIn",
      +  "tokensOut",
      +  "provenance"
      +]
    • addedOutput schema / properties / loop / properties / costProvenance
      Added value: +{
      +  "enum": [
      +    "actual",
      +    "calculated",
      +    "estimated",
      +    "unavailable"
      +  ],
      +  "type": "string"
      +}
    • changedOutput schema / 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"
      +]
  6. First observedv0.3.9

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint and idempotentHint, covering safety and repetition behavior. The description adds that the tool returns a specific summary of fields, but it does not disclose any additional behavioral traits such as error behavior, how missing runs are handled, or constraints on parameter combinations. With annotations in place, this is an acceptable baseline.

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 a single, well-structured sentence that leads with the action and then lists the output components. Every word earns its place, and there is no redundant or vague phrasing.

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?

Given that an output schema and readOnly/idempotent annotations exist, the description adequately summarizes what the tool does and returns. However, it does not clarify that exactly one of file, latest, or loopId should be used, or whether these are mutually exclusive. This is a minor gap for a read-only retrieval tool.

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?

The input schema provides descriptions for all 4 parameters, so schema coverage is 100%. The tool description itself adds no parameter-level meaning, and the baseline of 3 is appropriate because the schema carries the burden.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Load') and names the resource ('one Martin run'), then enumerates the returned fields (budget, cost, verification, artifact, canonical path summary). This makes the core purpose clear, but it does not explicitly differentiate from siblings like martin_get_attempt or martin_get_verification_results, aside from the field listing.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives no guidance on when to choose this tool over alternatives, nor does it mention parameter selection rules (e.g., file vs latest vs loopId). Agents are left to infer usage from the schema alone, and no exclusions or sibling comparisons are provided.

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