Skip to main content
Glama
redis

Redis MCP Server

Official
by redis

info

Retrieve detailed Redis server information and statistics. Specify a section such as memory or cpu to filter results.

Instructions

Get Redis server information and statistics.

Args: section: The section of the info command (default, memory, cpu, etc.).

Returns: A dictionary of server information or an error message.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sectionNodefault

Implementation Reference

  • The 'info' tool handler function. It is decorated with @mcp.tool(), accepts an optional 'section' parameter (defaulting to 'default'), gets a Redis connection, and calls r.info(section) to retrieve server information, returning it as a dict.
    @mcp.tool()
    async def info(section: str = "default") -> dict:
        """Get Redis server information and statistics.
    
        Args:
            section: The section of the info command (default, memory, cpu, etc.).
    
        Returns:
            A dictionary of server information or an error message.
        """
        try:
            r = RedisConnectionManager.get_connection()
            info = r.info(section)
            return info
        except RedisError as e:
            return f"Error retrieving Redis info: {str(e)}"
  • Imports from src.common.server import mcp, which provides the FastMCP instance used by the @mcp.tool() decorator to register the 'info' tool.
    from redis.exceptions import RedisError
    
    from src.common.connection import RedisConnectionManager
    from src.common.server import mcp
  • The FastMCP server initialization and tool loading mechanism. The load_tools() function dynamically imports all modules under src.tools, which triggers registration of all @mcp.tool() decorated functions including 'info'.
    import importlib
    import pkgutil
    from mcp.server.fastmcp import FastMCP
    
    
    def load_tools():
        import src.tools as tools_pkg
    
        for _, module_name, _ in pkgutil.iter_modules(tools_pkg.__path__):
            importlib.import_module(f"src.tools.{module_name}")
    
    
    # Initialize FastMCP server
    mcp = FastMCP(
        "Redis MCP Server", dependencies=["redis", "python-dotenv", "numpy", "aiohttp"]
    )
    
    # Load tools
    load_tools()
  • Test categorization showing that 'info' belongs to the 'server_mgmt' group alongside dbsize and client_list in src/tools/server_management.py.
    "server_mgmt": ["dbsize", "info", "client_list"],
Behavior2/5

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

No annotations provided, and the description does not disclose side effects, permissions, or rate limits. It implies a read operation but does not explicitly state safety or behavior beyond returning data.

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?

Extremely concise: one line for purpose, then args and returns. No wasted words, front-loaded with the key action.

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?

Adequate for a simple, one-parameter tool with no output schema. Covers inputs and returns, though listing all possible section values would improve completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description explains the 'section' parameter with examples (default, memory, cpu), adding meaning beyond the schema's field name and type. Schema description coverage is 0%, so the description compensates adequately.

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?

Clearly states it gets Redis server information and statistics. The verb 'Get' and resource 'Redis server information' are specific, and it distinguishes from sibling tools like get (key-value) or dbsize (database size).

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives like type, get, or dbsize. No mention of prerequisites or when not to use it.

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