info
Retrieve Redis server information and statistics, including memory usage, CPU metrics, and performance data, to monitor and analyze database health and configuration.
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 main handler function for the 'info' MCP tool. It uses the RedisConnectionManager to get a connection and calls r.info(section) to retrieve server information, returning it as a dict or an error string.@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)}"