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

Function compare_graphs_error

src/mcp/mcp.c:3346–3367  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3344} compare_response_t;
3345
3346static char *compare_graphs_error(const char *code, const char *message) {
3347 yyjson_mut_doc *doc = yyjson_mut_doc_new(NULL);
3348 yyjson_mut_val *root = doc ? yyjson_mut_obj(doc) : NULL;
3349 if (!doc || !root) {
3350 yyjson_mut_doc_free(doc);
3351 return cbm_mcp_text_result("compare_graphs failed: out of memory", true);
3352 }
3353 yyjson_mut_doc_set_root(doc, root);
3354 if (!yyjson_mut_obj_add_strcpy(doc, root, "error", message) ||
3355 !yyjson_mut_obj_add_strcpy(doc, root, "code", code)) {
3356 yyjson_mut_doc_free(doc);
3357 return cbm_mcp_text_result("compare_graphs failed: out of memory", true);
3358 }
3359 char *json = yy_doc_to_str(doc);
3360 yyjson_mut_doc_free(doc);
3361 if (!json) {
3362 return cbm_mcp_text_result("compare_graphs failed: out of memory", true);
3363 }
3364 char *result = cbm_mcp_text_result(json, true);
3365 free(json);
3366 return result;
3367}
3368
3369static bool compare_arg_name_allowed(const char *name) {
3370 return strcmp(name, "base_project") == 0 || strcmp(name, "target_project") == 0 ||

Callers 1

handle_compare_graphsFunction · 0.85

Calls 2

cbm_mcp_text_resultFunction · 0.85
yy_doc_to_strFunction · 0.85

Tested by

no test coverage detected