Skip to main content
Glama
redis

Redis MCP Server

Official
by redis

llen

Retrieve the length of a Redis list to monitor data size and manage list operations efficiently.

Instructions

Get the length of a Redis list.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes

Implementation Reference

  • The 'llen' tool handler: an async function decorated with @mcp.tool() that connects to Redis via RedisConnectionManager and returns the length of the specified list, or an error message on failure.
    @mcp.tool() async def llen(name: str) -> int: """Get the length of a Redis list.""" try: r = RedisConnectionManager.get_connection() return r.llen(name) except RedisError as e: return f"Error retrieving length of list '{name}': {str(e)}"

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