Skip to content
Merged
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
10 changes: 10 additions & 0 deletions packages/mcp-cloudflare/src/server/routes/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import type {
CompoundFilter,
AutoRagSearchRequest,
} from "@cloudflare/workers-types";
import { logger } from "@sentry/cloudflare";

// Request schema matching the MCP tool parameters
const SearchRequestSchema = z.object({
Expand Down Expand Up @@ -153,6 +154,15 @@ export default new Hono<{ Bindings: Env }>().post("/", async (c) => {
// Process search results - handle the actual response format from Cloudflare AI
const searchData = searchResult as AutoRagSearchResponse;

if (searchData.data?.length === 0) {
logger.warn(
logger.fmt`No results found for query: ${query} with guide: ${guide}`,
{
result_query: searchData.search_query,
},
);
}

return c.json({
query,
results:
Expand Down