get_indexes
Retrieve a list of all indexes in your Redis database to manage and search data efficiently. Returns results in JSON format.
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-25 (handler)The handler function for the get_indexes tool. It lists all indexes in the Redis database using FT._LIST command and returns them as JSON string or error message if fails.@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()