Skip to main content
Glama
redis

Redis MCP Server

Official
by redis

read_messages

Retrieve pending messages from a Redis pub/sub subscription by ID, with configurable timeout and message limit.

Instructions

Read pending pub/sub messages for an existing subscription.

Args: subscription_id: The ID returned by subscribe() or psubscribe(). timeout_ms: Time to wait for messages in milliseconds. Use 0 for non-blocking. max_messages: Maximum number of messages to return in one call.

Returns: A dictionary containing the collected messages or an error message.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
timeout_msNo
max_messagesNo
subscription_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It clarifies that this is a read operation ('Read'), explains timeout semantics ('Use 0 for non-blocking'), and notes the return type ('dictionary containing ... or an error message'). It does not explicitly state whether reading removes messages or requires an active subscription, but the 'pending' and 'existing subscription' phrasing provides useful context.

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 and well-structured with Args and Returns sections. Every sentence adds value; there is no fluff or repetition. It is appropriately sized for the tool's complexity.

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?

The tool has a simple, well-defined purpose with three parameters, all of which are thoroughly explained. The presence of an output schema reduces the need to document return values, but the description still mentions them. Including the prerequisite of an existing subscription and the optional parameters makes the description complete for effective use.

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 fully compensate. It does: each parameter is explained with meaningful detail (subscription_id source, timeout behavior, max_messages purpose). This goes well beyond the bare type/default information in the input schema.

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 states a specific action ('Read pending pub/sub messages') on a specific resource ('existing subscription'), clearly distinguishing it from sibling tools like publish, subscribe, and psubscribe. The scope is well-defined: it reads messages for an existing subscription, not creating or managing subscriptions.

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 clearly implies usage after a prior subscription by requiring 'subscription_id: The ID returned by subscribe() or psubscribe().' It explains the non-blocking option and message count limit. However, it does not explicitly state when to prefer this over other read-like tools (e.g., xreadgroup for streams), though the sibling list makes the pub/sub context clear.

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