fix: return None if no results where found (#83)

This commit is contained in:
Till Bungert
2025-08-19 13:45:01 +02:00
committed by GitHub
parent 59fca57369
commit 8d6f388543

View File

@@ -131,7 +131,7 @@ class QdrantMCPServer(FastMCP):
str, Field(description="The collection to search in") str, Field(description="The collection to search in")
], ],
query_filter: ArbitraryFilter | None = None, query_filter: ArbitraryFilter | None = None,
) -> list[str]: ) -> list[str] | None:
""" """
Find memories in Qdrant. Find memories in Qdrant.
:param ctx: The context for the request. :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, :param collection_name: The name of the collection to search in, optional. If not provided,
the default collection is used. the default collection is used.
:param query_filter: The filter to apply to the query. :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 # Log query_filter
@@ -156,7 +156,7 @@ class QdrantMCPServer(FastMCP):
query_filter=query_filter, query_filter=query_filter,
) )
if not entries: if not entries:
return [f"No information found for the query '{query}'"] return None
content = [ content = [
f"Results for the query '{query}'", f"Results for the query '{query}'",
] ]