Skip to main content
Glama

guard_loop_check

Idempotent

Checks the current session's failing-command streak and tells you whether rerunning the same normalized command will be blocked, so you can avoid repeating a command that just failed.

Instructions

Report failing-command streaks for this session and whether the next rerun blocks.

Use it before repeating a command that just failed. The same normalized command, including a trailing ; or a trailing || true mask, shares one streak. It takes no parameters. It returns PC loops, up to five command × count lines, and a Nudge. When a streak is at loop_block_after (default 3), the text says the next identical run will be blocked. Streaks come from bash tool results and from guard_verify rows for PC_SESSION_ID (or default). An unproven exit 0 does not reset a streak. Side effects: if .agent-guard/ is missing it is created, and config.json is seeded when that file is absent. It does not run the command and does not append the journal or the evidence ledger.

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": "guard_loop_check"
  }
}

Input Schema

NameRequiredDescriptionDefault

No arguments

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations declare readOnlyHint=false, which would otherwise look odd for a status-check tool; the description resolves this by disclosing that it creates `.agent-guard/` and seeds `config.json` when absent. It further discloses normalization rules (trailing `;` or `|| true` share a streak), the streak sources (bash results and guard_verify rows for `PC_SESSION_ID` or `default`), the `loop_block_after` threshold default of 3, and the subtle rule that an unproven exit 0 does not reset a streak.

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?

Purpose and the when-to-use trigger are front-loaded, followed by semantics, sources, side effects, and explicit non-effects in a logical order. Every sentence carries operational information, including the return-shape sentence, which tells the agent what textual output to expect rather than merely restating a schema.

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?

For a zero-parameter status tool with an output schema and non-read-only annotations, the description covers the trigger, normalization semantics, threshold behavior, data provenance, filesystem side effects, and what it deliberately does not do. Nothing an agent needs to call it correctly is missing.

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?

With zero parameters the baseline is 4, and the description explicitly states it takes no parameters, matching the empty schema. There is no additional parameter meaning to add beyond that confirmation.

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+resource: reporting failing-command streaks for the session and whether the next rerun will block. It is clearly distinct from siblings like guard_verify, which it explicitly names as a data source rather than a duplicate.

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?

"Use it before repeating a command that just failed" gives an explicit trigger condition tied to agent behavior. It lacks an explicit 'do not use when' or a named sibling alternative, but the negative scope (does not run the command, does not write the journal or ledger) implicitly covers the main mis-selection risks.

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