Skip to main content
Glama

find_loops

Extract repeated commands or edits from a session transcript that exceed a threshold, excluding read-only actions to identify wasteful loops.

Instructions

Return only the repeated stateful actions in a session.

A loop is the same command or edit issued at least threshold times. Reads and other read-only tools are excluded, because re-reading a file is navigation rather than thrash.

Args: path: Path to a .jsonl session transcript. threshold: Repeats of one action that count as a loop.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
thresholdNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses the core behavior (returning repeated stateful actions), excludes read-only operations, and clarifies the threshold parameter. However, it does not mention side effects, error handling, or output format, which are typical behavioral details.

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 concise, well-organized, and free of fluff. It opens with a one-sentence summary, provides a brief definition, and lists parameters in a clear Args format. No unnecessary information is included.

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?

The description covers the essential aspects for using the tool: what it returns, what it excludes, and the meaning of both parameters. It does not specify the exact return format or edge cases, but for a simple analysis tool the information is sufficient.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has no parameter descriptions, but the tool description fully compensates by explaining both parameters: 'path' is described as a path to a .jsonl transcript, and 'threshold' is defined as the repeat count that qualifies as a loop. Both are clear and align with the earlier definition.

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 clearly states the tool's function ('Return only the repeated stateful actions in a session') with a specific verb and resource. It also defines a 'loop' precisely, but does not explicitly distinguish it from sibling tools like analyze_session or cost_report.

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 provides a clear definition of what constitutes a loop, but it lacks explicit guidance on when to use this tool versus alternatives such as list_sessions or analyze_session. No direct comparison or 'use this when' statement is given.

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

Deploy Server

Other Tools