Skip to main content
Glama
redis-mcp

redis-mcp

by YawLabs

redis_get

Read-onlyIdempotent

Read a Redis key's value with type-aware formatting, returning strings, hashes, lists, sets, sorted sets, or streams correctly while limiting large collection reads to avoid context overflow.

Instructions

Read a key's value, dispatching by type so you get the right shape without knowing the type in advance: string -> the value (byte-windowed at REDIS_MAX_VALUE_BYTES, default 256 KiB, with truncated + full length when capped); hash -> field/value object; list -> array (LRANGE windowed by limit); set -> member array; zset -> [member, score] pairs (ZRANGE WITHSCORES, windowed); stream -> recent entries (XREVRANGE, windowed). Collection reads are capped at limit (default REDIS_MAX_KEYS) so a million-element list can't blow out context. The size and truncated fields come before the payload, so a host that caps tool results below REDIS_MAX_VALUE_BYTES (Yaw MCP: 100,000 bytes by default) cuts payload, not them. Always read-only.

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": {
      "key": "<key>"
    },
    "name": "redis_get"
  }
}

Input Schema

NameRequiredDescriptionDefault
keyYesThe key to read.
limitNoMax elements to return for collection types (default REDIS_MAX_KEYS=1000).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.3

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive), yet the description adds substantial behavior: byte-windowing of string values at REDIS_MAX_VALUE_BYTES with `truncated` + `length`, per-type command semantics (LRANGE, ZRANGE WITHSCORES, XREVRANGE), and collection caps at `limit`. It even explains result ordering so metadata survives host-side truncation — genuinely useful operational context not present in annotations.

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 purpose and then a compact per-type enumeration; nearly every clause carries information. It is dense — a long single sentence with parentheticals and env-var references — but nothing is filler, so the length is justified by the return-shape variety.

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?

There is no output schema, so the description must carry return-value documentation, and it does so exhaustively for all five Redis types plus truncation metadata and field ordering. Combined with the cap/window behavior, an agent can anticipate the shape and size of every response before calling.

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 100%, so the baseline is 3, but the description goes further: it explains that `limit` windows collection reads per type and states the effective default (REDIS_MAX_KEYS), which the schema also carries. It omits any mention of `key` beyond the obvious, which is fine given the schema documents it.

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 concrete verb and resource ("Read a key's value") and immediately qualifies it with semantic nuance: type dispatch producing type-specific shapes. That framing alone separates it from redis_command (raw command execution) and redis_scan (key enumeration), so an agent knows this is the type-aware value read without opening the schema.

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 implied by the description — use this to read a key's value, and it is always read-only. There is no explicit when-not or named alternative (e.g. use redis_key_info for metadata, redis_command for writes or unsupported commands), so the routing decision to siblings is left to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.