# Retrieval Relevance Scorer MCP for AI Agents MCP

> Retrieval Relevance Scorer is a deterministic scoring engine that cleans up RAG pipelines. It uses Jaccard similarity, TF-IDF, and coverage metrics to filter out noisy, irrelevant documents before they reach your AI client, ensuring your agent only works with high-signal context.

## Overview
- **Category:** data-processing
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_Kx7cXouaqZrfTsnawEqwgyW4QrEjd9p5Y4I1xFB8/mcp
- **Tags:** rag, tfidf, jaccard, filtering, deterministic

## Description

If you've ever watched an AI agent hallucinate because it was fed a mountain of irrelevant search results, you know the problem with standard RAG. Most retrieval systems just grab whatever looks vaguely similar and dump it into the prompt, forcing the model to sift through the noise. This MCP changes that by acting as a mathematical gatekeeper for your context window. Instead of relying on fuzzy vector similarity alone, it applies hard logic to evaluate how well your documents actually match a query. It checks for keyword overlap, term importance, and whether the essential parts of your question are actually present in the text. By filtering out the junk, you ensure that your agent only sees the high-signal information it needs to be accurate. You can find this and thousands of other specialized tools in the Vinkius catalog, where you connect once and immediately give your AI client the ability to perform these precise mathematical checks. It turns a messy retrieval process into a clean, predictable stream of relevant data.

## Tools

### get_scoring_config
Shows the current mathematical weights used for scoring. Use this to tune how much importance is placed on keyword overlap versus term importance.

### analyze_coverage_gap
Finds which specific query terms are missing from your documents. This helps you understand why an agent might be failing to answer a question.

### score_documents
Calculates a relevance score for a list of documents against a query. It's the primary way to rank and filter your context.

## Prompt Examples

**Prompt:** 
```
How relevant are these three snippets to the query 'renewable energy trends 2024'?
```

**Response:** 
```
Based on the query, here is the relevance breakdown:

| Document | Score | Status |
| :--- | :--- | :--- |
| **Doc 1:** Solar and wind growth in 2024... | **0.92** | High Signal |
| **Doc 2:** History of fossil fuel use... | **0.15** | Irrelevant |
| **Doc 3:** 2024 economic outlook... | **0.45** | Low Signal |

**Recommendation:** Only pass Doc 1 to your agent.
```

**Prompt:** 
```
Why is my agent unable to answer questions about 'quantum computing error correction'?
```

**Response:** 
```
I analyzed the retrieved document set for your query. 

**Findings:**
* **Missing Terms:** `error correction`, `qubit stability`.
* **Coverage Gap:** While the documents discuss 'quantum computing' generally, they lack the specific technical terms required to address 'error correction'.

**Action:** You need to update your retrieval index or expand your search parameters to include these specific terms.
```

**Prompt:** 
```
What are the current settings for how documents are scored?
```

**Response:** 
```
The current scoring configuration is as follows:

* **Jaccard Similarity (Keyword Overlap):** 0.30
* **TF-IDF (Term Importance):** 0.50
* **Query Term Coverage:** 0.20

These weights prioritize term importance (TF-IDF) as the primary driver for relevance.
```

## Capabilities

### Filter out noisy context
Remove irrelevant documents that don't actually match the user's intent.

### Identify missing information
Find exactly which parts of a query are missing from your current document set.

### Inspect scoring weights
See how the engine is prioritizing different mathematical metrics.

### Diagnose retrieval gaps
Pinpoint why certain terms aren't showing up in your search results.

### Rank document relevance
Assign mathematical scores to a collection of text based on a specific query.

## Use Cases

### Fixing Hallucinations in Customer Support
A support agent keeps giving wrong answers because the vector search pulls in outdated manuals. Use this MCP to filter for exact keyword matches in the latest documentation.

### Optimizing Legal Document Search
An attorney needs to find specific clauses. The MCP ensures that only documents containing the exact legal terms requested are passed to the agent.

### Debugging RAG Performance
A developer notices an agent can't answer questions about 'photosynthesis'. They use the coverage tool to confirm the term is actually missing from the indexed data.

### Reducing Token Waste
A team is overspending on long context windows. They use the scoring engine to prune the bottom 50% of retrieved documents that don't meet a relevance threshold.

## Benefits

- Stop hallucinations by stripping away irrelevant context before it hits the prompt.
- Improve response accuracy using Jaccard and TF-IDF metrics instead of just vector distance.
- Identify information gaps in your knowledge base using coverage analysis.
- Fine-tune your retrieval logic by inspecting weight distributions.
- Reduce token costs by only sending high-signal documents to your agent.

## How It Works

The bottom line is that it replaces fuzzy similarity with deterministic math to stop hallucinations.

1. Connect the MCP to your AI client through the Vinkius platform.
2. Pass your retrieved documents and the user query to the scoring engine.
3. Receive a filtered set of high-relevance documents ready for your agent.

## Frequently Asked Questions

**How can I use Retrieval Relevance Scorer to stop my AI from hallucinating?**
You use it to filter out irrelevant text before it ever reaches your agent. By scoring documents against the query, you ensure only the most relevant information is included in the prompt.

**Does Retrieval Relevance Scorer work with any AI client?**
Yes, as long as your client is MCP-compatible, such as Claude, Cursor, or Windsurf, you can use this to refine your context.

**How does this MCP improve RAG accuracy?**
It adds a layer of deterministic math—like TF-IDF and Jaccard similarity—to your retrieval process, ensuring the context is actually relevant to the user's specific words.

**Can I see why certain documents were excluded from my search?**
Yes, you can use the coverage analysis features to identify exactly which parts of a query were missing from your retrieved documents.

**Is this better than just using vector similarity?**
It's a different tool for a different job. Vector similarity finds things that are 'semantically similar,' while this MCP finds things that are 'mathematically relevant' to the specific terms used.

**How does the scoring work?**
The engine calculates a composite score by combining Jaccard similarity, TF-IDF cosine similarity, and query term coverage using configurable weights.

**Can I customize the weights?**
Yes, you can pass a custom weights object to the `score_documents` tool to prioritize different metrics like keyword overlap or TF-IDF.

**How do I diagnose why a document was filtered out?**
You can use the `analyze_coverage_gap` tool to identify which specific terms from your query are missing from the retrieved documents.