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

MCPg - Production-grade PostgreSQL MCP Server

Get Redis cache stats

get_redis_cache_stats
Read-only

Validate a Redis FDW server and return best-effort cache metrics—key count, memory usage, and availability—with a diagnostic when uniform stats are unsupported.

Instructions

Best-effort cache metrics for a redis_fdw server. redis_fdw does not ship a uniform stats SQL surface across versions, so the tool validates that the server exists and otherwise reports available=false with a diagnostic. Operators wanting live metrics should query Redis directly (INFO / DBSIZE). Returns an object with server, available (bool), key_count, used_memory_bytes, and detail (a human-readable note).

Example: get_redis_cache_stats(server='redis_primary')

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": {
      "server": "<server>"
    },
    "name": "get_redis_cache_stats"
  }
}

Input Schema

NameRequiredDescriptionDefault
serverYes
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.

Output Schema

NameRequiredDescriptionDefault
detailYes
serverYes
availableYes
key_countYes
used_memory_bytesYes

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

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

Beyond the readOnlyHint/openWorldHint annotations, the description discloses a critical behavioral trait: the tool is best-effort and may return available=false with a diagnostic because redis_fdw lacks a uniform stats surface. This tells the agent in advance that a false/unavailable result is expected, not an error — exactly the kind of context annotations cannot convey.

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 best-effort caveat and fallback are front-loaded, then the return shape, then an example — a logical order with no padding. Minor redundancy: enumerating return fields overlaps with the existing output schema.

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?

For a two-parameter tool with annotations and an output schema, this covers the degraded-result semantics, the fallback path, and a usage example. Nothing an agent needs to call it correctly or interpret an unavailable result is missing.

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 coverage is only 50%: the `database` param is documented in-schema, but `server` has no description. The description compensates partly with an example call showing server='redis_primary', but it never explains what a server is or how it relates to list_redis_foreign_servers, so the baseline 3 is appropriate.

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 states a specific verb and resource ('Best-effort cache metrics for a redis_fdw server') and immediately scopes it against siblings like list_redis_foreign_servers and describe_redis_cache_table by framing it as a metrics reporter rather than a lister/describer. An agent knows exactly what this retrieves.

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?

It gives a clear use context (validating the server exists, getting available/key_count/memory) and explicitly routes agents wanting live metrics to direct Redis INFO/DBSIZE instead. It stops short of naming specific sibling alternatives by name, but the when-to-use and fallback guidance is explicit.

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