Skip to main content
Glama
devopam

MCPg - Production-grade PostgreSQL MCP Server

Recommend Redis cache targets

recommend_redis_cache_targets
Read-only

Identifies read-heavy, low-write database tables suitable for Redis caching by analyzing pg_stat_user_tables statistics. Returns recommended tables with SQL stubs for creating foreign tables.

Instructions

Recommend tables that would benefit from a Redis cache layer. Inspects pg_stat_user_tables for read-heavy, low-write relations whose working set fits comfortably in Redis (default: read/write ratio ≥ 10, ≥ 1000 reads, ≤ 1M rows). When server is provided the generated ready_to_run_sql stub targets that server name; otherwise the stub uses a placeholder operators must substitute. Advisor is read-only — never touches Redis itself. Returns an object with server and candidates — a list of objects with schema, table, reads, writes, read_write_ratio, estimated_row_count, reason (read_only_lookup_table / small_hot_relation / read_heavy_low_write / moderate_read_dominant), and ready_to_run_sql (a CREATE FOREIGN TABLE stub).

Example: recommend_redis_cache_targets(server='redis_primary', limit=10)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
serverNo
databaseNoOptional: target a configured secondary (read-only) database by name; omit for the primary. Call list_databases to see the configured ids.
max_rowsNo
min_reads_per_dayNo
min_read_write_ratioNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
serverYes
candidatesYes
Behavior5/5

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

The description explicitly states 'Advisor is read-only — never touches Redis itself,' which aligns with the readOnlyHint annotation. It also details the internal logic (inspects pg_stat_user_tables) and output structure, providing full transparency.

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 well-structured and concise: it starts with the purpose, explains the algorithm, server behavior, safety, output format, and includes an example. Every sentence adds value without redundancy.

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 the six parameters and present output schema, the description adequately covers the core logic, criteria, output fields, and safety. The output schema is described in detail, and the example provides concrete usage. No critical gaps remain.

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?

The description adds meaning to parameters by explaining default thresholds (read/write ratio ≥10, ≥1000 reads, ≤1M rows) and the server's role in the output SQL stub. However, it does not describe the limit or max_rows parameters beyond defaults, and the schema coverage is low (17%).

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 the tool's purpose: recommending tables for Redis caching. It specifies the resource (tables) and action (recommend), and outlines the criteria (read/write ratio, reads, row count). This distinguishes it from other recommendation tools.

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?

The description explains when to use the tool (to identify caching candidates) and provides an example with a server parameter. It also notes that the advisor is read-only. However, it does not explicitly contrast with alternatives like describe_redis_cache_table or list_redis_foreign_servers.

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