Resolve the project argument, accepting the canonical "project" key plus the * aliases a caller naturally reaches for (#640): list_projects surfaces the * field as "name" and the not-found hint says "pass the project name", so * "project_name" is the usual guess; "project_id" / "projectName" are accepted * too. NOT bare "name" — index_repository uses "name" for an explicit * project-name over
| 1495 | * too. NOT bare "name" — index_repository uses "name" for an explicit |
| 1496 | * project-name override. Caller must free() the result. */ |
| 1497 | static char *get_project_arg(const char *args_json) { |
| 1498 | char *p = cbm_mcp_get_string_arg(args_json, "project"); |
| 1499 | if (!p) { |
| 1500 | p = cbm_mcp_get_string_arg(args_json, "project_name"); |
| 1501 | } |
| 1502 | if (!p) { |
| 1503 | p = cbm_mcp_get_string_arg(args_json, "project_id"); |
| 1504 | } |
| 1505 | if (!p) { |
| 1506 | p = cbm_mcp_get_string_arg(args_json, "projectName"); |
| 1507 | } |
| 1508 | return resolve_project_tail(normalize_project_arg(p)); |
| 1509 | } |
| 1510 | |
| 1511 | int cbm_mcp_get_int_arg(const char *args_json, const char *key, int default_val) { |
| 1512 | yyjson_doc *doc = yyjson_read(args_json, strlen(args_json), 0); |
no test coverage detected