llm-apology-loop-detector-mcp
v1.0.0
Published
Detect apology loops, retry deadlocks, and 'I'll try again' agent failure modes in LLM transcripts. Surfaces the loop, scores severity, and prescribes an escalation action (temperature bump, model swap, human handoff).
Maintainers
Readme
llm-apology-loop-detector-mcp
Detect apology loops, retry deadlocks, and "I'll try again" failure modes in LLM transcripts. One MCP call gives you a health score and a ranked escalation plan.
Why
Production AI agents (Claude/GPT/Gemini) get stuck spiraling: "Sorry, you're right, let me try again" repeated 30 turns deep, burning $$$ in tokens and never converging. On-call engineers spot it eventually — this MCP server spots it in one call.
Tools
| Tool | What it does |
|------|--------------|
| detect_apology_loop | Phrase scan + sliding-window hot spots (density, severity, samples) |
| detect_retry_loop | Identical tool-call repeats + A→B→A→B sequence cycles |
| loop_health_score | 0-100 score: healthy / watch / degraded / deadlocked |
| escalation_advisor | Health + ranked actions: human_handoff, model_swap, reset_context, raise_temperature, kill_session, memoize_tool_failure, break_sequence |
| diagnose_transcript | One-shot on-call triage: headline + postmortem + first failure + everything above |
Install
npm install -g llm-apology-loop-detector-mcp// claude_desktop_config.json
{
"mcpServers": {
"apology-loop": {
"command": "npx",
"args": ["-y", "llm-apology-loop-detector-mcp"]
}
}
}Input shape
Any of:
- JSON array of messages:
[{role, content, tool?, input?}, ...] - JSONL string (one message per line)
{messages: [...]}object
License
MIT
