Skip to main content
Glama

Rerank search results

rank_texts
Read-only

Score and sort up to 50 passages or search results by how well they answer a query, boosting RAG and search relevance.

Instructions

Score and sort up to 50 passages, documents or search results by how well they answer a query (BGE reranker). Drop-in quality boost for RAG and search pipelines. Costs $0.002 per call.

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": {
      "query": "<query>",
      "documents": "<documents>"
    },
    "name": "rank_texts"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYesThe question or search query.
top_kNoReturn only the best N. Default: all.
documentsYesPassages to rank.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, and the description is consistent with a pure read operation. It adds useful context beyond annotations — the 50-item cap, the BGE reranker backend, and a concrete cost of $0.002 per call — but says nothing about the shape of the result (whether per-document scores are returned or only an ordered list), which matters for pipeline wiring.

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?

Three short sentences with the core action front-loaded, followed by use-case framing and cost. No filler or repetition of the 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 a simple three-parameter, read-only tool, the definition covers capability, scale limit, backend model, and price. The one residual gap is the return value, which — with no output schema present — the description could have sketched.

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 description coverage is 100%, so query, documents, and top_k are already documented. The description only reinforces the 50-item ceiling ('up to 50 passages') and adds no syntax or format detail beyond the schema, so the baseline of 3 applies.

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?

States a specific verb and resource — 'Score and sort ... passages, documents or search results by how well they answer a query' — plus the underlying model (BGE reranker). This clearly distinguishes it from the sibling *_search tools: it reranks supplied text rather than retrieving it.

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?

'Drop-in quality boost for RAG and search pipelines' gives a clear usage context, and the 'up to 50 passages' limit signals the intended scale. It stops short of explicit when-to-use/when-not guidance or naming an alternative (e.g., use *_search to retrieve, then this to rerank), so it is clear context rather than full routing.

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