Skip to main content
Glama

Snapback

detect_loop

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)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses that the tool is non-blocking, returns advice rather than a verdict, and is fast/free. It also clarifies the input expectation (recent steps) and the output type (whether stuck and a concrete next move). It doesn't detail rate limits or exact response format, but the key behavioral traits are covered.

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 compact and front-loaded with the key value proposition ('MID-RUN loop check (fast, no LLM, free)'). Every sentence earns its place: what it does, when to call it, and what it returns. No fluff.

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?

For a tool with 2 params, 100% schema coverage, and no output schema, the description is quite complete. It explains the input shape, the timing, and the nature of the output. It could mention whether the output includes a suggested next action in a structured format, but the description already says 'get back whether you're stuck repeating a tool call and a concrete next move,' which is sufficient for an agent to decide to call it.

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 baseline is 3. The description adds meaning by explaining the steps parameter expects 'recent steps (last ~5-10)' and references the same shape as diagnose_trace, which helps the agent understand what to pass. The threshold parameter is already well-described in the schema, but the description's context about 'identical consecutive calls' reinforces its 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 clearly states the tool's purpose: a mid-run loop check that detects whether the agent is stuck repeating a tool call and provides a concrete next move. It distinguishes itself from siblings like diagnose_trace by emphasizing it is fast, free, and meant to be called during a run, not as 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 Guidelines5/5

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

The description explicitly says when to use it: 'Send your recent steps DURING a run' and 'Call this every few steps to catch a loop BEFORE you burn your step budget.' It also contrasts with the alternative 'don't wait for a postmortem,' which implies diagnose_trace is for after-the-fact analysis. This is strong usage guidance.

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.