From 8d6f388543e1b3043a687a3270b6cdebd54a6fe1 Mon Sep 17 00:00:00 2001 From: Till Bungert Date: Tue, 19 Aug 2025 13:45:01 +0200 Subject: [PATCH] fix: return None if no results where found (#83) --- src/mcp_server_qdrant/mcp_server.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mcp_server_qdrant/mcp_server.py b/src/mcp_server_qdrant/mcp_server.py index 7886adc..0617b9d 100644 --- a/src/mcp_server_qdrant/mcp_server.py +++ b/src/mcp_server_qdrant/mcp_server.py @@ -131,7 +131,7 @@ class QdrantMCPServer(FastMCP): str, Field(description="The collection to search in") ], query_filter: ArbitraryFilter | None = None, - ) -> list[str]: + ) -> list[str] | None: """ Find memories in Qdrant. :param ctx: The context for the request. @@ -139,7 +139,7 @@ class QdrantMCPServer(FastMCP): :param collection_name: The name of the collection to search in, optional. If not provided, the default collection is used. :param query_filter: The filter to apply to the query. - :return: A list of entries found. + :return: A list of entries found or None. """ # Log query_filter @@ -156,7 +156,7 @@ class QdrantMCPServer(FastMCP): query_filter=query_filter, ) if not entries: - return [f"No information found for the query '{query}'"] + return None content = [ f"Results for the query '{query}'", ]