Skip to main content
Glama
MCPg - Production-grade PostgreSQL MCP Server

MCPg - Production-grade PostgreSQL MCP Server

Recommend TurboQuant query knobs

recommend_turboquant_query_knobs
Read-only

Recommends per-query tuning knobs for TurboQuant candidate generation and reranking, with generic or index-aware advice based on catalog state and optional filter selectivity.

Instructions

Run tq_recommended_query_knobs — per-query knob advisor. Two modes: plain (just candidate_limit + optional final_limit) gives generic recommendations; index-aware (supply both index_schema and index_name, plus optional filter_selectivity) specialises the recommendations to the named index's catalog state. Returns probes, oversample_factor, max_visited_codes, max_visited_pages — pass these to turboquant_approx_candidates / turboquant_rerank_candidates. Requires pg_turboquant.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "candidate_limit": "<candidate_limit>"
    },
    "name": "recommend_turboquant_query_knobs"
  }
}

Input Schema

NameRequiredDescriptionDefault
databaseNoOptional: a database id from list_databases, to target a configured secondary (read-only) database; omit for the primary. Database names that are not configured ids are rejected.
index_nameNo
final_limitNo
index_schemaNo
candidate_limitYes
filter_selectivityNo

Output Schema

NameRequiredDescriptionDefault
probesYes
max_visited_codesYes
max_visited_pagesYes
oversample_factorYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.8.4
    • changedInput schema / properties / database / description
      Previous value: -"Optional: target a configured secondary (read-only) database by name; omit for the primary. Call list_databases to see the configured ids."New value: +"Optional: a database id from list_databases, to target a configured secondary (read-only) database; omit for the primary. Database names that are not configured ids are rejected."
  2. First observedv0.6.8

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so safety is covered; the description adds a genuine prerequisite ("Requires pg_turboquant") and enumerates the concrete output knobs plus their intended destination tools, which is behavior beyond the annotations. No discussion of cost, latency, or what happens if the index has no catalog state, which is the main remaining gap.

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?

Front-loaded with the function name and role, then mode rules, then return fields, then the prerequisite. Dense but every clause carries information. Minor deduction for reStructuredText double-backtick markup that adds noise rather than clarity for an agent reader.

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?

An output schema exists, so enumerating return fields is a bonus for chaining rather than a necessity. With six parameters, one required, and a prerequisite extension, the description covers everything an agent needs to construct a correct call. Only the optional database/secondary targeting path is not mentioned in prose.

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?

Schema coverage is only 17%, so the description must carry the load, and it largely does: it defines the mode-dependency between index_schema/index_name (must be supplied together), frames final_limit and filter_selectivity as optional modifiers, and explains that filter_selectivity specializes the recommendation. Only the database parameter goes undiscussed in the description text (though its schema field is documented) and the candidate_limit/final_limit relationship is unspecified.

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?

States a specific verb and resource (per-query knob advisor wrapping tq_recommended_query_knobs) and immediately scopes it against the sibling families that recommend different knobs (hnsw ef_search, ivfflat probes, turboquant maintenance) by making clear this is per-query, not per-index-maintenance. It also names its downstream consumers, so an agent knows exactly where the output flows.

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?

Explicitly documents two modes and the exact parameter conditions that select each: plain mode takes candidate_limit + optional final_limit, index-aware mode requires BOTH index_schema and index_name. That is strong when-to-use guidance. It stops short of stating when to skip this tool entirely (e.g., prefer a static default when no index is known) or how it relates to recommend_ivfflat_probes-style siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools