Skip to main content
Glama
YawLabs

redis-mcp

by YawLabs

redis_scan

Read-onlyIdempotent

Scan Redis keys safely using cursor-based SCAN, filtering by glob pattern and value type, with pagination support.

Instructions

Enumerate keys with cursor-based SCAN -- NEVER the O(N) KEYS command, so this is safe to run against a production instance with millions of keys (SCAN yields the event loop between batches). Returns up to REDIS_MAX_KEYS keys (default 1000) matching an optional glob match pattern (e.g. user:*, session:??). When more keys remain, truncated is true and cursor is non-'0' -- pass that cursor back to continue from where you left off. Optionally filter by value type (string/list/set/zset/hash/stream). Within one call duplicate keys are removed; across a resumed scan a key may reappear (SCAN's guarantee is no key present for the whole scan is missed, not that none repeats).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeNoFilter to keys of this value type (uses SCAN's TYPE option).
countNoCOUNT hint per SCAN iteration (default REDIS_SCAN_COUNT=100). Higher = fewer round-trips, but very high values increase per-iteration event-loop hold time on large keyspaces -- the small-batch yield is this module's core safety property for production instances.
matchNoGlob pattern to match keys (e.g. `user:*`). Omit to scan all keys.
cursorNoSCAN cursor to resume from. Start (and default) is '0'.0
Behavior5/5

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

Beyond the annotations (readOnly, idempotent, etc.), the description reveals critical behaviors: SCAN yields event loop between batches, duplicate removal within a call, possible reappearance across resumed scans, default max keys, and the truncated flag. This fully informs the agent of the tool's safety and pagination model.

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 description is a single paragraph but well-organized: starts with the primary purpose, then details pagination, pattern, and type filtering. Every sentence adds value, though a slightly more structured format (e.g., bullet points) could improve scannability.

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 tool's complexity (cursor-based iteration, safety guarantees, multiple optional parameters) and the absence of an output schema, the description is remarkably complete. It explains return fields (truncated, cursor), pagination semantics, and production safety, leaving no critical gaps for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

All 4 parameters are fully documented in the schema (100% coverage), but the description adds substantial value: explains cursor-based pagination, default count and its safety implications, pattern matching syntax, and the type filter enum. This goes beyond the schema's basic descriptions.

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 it enumerates keys with cursor-based SCAN, explicitly contrasting with the O(N) KEYS command and highlighting safety for production. This distinguishes it from sibling tools like redis_get or redis_key_info.

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 provides clear usage context: use for safe key enumeration, especially on production with many keys. It explains how to resume scans with cursor and mentions optional pattern/type filtering. While not explicitly listing when not to use it, the sibling tools are sufficiently different.

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/YawLabs/redis-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server