Skip to main content
Glama
devopam

MCPg - Production-grade PostgreSQL MCP Server

Analyze HNSW recall

analyze_hnsw_recall
Read-only

Sweeps ef_search values to measure latency and recall trade-off for a pgvector query against exact brute-force ground truth.

Instructions

Sweeps ef_search values to measure the latency and recall trade-off curve for a given pgvector query vector against exact brute-force ground truth. Requires the vector extension. Returns a list of objects with ef_search, recall_at_k, mean_latency_ms, and p95_latency_ms — one row per ef_search value tested.

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.
query_vectorYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false. The description adds value by explaining that the tool performs a sweep of ef_search values, compares against exact brute-force, and returns latency and recall metrics. It does not contradict annotations and provides useful behavioral context, though it omits potential performance impact warnings.

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 extremely concise: two sentences that front-load the action and purpose, then detail the output format. No wasted words; each sentence earns its keep.

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?

Given the tool's complexity (sweeping ef_search, computing trade-off) and the presence of an output schema, the description is nearly complete. It explains what, why, and what is returned, but does not specify how ef_search values are chosen (e.g., range, defaults) or warn about potential long execution time.

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?

Schema coverage is low (14%), so the description should compensate. While it provides overall context (e.g., query_vector is the query vector, k for recall@k), it does not explicitly describe each parameter beyond the database parameter's schema description. The description helps interpret parameters but lacks detailed mapping.

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 that the tool sweeps ef_search values to measure the latency-recall trade-off for a pgvector query vector against exact brute-force ground truth. It uses a specific verb ('sweeps') and identifies the resource (pgvector query vector), distinguishing it from sibling tools like analyze_vector_search_efficiency or vector_recall_at_k.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies the tool is for tuning recall vs. latency and mentions a prerequisite (requires vector extension), but it does not explicitly guide when to use this tool versus alternatives among the many analyzer siblings. It lacks 'when to use' and 'when not to use' guidance.

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