Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions finbot/mcp/servers/findrive/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ def search_files(query: str, limit: int = 20) -> dict[str, Any]:
Returns documents whose filename or extracted text matches the query.
Useful for finding relevant invoice PDFs and supporting documents.
"""
if limit < 0:
return {"error": f"limit must be non-negative, got {limit}"}

with db_session() as db:
repo = FinDriveFileRepository(db, session_context)
files = repo.search_files(query, limit=limit)
Expand Down
Loading