Build the search_graph args JSON: {"project":..,"name_pattern":".*tok.*", * "limit":N}. `token` is a pure identifier so regex embedding is safe. */
| 136 | /* Build the search_graph args JSON: {"project":..,"name_pattern":".*tok.*", |
| 137 | * "limit":N}. `token` is a pure identifier so regex embedding is safe. */ |
| 138 | static char *ha_build_args(const char *project, const char *token) { |
| 139 | yyjson_mut_doc *doc = yyjson_mut_doc_new(NULL); |
| 140 | yyjson_mut_val *root = yyjson_mut_obj(doc); |
| 141 | yyjson_mut_doc_set_root(doc, root); |
| 142 | |
| 143 | char name_pattern[HA_MAX_TOKEN + 8]; |
| 144 | snprintf(name_pattern, sizeof(name_pattern), ".*%s.*", token); |
| 145 | |
| 146 | yyjson_mut_obj_add_str(doc, root, "project", project); |
| 147 | yyjson_mut_obj_add_str(doc, root, "name_pattern", name_pattern); |
| 148 | yyjson_mut_obj_add_int(doc, root, "limit", HA_RESULT_LIMIT); |
| 149 | |
| 150 | char *out = yyjson_mut_write(doc, 0, NULL); |
| 151 | yyjson_mut_doc_free(doc); |
| 152 | return out; /* caller frees */ |
| 153 | } |
| 154 | |
| 155 | /* Parse the MCP envelope returned by cbm_mcp_handle_tool and, if it is a |
| 156 | * successful search_graph result with >=1 hit, format a compact |
no outgoing calls
no test coverage detected