Skip to content

Commit ee351b2

Browse files
committed
Fix for get_indexes error #10
1 parent 9a0a5d3 commit ee351b2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/tools/redis_query_engine.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import json
12
from common.connection import RedisConnectionManager
23
from redis.exceptions import RedisError
34
from common.server import mcp
@@ -10,10 +11,13 @@
1011
@mcp.tool()
1112
async def get_indexes() -> str:
1213
"""List of indexes in the Redis database
14+
15+
Returns:
16+
str: A JSON string containing the list of indexes or an error message.
1317
"""
1418
try:
1519
r = RedisConnectionManager.get_connection()
16-
return r.execute_command("FT._LIST")
20+
return json.dumps(r.execute_command("FT._LIST"))
1721
except RedisError as e:
1822
return f"Error retrieving indexes: {str(e)}"
1923

0 commit comments

Comments
 (0)