Skip to main content
Glama

Rank Documents By Embedding

rank_documents_by_embedding

Embed a query and candidate documents, then rank documents by cosine similarity. Use for semantic matching, retrieval checks, clustering triage, and lightweight RAG over user-provided passages.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
top_kYes
documentsYes

TDQS

A3.8/5.0
Behavior3/5

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

Without annotations, the description carries the full burden. It discloses the algorithmic behavior (embedding and cosine similarity) and intended usage, but omits any description of the return value or error behavior. Since the tool ranks documents, users might need to know whether the output includes scores or just the order.

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 two sentences: first explains the mechanism, second lists use cases. It is front-loaded and every word adds value with no fluff.

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

Completeness3/5

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

The tool has no output schema and no annotations, so the description should clarify what the tool returns. While 'rank documents' implies an ordered list, the description does not specify whether it returns the documents, indices, or similarity scores. Combined with the missing top_k semantics, the description is adequate but incomplete for a fully self-contained specification.

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

Parameters2/5

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

The description mentions 'a query and candidate documents' which maps to the query and documents parameters, but it does not explain what top_k does. With no schema descriptions, this leaves one of the three required parameters semantically unexplained. The description partially compensates but is incomplete.

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 states the tool embeds a query and candidate documents, then ranks by cosine similarity, using a specific verb and resource. It also lists concrete use cases (semantic matching, retrieval checks, clustering triage, lightweight RAG), which distinguishes it from sibling tools like rerank_documents, which likely uses a different ranking method.

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 description explicitly says 'Use for' and lists four use cases, providing clear context for when the tool is appropriate. It does not name alternatives or specify when not to use this tool, but the use-case framing gives sufficient guidance for selection.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

TDQS

B3.2/5.0
Disambiguation2/5

Several tools have overlapping responsibilities: search, search_claims, search_preprint_flags, and claidex_claim_risk_matrix all query claim/failure data, while rank_documents_by_embedding and rerank_documents both perform relevance ranking. The compatibility-oriented fetch/search tools add further confusion because their names collide with fetch_research_url and search_claims.

Naming Consistency3/5

Names are grouped by prefixes (claidex_, query_, search_, run_) but the groups use different conventions, and bare verbs like 'fetch' and 'search' sit alongside prefixed forms like 'fetch_research_url' and 'search_claims'. The pattern is readable but not uniform.

Tool Count3/5

24 tools is at the heavy end for an MCP server; while the breadth reflects many biomedical data sources and utilities, the count includes several meta/compatibility tools that could be consolidated. It is borderline but not unreasonable.

Completeness4/5

The surface covers the core biomedical workflows: searching claims, retrieving full claim content, querying failure graphs, checking preprints, and looking up drugs/trials/targets/adverse events. Minor gaps exist, such as no direct way to fetch a single clinical trial by ID beyond the search function, and no write/update operations for claims, but these are likely outside the read-only research scope.

Resources