Skip to main content
Glama

cos_retrieval_quality

Read-onlyIdempotent

Reports mean retrieval precision over a lookback window, from citation-outcome pairs, to decide if contextual enrichment is worth the LLM cost.

Instructions

Report mean retrieval precision over the lookback window.

Precision is derived from (was_cited, outcome) pairs on the retrievals table, so it's honest: a retrieval that was cited and led to success counts as 1.0; a cited retrieval that led to rework counts as 0.0. Used to decide whether contextual enrichment is worth the LLM cost.

Args: lookback_days: Window in days (default 14). layer: Optional layer filter ("memory"|"docs"|"tasks").

Returns: {mean_precision, samples, below_gate, gate, layer, status}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
layerNo
lookback_daysNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

The description adds substantial behavioral context beyond the annotations. It explains that precision is derived from (was_cited, outcome) pairs, counts cited-success as 1.0 and cited-rework as 0.0, and frames it as 'honest.' This discloses the computation logic and the meaning of the metric, which is very valuable for correct interpretation. It is consistent with the read-only and idempotent hints.

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 well-structured: a one-sentence purpose, a concise explanation of how precision is calculated, a use-case statement, and clearly separated Args/Returns sections. It is front-loaded and every sentence adds useful information without unnecessary detail.

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 purpose, metric derivation, use case, parameters, and returns structure. However, it mentions 'below_gate' and 'gate' in the return without explaining what gate threshold is or how it is set. Since an output schema exists, this is a minor gap, so a 4 is appropriate.

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?

Even though schema description coverage is 0%, the description's Args section clearly explains each parameter: lookback_days as 'Window in days (default 14)' and layer as an optional filter with allowed values ('memory'|'docs'|'tasks'). This fully compensates for the lack of schema descriptions and adds default values and allowed domains.

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 and resource: 'Report mean retrieval precision over the lookback window.' It goes on to define precision clearly from (was_cited, outcome) pairs, and the intent is distinct from sibling retrieval tools like cos_retrieval_cite or cos_retrieval_learn, which handle citations and learning rather than quality reporting.

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?

The description states when this tool is valuable: 'Used to decide whether contextual enrichment is worth the LLM cost.' This provides a clear decision context, though it does not explicitly mention alternative tools or when not to use it, so it falls short of a full 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/kouroshez/coding-os'

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