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

MartinLoop — Stop Runaway Loops, Bad Code & Token Waste

martin_logs

Read-onlyIdempotent

Read recent run events, ledger entries, control receipts, and executor records for one run to observe activity, diagnose stuck or failed runs, and audit operator actions without changing state.

Instructions

Read recent MartinLoop events, ledger entries, operator control receipts, and reconciled executor control-application records for a single run. Use to observe live or completed run activity, diagnose stuck or failed runs, or audit operator actions. Do not use to check run completion status — use martin_get_status instead. Do not use to retrieve verification evidence — use martin_get_verification_results instead. This tool only reads persisted run files and does not execute commands, modify state, or contact GitHub.

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_logs"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileNoAbsolute or relative path to a loop-record.json file or run directory. Mutually exclusive with loopId and latest.
limitNoMaximum number of log entries to return, sorted by timestamp descending. Defaults to 20.
latestNoWhen true, loads the most recently updated run in the run store. Mutually exclusive with file and loopId.
loopIdNoMartinLoop run identifier from the run store. Mutually exclusive with file and latest.
runsDirNoOverride the default run-store root directory. Optional; defaults to the MartinLoop runs directory.

Output Schema

NameRequiredDescriptionDefault
liveYes
loopIdYesUnique MartinLoop run identifier.
sourceYesResolved path to the loop-record source file.
entriesYesLog entries sorted by timestamp descending, capped at limit.
logCountYesNumber of log entries returned after applying the limit.
sourceKindYesHow the run was identified: by file path, loop ID, latest flag, or runs directory.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.9.0
    • addedOutput schema / properties / live / properties / appliedControlState
      Added value: +{
      +  "description": "Control state reconciled from validated executor application evidence.",
      +  "enum": [
      +    "active",
      +    "paused",
      +    "cancellation_pending",
      +    "terminal"
      +  ],
      +  "type": "string"
      +}
    • changedOutput schema / properties / live / properties / pauseState / description
      Previous value: -"Whether the run is active, paused, or has a pending cancellation."New value: +"Backwards-compatible applied control state; pending pause requests remain active."
    • addedOutput schema / properties / live / properties / requestedControlState
      Added value: +{
      +  "description": "Latest durable operator request; this does not prove executor application.",
      +  "enum": [
      +    "active",
      +    "paused",
      +    "cancellation_requested",
      +    "terminal"
      +  ],
      +  "type": "string"
      +}
    • changedOutput schema / properties / live / required
      Previous value: -[
      -  "lifecycleState",
      -  "pauseState",
      -  "approvalState"
      -]New value: +[
      +  "lifecycleState",
      +  "requestedControlState",
      +  "appliedControlState",
      +  "pauseState",
      +  "approvalState"
      +]
  2. Changed1 schema field changedv0.6.6
    • removedInput schema / oneOf
      Removed value: -[
      -  {
      -    "required": [
      -      "file"
      -    ]
      -  },
      -  {
      -    "required": [
      -      "loopId"
      -    ]
      -  },
      -  {
      -    "required": [
      -      "latest"
      -    ]
      -  }
      -]
  3. Changed8 schema fields changedv0.5.6
    • addedInput schema / properties / file / description
      Added value: +"Absolute or relative path to a loop-record.json file or run directory. Mutually exclusive with loopId and latest."
    • addedInput schema / properties / latest / description
      Added value: +"When true, loads the most recently updated run in the run store. Mutually exclusive with file and loopId."
    • addedInput schema / properties / limit / description
      Added value: +"Maximum number of log entries to return, sorted by timestamp descending. Defaults to 20."
    • addedInput schema / properties / loopId / description
      Added value: +"MartinLoop run identifier from the run store. Mutually exclusive with file and latest."
    • addedInput schema / properties / runsDir / description
      Added value: +"Override the default run-store root directory. Optional; defaults to the MartinLoop runs directory."
    • changedOutput schema / additionalProperties
      Previous value: -trueNew value: +false
    • addedOutput schema / properties
      Added value: +{
      +  "entries": {
      +    "description": "Log entries sorted by timestamp descending, capped at limit.",
      +    "items": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "kind": {
      +          "description": "Event type or control action name.",
      +          "type": "string"
      +        },
      +        "payload": {
      +          "additionalProperties": true,
      +          "description": "Event-specific payload data.",
      +          "type": "object"
      +        },
      +        "source": {
      +          "description": "Origin stream: loop event bus, governance ledger, or operator control receipts.",
      +          "enum": [
      +            "event",
      +            "ledger",
      +            "control"
      +          ],
      +          "type": "string"
      +        },
      +        "timestamp": {
      +          "description": "ISO 8601 timestamp of the event, if present.",
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "source",
      +        "kind",
      +        "payload"
      +      ],
      +      "type": "object"
      +    },
      +    "type": "array"
      +  },
      +  "live": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "approvalState": {
      +        "description": "Whether the run is waiting at a human-approval checkpoint.",
      +        "enum": [
      +          "not_required",
      +          "resume_requested"
      +        ],
      +        "type": "string"
      +      },
      +      "lifecycleState": {
      +        "description": "Current run lifecycle state (e.g. running, completed, cancelled).",
      +        "type": "string"
      +      },
      +      "pauseState": {
      +        "description": "Whether the run is active, paused, or has a pending cancellation.",
      +        "enum": [
      +          "active",
      +          "paused",
      +          "cancellation_requested"
      +        ],
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "lifecycleState",
      +      "pauseState",
      +      "approvalState"
      +    ],
      +    "type": "object"
      +  },
      +  "logCount": {
      +    "description": "Number of log entries returned after applying the limit.",
      +    "type": "integer"
      +  },
      +  "loopId": {
      +    "description": "Unique MartinLoop run identifier.",
      +    "type": "string"
      +  },
      +  "source": {
      +    "description": "Resolved path to the loop-record source file.",
      +    "type": "string"
      +  },
      +  "sourceKind": {
      +    "description": "How the run was identified: by file path, loop ID, latest flag, or runs directory.",
      +    "enum": [
      +      "file",
      +      "loop_id",
      +      "latest",
      +      "runs_root"
      +    ],
      +    "type": "string"
      +  }
      +}
    • addedOutput schema / required
      Added value: +[
      +  "source",
      +  "sourceKind",
      +  "loopId",
      +  "logCount",
      +  "live",
      +  "entries"
      +]
  4. First observedv0.3.9

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, non-destructive and openWorldHint=false, so the safety profile is pre-covered. The description still adds genuine context: it reads only persisted run files, executes no commands, changes no state, and makes no GitHub calls — useful reassurance about side effects and data provenance, though it adds nothing about result ordering, truncation, or pagination behavior.

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

Conciseness4/5

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

Front-loaded with purpose, then use cases, then exclusions — a logical funnel with no filler. The closing sentence repeats side-effect guarantees already implied by the annotations, so it earns slightly less than full marks.

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 a rich output schema, full annotation coverage and complete parameter documentation, the description needn't explain return values or parameter syntax. It is nearly complete; the only shortfall is not helping the agent choose among the three mutually exclusive run selectors, which matters for an optional-only parameter set.

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 file, loopId, latest, limit and runsDir are all fully documented in the schema, including their mutual exclusivity. The description only echoes the 'single run' scoping and adds no selector guidance (e.g., which of file/loopId/latest to prefer), so 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?

The description opens with a specific verb ('Read') and enumerates the exact record types returned (events, ledger entries, operator control receipts, reconciled executor control-application records) scoped to 'a single run'. That level of specificity makes it clearly distinguishable from the many martin_* siblings.

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 three concrete use cases (observe live/completed activity, diagnose stuck or failed runs, audit operator actions) and two explicit exclusions with named alternatives: martin_get_status for completion status and martin_get_verification_results for verification evidence. This is the when/when-not/alternative pattern at full strength.

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