info
Retrieve Redis server information and statistics by specifying sections such as memory or CPU. Analyze performance metrics and monitor server health efficiently.
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
| Name | Required | Description | Default |
|---|---|---|---|
| section | No | default |
Implementation Reference
- src/tools/server_management.py:17-32 (handler)The handler function for the "info" MCP tool. It retrieves Redis server information and statistics for a specified section using the Redis client's info method, with error handling for RedisErrors.@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)}"
- src/tools/server_management.py:18-26 (schema)Input/output schema for the "info" tool defined by the function signature (section: str = "default" → dict) and comprehensive docstring describing parameters and return types.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. """
- src/tools/server_management.py:17-17 (registration)The @mcp.tool() decorator registers the info function as an MCP tool.@mcp.tool()