Skip to main content
Glama
devopam

MCPg - Production-grade PostgreSQL MCP Server

TurboQuant approx candidates

turboquant_approx_candidates
Read-only

Retrieves approximate k-nearest neighbor candidates using a turboquant index. Returns candidate ID, distance, and rank without exact reranking.

Instructions

Run tq_approx_candidates against a turboquant index — approximate k-NN retrieval, no exact rerank. metric is 'cosine' | 'inner_product' | 'l2' (mapped to upstream's runtime metric text). half_precision=True switches to the halfvec overload. probes / oversample_factor are optional per-query knobs (consider calling recommend_turboquant_query_knobs first). Requires the pg_turboquant extension. Returns a list of candidate objects with candidate_id, approximate_distance, and approximate_rank.

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
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?

Beyond the readOnlyHint annotation, the description reveals key behaviors: no exact rerank, half_precision toggle, optional knobs (probes/oversample_factor), and the format of returned candidates. This adds useful context that the annotations alone do not provide.

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 three well-structured sentences. The first sentence delivers the core purpose and constraint, the second explains key parameters, and the third covers prerequisites and return type. No redundant information.

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?

Given the tool's complexity (11 parameters, 7 required) and low schema coverage, the description partially compensates by explaining metric, half_precision, and optional knobs. However, it omits details on query_vector format, candidate_limit, and the meaning of table/schema/id_column/embedding_column. The return type is described, but the output schema is not fully leveraged.

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?

With only 9% schema description coverage, the description adds semantic value for metric (enumerates valid values), half_precision (switch to halfvec), and optional knobs. However, many parameters like schema, table, id_column, embedding_column, query_vector, and candidate_limit lack added meaning beyond the schema's minimal descriptions.

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 verb 'Run tq_approx_candidates' and the resource 'turboquant index', specifying it performs approximate k-NN retrieval with no exact rerank. It distinguishes from sibling tools like turboquant_rerank_candidates by noting the absence of reranking.

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 advises when to use this tool (approximate retrieval) and suggests using recommend_turboquant_query_knobs first for knob tuning. It also mentions the prerequisite pg_turboquant extension. However, it does not explicitly state when not to use this tool or contrast with alternatives like vector_search.

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