Skip to main content
Glama

locus_explain

Explains why a retrieved chunk matched a query by reporting BM25 term matches, linked knowledge-graph entities, and structural signals in plain English.

Instructions

Explain WHY a chunk was (or would be) retrieved for a query. Reports which BM25 terms matched, which KG entities link to the document, and which structural signals fired. Returns a plain-English narrative. Unique to graph-based RAG — impossible with vector search.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "chunk_id": "<chunk_id>"
    },
    "name": "locus_explain"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryNoThe query to explain against (optional but recommended).
chunk_idYesChunk ID from a prior locus_retrieve call.
store_pathNo.locus

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.3.1

TDQS

A3.6/5.0
Behavior4/5

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

With no annotations present, the description carries the full burden and does disclose meaningful behavior: what evidence categories are reported and that output is a plain-English narrative rather than raw scores. It does not state whether the tool re-executes retrieval, whether it mutates anything, or what happens when query is omitted — gaps that matter for a no-annotation tool, but the core behavior is well surfaced.

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?

Four short sentences, front-loaded with the core purpose and evidence categories. The closing 'Unique to graph-based RAG — impossible with vector search' leans promotional but does help an agent recognize the niche, so it roughly earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 3-param, no-annotation, no-output-schema tool, the description supplies the return format but leaves the default store_path unexplained and says nothing about error conditions (e.g. unknown chunk_id) or cost of re-running retrieval. Adequate to call correctly, incomplete for confident use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 67% and the description adds no per-parameter detail — chunk_id's provenance and query's 'optional but recommended' nature are already in the schema, and store_path is undocumented in both places. The one added nuance is that query enables the hypothetical '(would be)' mode, which is modest value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb and resource: 'Explain WHY a chunk was (or would be) retrieved,' and enumerates the exact signals it reports (BM25 terms, KG entities, structural signals). It doesn't explicitly route against named siblings such as locus_inspect or locus_prepare_context, but the stated purpose is concrete enough to distinguish it.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied — the word 'Explain' plus '(or would be)' suggests a debugging/retrieval-inspection context, but the description never states when to prefer this over siblings or when it is unnecessary. The practical prerequisite (chunk_id must come from a prior retrieval) lives in the schema, not the description, so an agent must read both fields to use it correctly.

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