| 1354 | } |
| 1355 | |
| 1356 | char *cbm_mcp_get_string_arg(const char *args_json, const char *key) { |
| 1357 | yyjson_doc *doc = yyjson_read(args_json, strlen(args_json), 0); |
| 1358 | if (!doc) { |
| 1359 | return NULL; |
| 1360 | } |
| 1361 | yyjson_val *root = yyjson_doc_get_root(doc); |
| 1362 | yyjson_val *val = yyjson_obj_get(root, key); |
| 1363 | char *result = NULL; |
| 1364 | if (val && yyjson_is_str(val)) { |
| 1365 | result = heap_strdup(yyjson_get_str(val)); |
| 1366 | } |
| 1367 | yyjson_doc_free(doc); |
| 1368 | return result; |
| 1369 | } |
| 1370 | |
| 1371 | static char *canonicalize_repo_path_if_exists(char *repo_path) { |
| 1372 | if (!repo_path) { |