get_indexes
Retrieve a JSON-formatted list of indexes from a Redis database using this tool. Designed for the Redis MCP Server, it enables efficient data management and querying by providing essential index information.
Instructions
List of indexes in the Redis database
Returns: str: A JSON string containing the list of indexes or an error message.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/redis_query_engine.py:14-26 (handler)The handler function for the 'get_indexes' tool, decorated with @mcp.tool() for registration. It connects to Redis and returns a JSON list of indexes or an error message.@mcp.tool() async def get_indexes() -> str: """List of indexes in the Redis database Returns: str: A JSON string containing the list of indexes or an error message. """ try: r = RedisConnectionManager.get_connection() return json.dumps(r.execute_command("FT._LIST")) except RedisError as e: return f"Error retrieving indexes: {str(e)}"
- src/tools/redis_query_engine.py:14-14 (registration)The @mcp.tool() decorator registers the get_indexes function as an MCP tool.@mcp.tool()