Skip to main content
Glama

cos_failure_pattern_query

Read-onlyIdempotent

Aggregates structured failure patterns from backtrack events, showing recurring root causes with examples to avoid known pitfalls before planning.

Instructions

Aggregate structured failure anatomy from backtrack_events.

Returns which root_cause categories recur most frequently, with examples. Use before planning to avoid known failure modes. Requires migration v25 (structured backtrack anatomy columns).

root_cause filter values: wrong_model | scope_too_large | missing_context | tool_failure | spec_ambiguity | env_mismatch | other

Args: root_cause: Optional filter to a specific root cause category. domain: Reserved for future per-domain filtering. limit: Max pattern groups to return (1-50, default 10).

Returns: JSON with {patterns: [{root_cause, count, examples}], total_structured, total_backtrack}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
domainNo
root_causeNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint. The description adds beyond annotations by noting the migration v25 requirement and that 'domain' is reserved for future use. No contradiction with annotations.

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 yet well-structured with separate paragraphs for purpose, usage, Args, and Returns. Every sentence adds value and no information is redundant.

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 the presence of an output schema and three parameters, the description covers purpose, usage timing, prerequisites, parameter semantics, and return format. It leaves no important gaps for selecting or invoking the tool.

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 input schema provides zero descriptive text (0% coverage), but the description compensates with a full Args section: explains 'root_cause' filter values, 'domain' reserved status, and 'limit' range/default. This fully clarifies parameter meaning.

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 uses a specific verb ('Aggregate') and resource ('backtrack_events'), and clearly states the output (root_cause categories with examples). It distinguishes itself from sibling query tools by focusing on failure anatomy from backtrack events.

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?

Explicitly states 'Use before planning to avoid known failure modes' and notes the prerequisite migration v25. It does not mention when not to use the tool or alternatives, but the context is clear.

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/kouroshez/coding-os'

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