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

MCPg - Production-grade PostgreSQL MCP Server

Recommend headline tools

recommend_headline_tools
Read-only

Reviews audit-log usage to recommend headline tools per capability bucket, highlighting newcomers and departures for operator review before updating the curated list.

Instructions

Empirically curate describe_self's per-bucket headline_tools from the audit log. Reads mcpg_audit.events over the last lookback_days (default 7, capped at 90), groups successful calls by capability bucket, and reports the top-top_n (default 6) tools per bucket with newcomers (recommended but not in the hand-curated current list) and departures (currently headlined but not in the recommendation). The output is a REVIEWABLE recommendation, not an auto-applied override — operators decide whether to update mcpg.about.CAPABILITIES. Returns audit_table_present=False with a diagnostic when the audit subsystem is off. Returns an object with audit_table_present, lookback_days, top_n, events_examined, detail, and buckets (list of objects with bucket_id, current, recommended, newcomers, departures, call_counts).

Example: recommend_headline_tools(lookback_days=14, top_n=6)

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_headline_tools"
  }
}

Input Schema

NameRequiredDescriptionDefault
top_nNo
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.
lookback_daysNo

Output Schema

NameRequiredDescriptionDefault

No arguments

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.6/5.0
Behavior5/5

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

Goes well beyond the readOnlyHint/openWorldHint annotations: names the source table, the default and hard cap on the lookback window (7, capped at 90), the non-mutating 'recommendation, not override' behavior, and the degraded `audit_table_present=False` path when the audit subsystem is disabled. That is exactly the failure-mode disclosure an agent needs.

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 core action and scope, and the constraint/behavior sentences follow logically. The sentence enumerating returned fields (`audit_table_present`, `lookback_days`, ...) partially duplicates the existing output schema and is the one part that does not fully earn its space.

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 an output schema, non-trivial annotations, and a niche cross-cutting purpose, the description covers source of truth, aggregation logic, defaults, caps, degraded behavior, and the review workflow. An agent could decide correctly whether to call this and with what arguments from the description alone.

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 33% — `top_n` and `lookback_days` carry no schema descriptions — but the description compensates by giving defaults and the 90-day cap for `lookback_days` and by defining `top_n` as tools per bucket (default 6). The `database` parameter is already documented in the schema as targeting a configured read-only secondary, so remaining ambiguity is minimal.

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: curate `describe_self`'s per-bucket `headline_tools` from the audit log, derived from successful calls in `mcpg_audit.events`. It is clearly distinguishable from siblings like `describe_self` (which serves the list) and `list_audit_events` (which reads raw events) without opening any schema.

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?

Explains the operating context well: reads the last `lookback_days`, produces a reviewable recommendation rather than an applied override, and states who decides (operators updating `mcpg.about.CAPABILITIES`). It does not explicitly name which sibling to use instead when the audit subsystem is off or when the operator just wants raw events, so usage routing is clear but not fully exclusive.

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