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

Function search_code_with_context

tests/test_mcp.c:23969–23982  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23967}
23968
23969static char *search_code_with_context(cbm_mcp_server_t *srv, const char *context_value) {
23970 char req[256];
23971 snprintf(req, sizeof(req),
23972 "{\"project\":\"test-project\",\"pattern\":\"needle-context-window\","
23973 "\"format\":\"json\",\"context\":%s,\"limit\":5}",
23974 context_value);
23975 char *resp = cbm_mcp_handle_tool(srv, "search_code", req);
23976 if (!resp) {
23977 return NULL;
23978 }
23979 char *inner = extract_text_content(resp);
23980 free(resp);
23981 return inner;
23982}
23983
23984/* Row-0 context object of a json-format search_code answer, or NULL when the
23985 * answer carries no context column. *doc_out owns the memory either way. */

Callers 1

test_mcp.cFile · 0.85

Calls 2

cbm_mcp_handle_toolFunction · 0.85
extract_text_contentFunction · 0.85

Tested by

no test coverage detected