Skip to main content
Glama

search

Rank candidate documents by relevance to a query, returning the top matches sorted by similarity score. Provides stateless semantic search over a set of documents.

Instructions

Rank documents by relevance to a query (stateless semantic search).

Args: query: The search query. documents: Candidate documents to rank. top_k: Return only the top K results (default: all). dim: Matryoshka truncation dimension; one of 512, 256, 128, 64, 32.

Returns a dict with results sorted by score (descending).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dimNo
queryYes
top_kNo
documentsYes
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses that the tool is stateless (no side effects) and returns a dict sorted by score descending. It lacks details on edge cases or error behavior, but the core behavioral traits are clear.

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 and well-structured. The first sentence states the purpose, and the Args list efficiently documents parameters without unnecessary fluff.

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?

The description covers the main behavior, return format, and all parameters. It could benefit from explicit guidance on when to use it over index_query, but it is sufficiently complete for a simple stateless search tool.

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

Parameters5/5

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

The input schema has 0% description coverage, but the description fully compensates by explaining each parameter: query, documents, top_k (default all), and dim (with specific allowed values). This adds significant meaning beyond the raw 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 states the tool's function: 'Rank documents by relevance to a query' and defines it as 'stateless semantic search', which distinguishes it from index-based siblings like index_query. The verb 'rank' and resource 'documents' are specific.

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 term 'stateless' implies usage without an index, providing clear context for when to use this tool versus index_query. However, it does not explicitly name alternatives or state when not to use the tool.

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/Rikka-Botan/Fast-Embedding-MCP-SSE'

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