Skip to main content
Glama
devopam

MCPg - Production-grade PostgreSQL MCP Server

Analyze rerank score distribution

analyze_rerank_score_distribution
Read-only

Analyze histogram distribution of cross_encoder scores from rerank events; detect score clustering when top-decile share exceeds half, indicating reranker not discriminating.

Instructions

Equal-width histogram of cross_encoder_score values over the window plus the top-decile share. Surfaces score_clustering (WARNING) when the reranker isn't discriminating (more than half of scores land in the top decile of the range). Reads from mcpg_rag.rerank_events. Returns an object with window_days, event_count, histogram (list of counts), bucket_edges (list of bucket boundaries), top_decile_share, and findings (list of advisory findings).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
daysNo
modelNo
databaseNoOptional: target a configured secondary (read-only) database by name; omit for the primary. Call list_databases to see the configured ids.
n_bucketsNo
retrieval_indexNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelYes
findingsYes
histogramYes
event_countYes
window_daysYes
bucket_edgesYes
retrieval_indexYes
top_decile_shareYes
Behavior4/5

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

Annotations already declare readOnlyHint=true. The description adds value by specifying the data source (mcpg_rag.rerank_events), the computation details (equal-width histogram, top-decile share), and the advisory finding logic (score_clustering warning). This provides useful behavioral context beyond the annotations.

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 concise (three sentences), front-loads the main action, and each sentence adds essential information. There is no redundancy or unnecessary detail.

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?

Despite five parameters, the description explains the core analysis, the source table, the advisory finding, and the return fields. With an output schema available, the description is complete enough for an agent to understand the tool's behavior and results.

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 description coverage is only 20% (database parameter). The description adds meaning for 'days' (window) and 'n_buckets' (bucket count), but does not explain the 'model' or 'retrieval_index' parameters. It partially compensates for low coverage, but not fully.

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 it produces an equal-width histogram of cross_encoder_score values and calculates the top-decile share, distinguishing it from sibling analysis tools that focus on other metrics (distance, recall, etc.). The verb 'analyze' is specific to this resource.

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 usage for rerank score distribution analysis and flagging score clustering, but provides no explicit guidance on when to choose this tool over the many sibling analysis tools. It does not mention when not to use it or suggest alternatives.

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