Skip to content
Open
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions src/mcp/mcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ static const tool_def_t TOOLS[] = {
"that score well on ALL keywords. Requires moderate/full index mode. Results appear in the "
"'semantic_results' field (separate from 'results').\"},\"limit\":{\"type\":"
"\"integer\",\"description\":\"Max results. Default: "
"unlimited\"},\"offset\":{\"type\":\"integer\",\"default\":0}},\"required\":[\"project\"]}"},
"200\"},\"offset\":{\"type\":\"integer\",\"default\":0}},\"required\":[\"project\"]}"},

{"query_graph",
"Execute a Cypher query against the knowledge graph for complex multi-hop patterns, "
Expand Down Expand Up @@ -1341,7 +1341,8 @@ static char *handle_search_graph(cbm_mcp_server_t *srv, const char *args) {
char *relationship = cbm_mcp_get_string_arg(args, "relationship");
bool exclude_entry_points = cbm_mcp_get_bool_arg(args, "exclude_entry_points");
bool include_connected = cbm_mcp_get_bool_arg(args, "include_connected");
int limit = cbm_mcp_get_int_arg(args, "limit", MCP_HALF_SEC_US);
enum { SEARCH_DEFAULT_LIMIT = 200 };
int limit = cbm_mcp_get_int_arg(args, "limit", SEARCH_DEFAULT_LIMIT);
int offset = cbm_mcp_get_int_arg(args, "offset", 0);
int min_degree = cbm_mcp_get_int_arg(args, "min_degree", CBM_NOT_FOUND);
int max_degree = cbm_mcp_get_int_arg(args, "max_degree", CBM_NOT_FOUND);
Expand Down
3 changes: 2 additions & 1 deletion src/store/store.c
Original file line number Diff line number Diff line change
Expand Up @@ -2301,7 +2301,8 @@ int cbm_store_search(cbm_store_t *s, const cbm_search_params_t *params, cbm_sear
snprintf(count_sql, sizeof(count_sql), "SELECT COUNT(*) FROM (%s)", sql);

/* Add ORDER BY + LIMIT */
int limit = params->limit > 0 ? params->limit : ST_HALF_SEC;
enum { ST_DEFAULT_SEARCH_LIMIT = 200 };
int limit = params->limit > 0 ? params->limit : ST_DEFAULT_SEARCH_LIMIT;
int offset = params->offset;
const char *name_col = has_degree_filter ? "name" : "n.name";
char order_limit[CBM_SZ_128];
Expand Down