Skip to main content
Glama
grafeo-mcp

grafeo-mcp

Official
by GrafeoDB

mmr_search

Read-only

Run Maximal Marginal Relevance vector search to fetch diverse results, skip near-duplicates for RAG context, and return matches in selection order.

Instructions

Like vector_search, but diverse: Maximal Marginal Relevance skips near-duplicates (good RAG context).

Results come in selection order.

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": {
      "label": "<label>",
      "property": "<property>"
    },
    "name": "mmr_search"
  }
}

Input Schema

NameRequiredDescriptionDefault
kNoNumber of results.
efNoHNSW search width; higher finds more, slower.
labelYes
fetch_kNoCandidates to choose from (default 4 * k).
propertyYesThe property that holds the embeddings, e.g. "embedding".
lambda_multNo0 = most diverse, 1 = most relevant (default 0.5).
like_node_idNoSearch near this node's stored vector; the node itself is left out.
query_vectorNoThe query embedding (the index's model and size), or use like_node_id.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed26 schema fields changedv0.3.0
    • removedInput schema / properties / ef / anyOf
      Removed value: -[
      -  {
      -    "type": "integer"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / ef / default
      Removed value: -null
    • addedInput schema / properties / ef / description
      Added value: +"HNSW search width; higher finds more, slower."
    • removedInput schema / properties / ef / title
      Removed value: -"Ef"
    • addedInput schema / properties / ef / type
      Added value: +"integer"
    • removedInput schema / properties / fetch_k / anyOf
      Removed value: -[
      -  {
      -    "type": "integer"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / fetch_k / default
      Removed value: -null
    • addedInput schema / properties / fetch_k / description
      Added value: +"Candidates to choose from (default 4 * k)."
    • removedInput schema / properties / fetch_k / title
      Removed value: -"Fetch K"
    • addedInput schema / properties / fetch_k / type
      Added value: +"integer"
    • addedInput schema / properties / k / description
      Added value: +"Number of results."
    • removedInput schema / properties / k / title
      Removed value: -"K"
    • removedInput schema / properties / label / title
      Removed value: -"Label"
    • removedInput schema / properties / lambda_mult / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / lambda_mult / default
      Removed value: -null
    • addedInput schema / properties / lambda_mult / description
      Added value: +"0 = most diverse, 1 = most relevant (default 0.5)."
    • removedInput schema / properties / lambda_mult / title
      Removed value: -"Lambda Mult"
    • addedInput schema / properties / lambda_mult / type
      Added value: +"number"
    • addedInput schema / properties / like_node_id
      Added value: +{
      +  "description": "Search near this node's stored vector; the node itself is left out.",
      +  "type": "integer"
      +}
    • addedInput schema / properties / property / description
      Added value: +"The property that holds the embeddings, e.g. \"embedding\"."
    • removedInput schema / properties / property / title
      Removed value: -"Property"
    • addedInput schema / properties / query_vector / description
      Added value: +"The query embedding (the index's model and size), or use like_node_id."
    • removedInput schema / properties / query_vector / title
      Removed value: -"Query Vector"
    • changedInput schema / required
      Previous value: -[
      -  "label",
      -  "property",
      -  "query_vector"
      -]New value: +[
      +  "label",
      +  "property"
      +]
    • removedInput schema / title
      Removed value: -"mmr_searchArguments"
    • changedOutput schema / (root)
      Previous value: -{
      -  "properties": {
      -    "result": {
      -      "title": "Result",
      -      "type": "string"
      -    }
      -  },
      -  "required": [
      -    "result"
      -  ],
      -  "title": "mmr_searchOutput",
      -  "type": "object"
      -}New value: +null
  2. First observedv0.2.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnlyHint=true, openWorldHint=false), so the description's real contribution is the deduplication behavior and the ordering contract — 'results come in selection order' rather than by score, which materially affects how an agent consumes output. It does not discuss cost, ef/fetch_k tradeoffs, or failure when neither query_vector nor like_node_id is supplied.

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?

Two short sentences with zero filler; the differentiator is front-loaded and the ordering caveat is placed last where it is most actionable. Nothing is redundant with the title or schema.

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?

For an 8-parameter search tool with no output schema, the description covers purpose, diversity semantics, and result ordering, which is most of what an agent needs. Remaining gaps are small: the undescribed 'label' parameter and how query_vector vs like_node_id precedence works.

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 88%, so the schema already documents k, ef, fetch_k, property, lambda_mult, like_node_id, and query_vector. The description explains the MMR concept that makes lambda_mult meaningful but adds no parameter-level detail, and the one undocumented parameter (label) is not clarified either. Baseline 3 is appropriate.

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?

Names the mechanism (Maximal Marginal Relevance), states the distinguishing behavior ('skips near-duplicates'), and explicitly contrasts with the sibling vector_search. An agent can tell immediately how this differs from vector_search without opening either schema.

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 phrase 'good RAG context' gives a concrete use case, and 'like vector_search, but diverse' implies the selection condition (use when redundancy in top results is a problem). It stops short of explicit when-not guidance or naming other retrieval alternatives besides vector_search.

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