Skip to content

Commit de446bd

Browse files
committed
Fix error message in get_vector_from_hash
1 parent e2206f2 commit de446bd

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/tools/hash.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ async def hset(name: str, key: str, value: str | int | float, expire_seconds: in
3434
@mcp.tool()
3535
async def hget(name: str, key: str) -> str:
3636
"""Get the value of a field in a Redis hash.
37-
37+
3838
Args:
3939
name: The Redis hash key.
4040
key: The field name inside the hash.
41-
41+
4242
Returns:
4343
The field value or an error message.
4444
"""
@@ -52,11 +52,11 @@ async def hget(name: str, key: str) -> str:
5252
@mcp.tool()
5353
async def hdel(name: str, key: str) -> str:
5454
"""Delete a field from a Redis hash.
55-
55+
5656
Args:
5757
name: The Redis hash key.
5858
key: The field name inside the hash.
59-
59+
6060
Returns:
6161
A success message or an error message.
6262
"""
@@ -70,10 +70,10 @@ async def hdel(name: str, key: str) -> str:
7070
@mcp.tool()
7171
async def hgetall(name: str) -> dict:
7272
"""Get all fields and values from a Redis hash.
73-
73+
7474
Args:
7575
name: The Redis hash key.
76-
76+
7777
Returns:
7878
A dictionary of field-value pairs or an error message.
7979
"""
@@ -87,11 +87,11 @@ async def hgetall(name: str) -> dict:
8787
@mcp.tool()
8888
async def hexists(name: str, key: str) -> bool:
8989
"""Check if a field exists in a Redis hash.
90-
90+
9191
Args:
9292
name: The Redis hash key.
9393
key: The field name inside the hash.
94-
94+
9595
Returns:
9696
True if the field exists, False otherwise.
9797
"""
@@ -151,4 +151,4 @@ async def get_vector_from_hash(name: str, vector_field: str = "vector"):
151151
return f"Field '{vector_field}' not found in hash '{name}'."
152152

153153
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

Comments
 (0)