MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / doccand_index

Function doccand_index

tests/test_mcp.c:15376–15385  ·  view source on GitHub ↗

One fresh full index (the project DB removed first, so no incremental route * can keep earlier rows); returns the candidate rows, -1 on an index error. */

Source from the content-addressed store, hash-verified

15374/* One fresh full index (the project DB removed first, so no incremental route
15375 * can keep earlier rows); returns the candidate rows, -1 on an index error. */
15376static int doccand_index(cbm_mcp_server_t *srv, const char *cache, const char *repo,
15377 const char *extra) {
15378 doccand_clear(cache);
15379 char args[1024];
15380 snprintf(args, sizeof(args), "{\"repo_path\":\"%s\"%s}", repo, extra);
15381 char *resp = cbm_mcp_handle_tool(srv, "index_repository", args);
15382 bool ok = resp && response_contains_json_fragment(resp, "\"status\":\"indexed\"");
15383 free(resp);
15384 return ok ? doccand_rows(cache) : -1;
15385}
15386
15387/* index_repository doc_candidates (full mode): an explicit false stores no
15388 * candidate rows; without the argument a set doc_candidates setting decides

Callers 1

test_mcp.cFile · 0.85

Calls 4

doccand_clearFunction · 0.85
cbm_mcp_handle_toolFunction · 0.85
doccand_rowsFunction · 0.85

Tested by

no test coverage detected