Skip to main content
Glama

detect_loop

Read-onlyIdempotent

MID-RUN loop check (fast, no LLM, free). Send your recent steps DURING a run; get back whether you're stuck repeating a tool call and a concrete next move. Call this every few steps to catch a loop BEFORE you burn your step budget — don't wait for a postmortem. Non-blocking advice, not a verdict.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stepsYesyour recent steps (last ~5-10), each with an action/tool and optionally inputs — same step shape as diagnose_trace
thresholdNohow many identical consecutive calls = a loop (default 3)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "description": "A JSON object (returned as text in result.content[0].text). Diagnosis tools return {matched, family, fix, confidence, source, action_class, auto_safe, gate}; other tools return their own JSON result.",
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive behavior. The description adds useful behavioral context beyond them: it is 'fast, no LLM, free' and returns 'non-blocking advice, not a verdict,' which tells the agent how to interpret the output.

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 tight sentences with the mid-run timing and purpose front-loaded. Each sentence earns its place by covering purpose, timing, and output nature without repetition.

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?

With an output schema present, the description does not need to detail return values, and it still summarizes what comes back. It gives enough context for an agent to call the tool correctly during a run.

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 already documents both parameters — steps as recent action/tool records and threshold as the repeat count. The description does not add syntax or default details beyond what the schema provides, making the baseline 3 appropriate.

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 and resource — a mid-run loop check — and explains exactly what it returns: whether the agent is stuck repeating a tool call plus a concrete next move. It distinguishes itself from postmortem diagnostics by emphasizing 'MID-RUN' and 'don't wait for a postmortem.'

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

Usage Guidelines4/5

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

It explicitly says when to call it: 'every few steps' and 'BEFORE you burn your step budget,' with a clear when-not: 'don't wait for a postmortem.' It references diagnose_trace only for step shape, not as an explicit alternative, so routing guidance is clear but not fully enumerated.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.