Skip to main content
Glama
atengk

mcp-server-redis

by atengk

redis_scan_keys

Scan Redis keys by pattern with cursor-based pagination, resume from a prior cursor, and optionally fetch each key's type and TTL metadata in one call.

Instructions

使用非阻塞式聚合扫描器检索匹配的键名列表,自动处理底层游标分页。

支持传入上一页返回的 cursor 实现单机断点续翻(从 0 开始扫描)。 可选择传入 include_meta=True 一次性并发拉取各键的类型与 TTL 元数据,避免 N+1 往返。

Args: pattern: 键名匹配模式通配符(默认 '*') limit: 最大返回条数(默认 50,硬上限 200) cursor: 起始扫描游标(默认 0 从头扫描,可传入上一页返回的 cursor 实现单机断点续翻) type: 目标键类型过滤(支持 string/hash/list/set/zset/stream,可选) connection: 目标连接别名(可选,当前系统仅配置单连接 'default',缺省直接使用) db: 目标数据库编号(可选,0~15) include_meta: 是否在单次调用中并发附加 type 与 ttl 元数据(默认 False)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dbNo
typeNo
limitNo
cursorNo
patternNo*
connectionNo
include_metaNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.2.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden and does well: it discloses non-blocking execution, automatic cursor handling, a hard limit of 200, and that include_meta performs concurrent metadata fetches. It does not describe error or failure behavior, but the read-only nature and pagination mechanics are otherwise clearly conveyed.

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 front-loaded with the core behavior before the Args block, and each parameter line earns its place. It is slightly verbose in repeating cursor semantics twice (prose and Args), but overall well structured.

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?

An output schema exists, so return values need no explanation, and the description covers pagination, filtering, and optional metadata enrichment thoroughly. Only the absence of guidance on choosing this over redis_execute_command leaves a small completeness gap.

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?

Schema description coverage is 0%, so the description must compensate entirely, and it does: it documents all 7 parameters with defaults, the hard cap on limit, the accepted type values (string/hash/list/set/zset/stream), the db range 0-15, and that only 'default' connection exists. This is meaningfully richer than the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource – a non-blocking aggregated scanner that retrieves matching key names and handles cursor pagination internally. It is clearly distinguishable from redis_inspect_key (per-key inspection) and redis_execute_command (raw command execution), though it never names those siblings explicitly.

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?

It gives useful operational context: pass the previous page's cursor to resume, use include_meta=True to avoid N+1 round trips. However, it offers no explicit when-to-use/when-not-to-use guidance relative to redis_execute_command, which could also run SCAN, so routing 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.