Skip to main content
Glama
redis

Redis MCP Server

Official
by redis

scan_all_keys

Automatically iterate SCAN operations to collect all keys matching a pattern, returning a complete list without the blocking risk of KEYS *.

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

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.0.0
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "result": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "items": {
      +            "type": "string"
      +          },
      +          "type": "array"
      +        }
      +      ],
      +      "title": "Result"
      +    }
      +  },
      +  "required": [
      +    "result"
      +  ],
      +  "title": "scan_all_keysOutput",
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.4/5.0
Behavior4/5

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

No annotations provided, so description carries full burden. It explains automatic cursor iteration, in-memory collection, memory warning, and return type. However, it does not explicitly state the tool is read-only (non-destructive), which would be ideal for full transparency.

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?

The description is concise without fluff, front-loaded with main purpose, and includes a warning block for emphasis. Every sentence adds value.

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?

For a potentially memory-intensive tool, description covers operation, memory warning, alternatives, parameters, and return type. Minor gap: does not specify error conditions beyond 'error message'.

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 description coverage is 0%, but description adds meaning by explaining pattern is for matching keys and batch_size controls iteration count. However, it does not provide constraints, examples, or format details beyond defaults.

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 the verb 'Scan and return' and the resource 'ALL keys matching a pattern', distinguishing it from sibling 'scan_keys' which requires manual iteration. It also notes it's safer than KEYS * 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 states when to use (safer than KEYS *) and when not to use (very large datasets with memory concerns), and suggests an alternative: scan_keys() with manual iteration.

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