Skip to content

Commit e326f04

Browse files
NishanthNishanth
authored andcommitted
running ruff format command
1 parent 6125417 commit e326f04

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/tools/list.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,26 +83,27 @@ async def llen(name: str) -> int:
8383
except RedisError as e:
8484
return f"Error retrieving length of list '{name}': {str(e)}"
8585

86+
8687
@mcp.tool()
8788
async def lrem(name: str, count: int, element: FieldT) -> str:
8889
"""Remove elements from a Redis list.
89-
90+
9091
Args:
9192
name: The name of the list
9293
count: Number of elements to remove (0 = all, positive = from head, negative = from tail)
9394
element: The element value to remove
94-
95+
9596
Returns:
9697
A string indicating the number of elements removed.
9798
"""
9899
try:
99100
r = RedisConnectionManager.get_connection()
100101
removed_count = r.lrem(name, count, element)
101-
102+
102103
if removed_count == 0:
103104
return f"Element '{element}' not found in list '{name}' or list does not exist."
104105
else:
105106
return f"Removed {removed_count} occurrence(s) of '{element}' from list '{name}'."
106-
107+
107108
except RedisError as e:
108109
return f"Error removing element from list '{name}': {str(e)}"

0 commit comments

Comments
 (0)