Skip to main content
Glama
q6066697

rag-mcp-server

by q6066697

rerank_results

Reorders a list of candidate documents by relevance to a given query using a cross-encoder model.

Instructions

Переранжирует переданный список документов-кандидатов относительно query с помощью cross-encoder модели, которая читает пару (query, документ) вместе — точнее, чем независимое векторное сходство, но дороже по compute, поэтому применяется к уже отфильтрованному шортлисту, а не ко всему корпусу.

Используй этот инструмент, когда уже есть список кандидатов (например, из search_documents() или собранный вручную из нескольких запросов) и нужно уточнить их порядок релевантности перед тем, как процитировать top-N пользователю. Для поиска по всему корпусу используй search_documents() — этот инструмент только переупорядочивает уже известные doc_id и не находит новые документы.

Args: query: Запрос, относительно которого переранжируются документы. doc_ids: Список doc_id кандидатов (см. search_documents/ get_document). Неизвестные doc_id молча пропускаются.

Returns: Список [{"doc_id": str, "title": str, "snippet": str, "score": float}, ...], отсортированный по убыванию cross-encoder score. score здесь — необязательно вероятность и несравним по шкале со score из search_documents() (RRF-скор).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
doc_idsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

No annotations are provided, so the description carries the burden. It discloses that unknown doc_ids are silently skipped and that scores are not comparable to search_documents scores, which is helpful. However, it doesn't detail side effects (none expected) or performance implications beyond general compute cost, which is mentioned.

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?

The description is concise but thorough, with front-loaded purpose, clear usage guidance, parameter details, and return format. Every sentence adds value without redundancy, despite being longer than ideal, it remains structured and readable.

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

Completeness5/5

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

The description is complete for a tool with two simple params, no annotations, and a clear output schema. It explains the return format and score semantics, covers edge cases (unknown ids), and contextualizes the tool's role in the workflow, making it self-sufficient.

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

Parameters4/5

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

Schema description coverage is 0%, but the description provides meaningful semantics for both parameters: query is the reference for re-ranking, doc_ids is the candidate list and indicates unknown ids are skipped. This adds value beyond the minimal schema.

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?

The description clearly specifies the tool re-ranks a provided candidate list relative to a query using a cross-encoder, distinguishing it from direct similarity search. It explicitly states it does not find new documents, differentiating it from sibling tools like search_documents and get_document.

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

Usage Guidelines5/5

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

Provides explicit when-to-use (when a candidate list already exists) and when-not-to-use (for corpus-wide search, use search_documents). Mentions alternatives and gives a specific scenario (before quoting top-N to the user), making usage guidance clear.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/q6066697/rag-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server