Skip to main content
Glama
devopam

MCPg - Production-grade PostgreSQL MCP Server

TurboQuant rerank candidates

turboquant_rerank_candidates
Read-only

Retrieve approximate candidates from a turboquant index, then rerank exactly via SQL to a final limit, returning both approximate and exact ranks or distances.

Instructions

Run tq_rerank_candidates against a turboquant index — approximate retrieval followed by SQL-side exact rerank to final_limit results. Returns the candidates with both approximate and exact ranks / distances. half_precision=True switches to the halfvec overload. Requires the pg_turboquant extension.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tableYes
metricYes
probesNo
schemaYes
databaseNoOptional: target a configured secondary (read-only) database by name; omit for the primary. Call list_databases to see the configured ids.
id_columnYes
final_limitYes
query_vectorYes
half_precisionNo
candidate_limitYes
embedding_columnYes
oversample_factorNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Annotations already indicate readOnlyHint=true, and the description adds behavioral context by explaining the two-step process (approximate retrieval then exact rerank) and the effect of half_precision. No contradiction with annotations.

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 concise sentences that front-load the main purpose and then add key details (half_precision, extension requirement). No unnecessary words.

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?

With an output schema present and annotations, the description covers the core workflow and a key parameter. It lacks discussion of defaults or edge cases but is generally sufficient for a well-documented tool.

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?

Schema coverage is only 8%, with only the database parameter described. The description adds meaning only for half_precision, leaving most parameters (e.g., query_vector, metric, limits) without additional context beyond the 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 performs approximate retrieval followed by exact rerank, specifying the process and output. It distinguishes from related siblings like turboquant_approx_candidates by explicitly mentioning the rerank step.

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 mentions the requirement for the pg_turboquant extension and the half_precision parameter behavior, but does not explicitly state when to use this tool versus alternatives like turboquant_approx_candidates or other rerank analysis tools.

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/devopam/MCPg'

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