Skip to main content
Glama
redis

Redis MCP Server

Official
by redis

scan_all_keys

Scans and returns all Redis keys matching a given pattern by automatically handling multiple SCAN iterations. Safer than KEYS * for large datasets, but may use significant memory.

Instructions

Scan and return ALL keys matching a pattern using multiple SCAN iterations.

This function automatically handles the SCAN cursor iteration to collect all matching keys. It's safer than KEYS * for large databases but will still collect all results in memory.

⚠️ WARNING: With very large datasets (millions of keys), this may consume significant memory. For large-scale operations, consider using scan_keys() with manual iteration instead.

Args: pattern: Pattern to match keys against (default is "*" for all keys). batch_size: Number of keys to scan per iteration (default 100).

Returns: A list of all keys matching the pattern or an error message.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
patternNo*
batch_sizeNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Discloses key behaviors: automatic cursor iteration, memory consumption warning, returns all results in memory. With no annotations, this provides sufficient transparency, though it omits details like rate limiting or auth requirements.

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?

Concise, front-loaded with purpose, includes a warning section, and uses clear sentence structure. Every part adds value without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Adequately covers the tool's operation and output (list of keys or error). With an output schema existing, the description doesn't need to detail return format. Could mention error scenarios or side effects, but overall complete.

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?

Adds meaning beyond the schema by stating defaults and roles (pattern to match, batch size per iteration). However, does not elaborate on valid pattern formats or limits, leaving some ambiguity given 0% schema description coverage.

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 specifies the tool scans and returns ALL keys matching a pattern using multiple SCAN iterations. It distinguishes itself from the sibling scan_keys (manual iteration) and KEYS command by highlighting automatic cursor handling and safety for large databases.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly advises when to use (safer than KEYS*) and when not to (very large datasets). Suggests alternative scan_keys() with manual iteration for large-scale operations, referencing a sibling tool.

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

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