redis_get
Retrieve a Redis key's value, automatically shaping the response by its data type (string, hash, list, set, sorted set, or stream) with configurable limits for collections.
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. Always read-only.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | The key to read. | |
| limit | No | Max elements to return for collection types (default REDIS_MAX_KEYS=1000). |