Skip to main content
Glama

groundcheck_evaluate_retrieval

Read-only

Compute retrieval quality metrics such as precision, recall, MRR, and NDCG. With gold labels, metrics are instant; without, the tool grades relevance automatically.

Instructions

Score retrieval quality for retrieved chunks against query.

Two modes, chosen automatically:
- Mode A (pass `relevant_ids`): precision@k, recall@k, MRR, NDCG computed
  by pure math from your gold relevance labels. Instant, no model calls.
- Mode B (omit `relevant_ids`): no gold labels available, so each chunk
  is graded 0-3 for relevance via one sampling call, then the same
  metrics are computed from those grades. Use this when you don't have
  a labeled relevant-docs set for this query.

Args:
    query: the search query the chunks were retrieved for.
    retrieved: ranked list of {id, text} chunks, in retrieval order (rank matters).
    relevant_ids: ids of chunks known to be relevant. Supply this whenever
        you have gold labels -- Mode A is free and exact.
    k_values: cutoffs to compute metrics at (default [3, 5, 10]).

Output states which mode ran. Mode A: instant. Mode B: 1 model call, no
API key needed if your client supports sampling.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
k_valuesNo
retrievedYes
relevant_idsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
mrrYes
modeYesWhich mode actually ran: gold_labels or llm_graded.
ndcgYesNDCG@k for each requested k.
metricsYesPrecision/recall@k for each requested k.
graded_relevanceNoPer-chunk LLM grades, only present in llm_graded mode.
Behavior4/5

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

Annotations already mark the tool as read-only and non-destructive. The description adds valuable context: Mode A is instant with no model calls, Mode B uses one sampling call without requiring an API key. This helps the agent understand performance and dependency implications.

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 approximately 150 words, well-organized into purpose, modes, and argument list. Every sentence serves a distinct purpose—no redundancy or fluff. Front-loading the core action and mode selection makes it easy to scan.

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?

Given the tool's complexity (two modes, multiple parameters, output schema exists), the description covers behavioral aspects, parameter semantics, and output indication ('states which mode ran'). It does not detail the output metrics, but that is delegated to the output schema. Minor gap: it could explicitly mention the metric names (precision, recall, MRR, NDCG) are computed, but they are listed earlier in the description.

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?

Despite low schema description coverage (0%), the description fully explains all four parameters (query, retrieved, relevant_ids, k_values) with their roles and constraints. It clarifies the structure of 'retrieved' as a list of {id, text} objects and emphasizes that rank matters. This compensates entirely for the sparse schema.

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 clear action ('Score retrieval quality') and specifies the resources ('retrieved' chunks, 'query'). It distinguishes itself from sibling tools (e.g., detect_hallucinations, evaluate_faithfulness) by focusing solely on retrieval quality. The two-mode breakdown further clarifies the tool's scope.

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 explicitly guides when to use each mode: Mode A when relevant_ids are available ('free and exact'), Mode B when not. It does not directly contrast with sibling tools, but the purpose is distinct enough that an agent can infer usage. The guidance is clear and actionable.

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/offquestxo/groundcheck'

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