Skip to main content
Glama
devopam

MCPg - Production-grade PostgreSQL MCP Server

Recommend IVFFlat probes

recommend_ivfflat_probes
Read-only

Recommends the smallest ivfflat.probes value that meets a target recall@k by sampling queries, measuring recall and latency across probe values, and verifying an IVFFlat index exists.

Instructions

Recommend an ivfflat.probes value for a target recall@k — the IVFFlat analogue of recommend_hnsw_ef_search. Samples sample_queries rows (default 10) as query vectors, builds an exact brute-force top-k ground truth per query, sweeps probe_values (default 1/2/5/10/20/50) measuring mean recall@k and p50/p95 latency at each, and recommends the smallest value clearing target_recall (default 0.95). VERIFIES an IVFFlat index actually exists on the column (returns has_ivfflat_index=false with guidance otherwise — a sweep without one just measures sequential scans). The query row is excluded from its own results. Requires the vector extension. Returns an object with available, has_ivfflat_index, index_name, metric, k, target_recall, sample_queries, recommended_probes (int or null), detail, and sweep (list of objects with probes, mean_recall_at_k, p50_latency_ms, p95_latency_ms, meets_target).

Example: recommend_ivfflat_probes(schema='public', table='docs', column='embedding', k=10, target_recall=0.95)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kNo
tableYes
columnYes
metricNol2
schemaYes
databaseNoOptional: target a configured secondary (read-only) database by name; omit for the primary. Call list_databases to see the configured ids.
target_recallNo
sample_queriesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
kYes
sweepYes
detailNo
metricYes
availableYes
index_nameYes
target_recallYes
sample_queriesYes
has_ivfflat_indexYes
recommended_probesYes
Behavior5/5

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

The description details internal behavior: sampling queries, building ground truth, sweeping probes, measuring recall and latency, and verifying index existence. It aligns with readOnlyHint=true, adding context beyond annotations. No contradictions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with front-loaded purpose, detailed algorithm, and an example. It is informative without excessive verbosity, though slightly longer than minimal.

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?

Given the output schema existence and the tool's complexity, the description fully covers algorithm, validation, return fields (including sweep details), and requirements. It integrates well with sibling tools.

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?

Despite low schema description coverage (13%), the description explains key parameters (k, target_recall, sample_queries) and their defaults. It clarifies the algorithm's approach, compensating for the schema's lack of context.

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 recommends an ivfflat.probes value for target recall@k, explicitly distinguishing itself as the IVFFlat analogue of recommend_hnsw_ef_search. Verb 'recommend' and resource 'IVFFlat probes' are specific and unambiguous.

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 explains the sampling, sweeping, and recommendation process, including validation for index existence. It provides an example and mentions requirements (vector extension). However, it does not explicitly exclude scenarios where it should not be used, though the analogue reference helps.

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