@@ -34,11 +34,11 @@ async def hset(name: str, key: str, value: str | int | float, expire_seconds: in
34
34
@mcp .tool ()
35
35
async def hget (name : str , key : str ) -> str :
36
36
"""Get the value of a field in a Redis hash.
37
-
37
+
38
38
Args:
39
39
name: The Redis hash key.
40
40
key: The field name inside the hash.
41
-
41
+
42
42
Returns:
43
43
The field value or an error message.
44
44
"""
@@ -52,11 +52,11 @@ async def hget(name: str, key: str) -> str:
52
52
@mcp .tool ()
53
53
async def hdel (name : str , key : str ) -> str :
54
54
"""Delete a field from a Redis hash.
55
-
55
+
56
56
Args:
57
57
name: The Redis hash key.
58
58
key: The field name inside the hash.
59
-
59
+
60
60
Returns:
61
61
A success message or an error message.
62
62
"""
@@ -70,10 +70,10 @@ async def hdel(name: str, key: str) -> str:
70
70
@mcp .tool ()
71
71
async def hgetall (name : str ) -> dict :
72
72
"""Get all fields and values from a Redis hash.
73
-
73
+
74
74
Args:
75
75
name: The Redis hash key.
76
-
76
+
77
77
Returns:
78
78
A dictionary of field-value pairs or an error message.
79
79
"""
@@ -87,11 +87,11 @@ async def hgetall(name: str) -> dict:
87
87
@mcp .tool ()
88
88
async def hexists (name : str , key : str ) -> bool :
89
89
"""Check if a field exists in a Redis hash.
90
-
90
+
91
91
Args:
92
92
name: The Redis hash key.
93
93
key: The field name inside the hash.
94
-
94
+
95
95
Returns:
96
96
True if the field exists, False otherwise.
97
97
"""
@@ -151,4 +151,4 @@ async def get_vector_from_hash(name: str, vector_field: str = "vector"):
151
151
return f"Field '{ vector_field } ' not found in hash '{ name } '."
152
152
153
153
except RedisError as e :
154
- return f"Error retrieving vector from hash ' { name } ' with key '{ key } ': { str (e )} "
154
+ return f"Error retrieving vector field ' { vector_field } ' from hash '{ name } ': { str (e )} "
0 commit comments