Skip to main content
Glama

incidents

Detect destructive commands run by AI agents and verify whether an apology or rollback reaction followed.

Instructions

Dangerous shell commands + regret reactions — the incidents preset.

One call answers "where did an agent run something destructive — and did it then apologise?". A preset over the existing core, not a second engine: ONE query scan (type="tool_call", tool_kind="bash") supplies the candidates, a deterministic danger dictionary (harvested from public agent-guardrail rule sets, calibrated on real history) selects the dangerous commands, and a bilingual (ru + en) regret dictionary scans the next reaction_window messages (default 6) for an apology/rollback reaction — the two-step check behind the confirmed flag. Zero LLM, zero guessing: no dictionary hit → no incident; no reaction → confirmed: false, never inferred.

Filters (all parameters): agent, session (uuid or list of uuids), since/until (ISO bounds on the call ts), category (fs/git/db/net — unknown values fail loud), confirmed (include default | only | exclude), noise and project_dir (session-level, same semantics as query).

Each incident record carries the query event id (walk its context via query(relative_to=...) / read_session), the matched patterns + categories, a char-capped command fragment centred on the hit (token budget — full context stays on-demand), is_error (null when the agent's format has no correlated outcome signal — honest, cross-agent), confirmed and reaction (message_index/offset/role/marker labels/capped preview; null when unconfirmed). count/confirmed_count/ by_pattern always reflect the FULL match set; limit (default 50, 0 = no cap) bounds only the emitted records (truncated).

Dictionary caveat (documented, not hidden): patterns are a deterministic dictionary, not a shell interpreter — a command that merely mentions a dangerous string (e.g. echo "rm -rf /") can still match. Matching runs on the extracted command field (a Bash description alone never fires) and always on the RAW stored text; redact=true (default) masks secrets only in the emitted session_title/command/reaction.preview fields (redactions type→count dict when anything was masked). When count == 0 the response carries diagnostics so an empty result is explainable (missing source dir vs all-excluding filter vs a genuinely clean history).

Thin wrapper over :func:ai_r.incidents.incidents that translates the core ValueError contract into the {"error": "invalid_argument", "message": str(exc)} shape the MCP client expects.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
agentNo
limitNo
noiseNoinclude
sinceNo
untilNo
redactNo
sessionNo
categoryNo
confirmedNoinclude
project_dirNo
reaction_windowNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

With no annotations, the description carries full burden, and it delivers: discloses deterministic dictionaries (no LLM), false-positive potential (echo "rm -rf /"), redaction behavior, is_error null when no correlated outcome, count/truncated semantics, diagnostics on empty results, and the error contract. This is exemplary transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long but dense and front-loaded with the purpose in the first sentence. It is organized into logical paragraphs (purpose/mechanism, filters, output, caveats, wrapper). A 5 would require tighter structure (e.g., bullets), but every sentence earns its place.

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?

Given 11 parameters, no annotations, and no schema descriptions, the description is remarkably complete. It covers output fields (id, patterns, categories, command fragment, is_error, confirmed, reaction, count, confirmed_count, by_pattern, truncated, diagnostics), cross-references to query/read_session, and error handling. Nothing critical is missing.

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?

Schema description coverage is 0%, but the description compensates by explaining every parameter with semantics: filters (agent, session, since/until, category, confirmed, noise, project_dir), limit default/cap, redact masking, reaction_window default, and category 'unknown values fail loud'. This fully covers all 11 parameters.

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 'Dangerous shell commands + regret reactions' and states the one-call question: 'where did an agent run something destructive — and did it then apologise?'. This is a specific verb+resource scope and clearly distinguishes it from raw query or tool-call siblings by framing it as a preset over the core.

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?

Clear context is provided: 'One call answers...' and the internal mechanism (one query scan, dictionaries, reaction_window) helps the agent decide when to use it. However, it does not explicitly state when not to use it or name alternative sibling tools, so it falls short of a 5.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pro-target/ai-r'

If you have feedback or need assistance with the MCP directory API, please join our Discord server