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

MCPg - Production-grade PostgreSQL MCP Server

Recommend rerank strategy

recommend_rerank_strategy
Read-only

Analyze rerank event metrics over a selected window and return a summary plus actionable findings to guide RAG reranker strategy.

Instructions

Roll-up advisor over the four analytics for one window. Returns a single headline summary + the full list of findings. Built from whichever combination of reranker_idle / topk_stable / score_clustering / rerank_hurts_ndcg / rerank_lifts_ndcg fires. Also feeds the RAG Reranker Pipeline category in audit_database. Reads from mcpg_rag.rerank_events.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "recommend_rerank_strategy"
  }
}

Input Schema

NameRequiredDescriptionDefault
daysNo
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.
retrieval_indexNo

Output Schema

NameRequiredDescriptionDefault
summaryYes
findingsYes
window_daysYes
retrieval_indexYes

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

A3.6/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 the safety profile is covered. The description adds real behavioral context beyond that: it names the backing table (mcpg_rag.rerank_events) and discloses a side effect outside the tool itself — that its output feeds the 'RAG Reranker Pipeline' category in audit_database. It does not mention cost, latency, or minimum data requirements for findings to fire.

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 intent and return shape are front-loaded in the first sentence, and the remaining sentences add source and integration detail without filler. The middle enumeration of five backticked finding keys is dense but informative rather than redundant. Slightly tighter phrasing would improve scanability.

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?

An output schema exists, so the return shape needn't be spelled out, and the description still communicates the headline-plus-findings structure and data source. The main gap is parameter coverage: two of three inputs have no explanation anywhere, and no guidance distinguishes this roll-up from the four sibling analysis tools. Adequate, but not complete for a multi-signal advisor.

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?

Only the 'database' parameter is documented in the schema, leaving 'days' and 'retrieval_index' undescribed at 33% coverage. The description's phrase 'for one window' gives a weak hint that 'days' defines the analysis window, but it says nothing about what 'retrieval_index' scopes or how findings are filtered by it. With coverage this low, the description should compensate more than it does.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a specific verb and resource: a 'roll-up advisor over the four analytics for one window' that returns a headline summary plus findings. It enumerates the exact finding keys (reranker_idle, topk_stable, score_clustering, rerank_hurts_ndcg, rerank_lifts_ndcg), so the agent knows the output vocabulary. It stops short of naming the sibling analyze_* tools it aggregates, so the boundary is implied rather than stated.

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?

Usage is only implied by the phrase 'roll-up advisor over the four analytics,' which suggests this is the aggregate entry point rather than a single-metric analysis. There is no explicit instruction such as 'use this instead of analyze_reranker_lift when you want all reranker signals at once,' and no stated prerequisites for the call. An agent can infer the intent, but must make the choice unaided.

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