MCP Server for Maximal Marginal Relevance (MMR) Diversity-Aware Vector Reranking. Implements Carbonell & Goldstein MMR algorithm to balance relevant context retrieval while eliminating repetitive passages.
Single tool 'rerank_mmr' has a well-written description (168 chars, within 10-1024 range) explaining the MMR algorithm and its purpose. Input schema is present with three parameters: query_vec (array), candidates (array), and top_k (integer with default=3). However, critical gaps prevent higher scoring: (1) Tool name does not start with a clear action verb, 'rerank_mmr' is somewhat ambiguous vs. 'rerank_candidates_by_mmr' or 'select_diverse_candidates'; (2) Parameter descriptions are minimal (e.g., 'Query vector as list of floats' lacks format/constraint details); (3) Output schema is not documented, the code returns [{'id': str, 'mmr_score': float}] but this is inferred from implementation, not declared in the tool definition; (4) No error handling guidance (what if candidates is empty? what if vectors have mismatched dimensions?); (5) No input validation rules stated (e.g., vector dimension consistency, top_k bounds). The implementation itself is sound (cosine similarity, MMR scoring), but the tool definition lacks production-grade rigor.
Reranks candidates using Maximal Marginal Relevance (MMR) algorithm. Score(d) = lambda * Sim(d, query) - (1 - lambda) * max_{s in selected} Sim(d, s). Balances relevant context retrieval while eliminating repetitive passages.
Output schema not documented. Code returns [{'id': str, 'mmr_score': float}] but this structure is inferred from implementation, not declared in tool definition. LLMs cannot plan downstream calls without knowing return fields.
Parameter descriptions lack actionable constraints. 'Query vector as list of floats' does not specify vector dimension, range, or normalization requirements. 'List of candidate objects' does not validate structure or required fields per candidate.
No error handling guidance. Tool does not document what happens if candidates is empty, vectors have mismatched dimensions, or top_k exceeds candidate count. LLM has no recovery path.
Tool name 'rerank_mmr' is somewhat ambiguous. Clearer names like 'rerank_candidates_by_mmr' or 'select_diverse_candidates' would better signal intent to LLMs. Current name requires reading description to understand purpose.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | F | 42 | 2026-07-28+ | v2 |
No input validation rules stated. Missing bounds for top_k (should be 1 - len(candidates)), vector dimension consistency check, and handling of zero-norm vectors (code returns 0.0 but this edge case is not documented).