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

Function get_project_arg

src/mcp/mcp.c:1497–1509  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1495 * too. NOT bare "name" — index_repository uses "name" for an explicit
1496 * project-name override. Caller must free() the result. */
1497static 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
1511int 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);

Callers 13

handle_get_graph_schemaFunction · 0.85
handle_search_graphFunction · 0.85
handle_query_graphFunction · 0.85
handle_index_statusFunction · 0.85
handle_delete_projectFunction · 0.85
handle_get_architectureFunction · 0.85
handle_trace_call_pathFunction · 0.85
handle_get_code_snippetFunction · 0.85
handle_search_codeFunction · 0.85
handle_detect_changesFunction · 0.85

Calls 3

cbm_mcp_get_string_argFunction · 0.85
resolve_project_tailFunction · 0.85
normalize_project_argFunction · 0.85

Tested by

no test coverage detected