Skip to main content
Glama
Keesan12

MartinLoop — Stop Runaway Loops, Bad Code & Token Waste

martin_eval

Read-onlyIdempotent

Grade a completed run on task completion, verifier health, diff discipline, regression risk, security risk, and reviewability, then return a merge-readiness verdict for deciding safe merge or promotion.

Instructions

Grade a MartinLoop run across six dimensions — task completion, verifier health, diff discipline, regression risk, security risk, and reviewability — and return a scored merge-readiness verdict. Use after a governed run completes to decide whether the result is safe to merge or promote. Use before martin_pr_summary or martin_create_pr to confirm the run is merge-ready. Do not use to retrieve raw verification command output — use martin_get_verification_results for that. Do not use to review an existing PR body — use martin_review_pr instead. This tool reads saved run evidence and inspects local git signals; it does not modify state or contact GitHub.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileNoAbsolute or relative path to a loop-record.json file or run directory. Mutually exclusive with loopId and latest.
latestNoWhen true, evaluates 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.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
gradeYesOverall merge readiness grade derived from the six check dimensions.
scoreYesNumeric evaluation score from 0–100.
checksYes
loopIdYesUnique MartinLoop run identifier.
sourceYesResolved path to the loop-record source file.
summaryYesOne-paragraph plain-English evaluation summary.
warningsYesNon-blocking advisory warnings from the evaluation.
sourceKindYesHow the run was identified.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 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, evaluates the most recently updated run in the run store. Mutually exclusive with file and loopId."
    • 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."
    • changedOutput schema / additionalProperties
      Previous value: -trueNew value: +false
    • addedOutput schema / properties
      Added value: +{
      +  "checks": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "diffDiscipline": {
      +        "description": "Whether file-scope discipline was maintained.",
      +        "enum": [
      +          "passed",
      +          "warning",
      +          "failed"
      +        ],
      +        "type": "string"
      +      },
      +      "regressionRisk": {
      +        "description": "Whether regression risk signals were detected.",
      +        "enum": [
      +          "passed",
      +          "warning",
      +          "failed"
      +        ],
      +        "type": "string"
      +      },
      +      "reviewability": {
      +        "description": "Whether the PR body and dossier are reviewer-ready.",
      +        "enum": [
      +          "passed",
      +          "warning",
      +          "failed"
      +        ],
      +        "type": "string"
      +      },
      +      "securityRisk": {
      +        "description": "Whether security risk signals were detected.",
      +        "enum": [
      +          "passed",
      +          "warning",
      +          "failed"
      +        ],
      +        "type": "string"
      +      },
      +      "taskCompletion": {
      +        "description": "Whether the run reached a completed status.",
      +        "enum": [
      +          "passed",
      +          "warning",
      +          "failed"
      +        ],
      +        "type": "string"
      +      },
      +      "verifier": {
      +        "description": "Whether automated verifiers passed.",
      +        "enum": [
      +          "passed",
      +          "warning",
      +          "failed"
      +        ],
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "taskCompletion",
      +      "verifier",
      +      "diffDiscipline",
      +      "regressionRisk",
      +      "securityRisk",
      +      "reviewability"
      +    ],
      +    "type": "object"
      +  },
      +  "grade": {
      +    "description": "Overall merge readiness grade derived from the six check dimensions.",
      +    "enum": [
      +      "mergeable",
      +      "mergeable_with_review",
      +      "needs_review",
      +      "blocked",
      +      "insufficient_evidence"
      +    ],
      +    "type": "string"
      +  },
      +  "loopId": {
      +    "description": "Unique MartinLoop run identifier.",
      +    "type": "string"
      +  },
      +  "score": {
      +    "description": "Numeric evaluation score from 0–100.",
      +    "type": "number"
      +  },
      +  "source": {
      +    "description": "Resolved path to the loop-record source file.",
      +    "type": "string"
      +  },
      +  "sourceKind": {
      +    "description": "How the run was identified.",
      +    "enum": [
      +      "file",
      +      "loop_id",
      +      "latest",
      +      "runs_root"
      +    ],
      +    "type": "string"
      +  },
      +  "summary": {
      +    "description": "One-paragraph plain-English evaluation summary.",
      +    "type": "string"
      +  },
      +  "warnings": {
      +    "description": "Non-blocking advisory warnings from the evaluation.",
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": "array"
      +  }
      +}
    • addedOutput schema / required
      Added value: +[
      +  "source",
      +  "sourceKind",
      +  "loopId",
      +  "score",
      +  "grade",
      +  "checks",
      +  "warnings",
      +  "summary"
      +]
  2. First observedv0.3.9

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint, and the description adds valuable behavioral context beyond those: it 'reads saved run evidence and inspects local git signals' and explicitly states 'it does not modify state or contact GitHub.' This clarifies the data sources and side-effect boundary without contradicting 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 front-loaded with the core purpose, then provides sequencing guidance, exclusions, and behavioral guarantees in a compact, structured way. Every sentence adds information needed for correct selection and invocation; the length is justified by the many sibling tools and the need to route to alternatives.

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 tool has a rich output schema, so return-value details are covered separately. The description supplies everything else an agent needs: when to call it, when not to call it, what it reads, what it does not affect, and how it fits into the merge workflow. No important gap remains.

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 the schema fully documents the file, loopId, latest, and runsDir parameters and their mutual exclusivity. The tool description focuses on the tool's purpose rather than parameter details, which is acceptable because the schema already carries the parameter semantics.

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 states a specific verb ('Grade') and resource ('a MartinLoop run'), enumerates the six evaluation dimensions, and names the output ('scored merge-readiness verdict'). It also differentiates itself from sibling tools like martin_get_verification_results and martin_review_pr, making its purpose unambiguous.

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 to use it after a governed run completes and before martin_pr_summary or martin_create_pr, establishing clear sequencing. It also gives two concrete negative cases with named alternatives: raw verification output goes to martin_get_verification_results, and existing PR review goes to martin_review_pr.

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