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

Function add_string_array

src/mcp/mcp.c:4217–4227  ·  view source on GitHub ↗

Build an enriched snippet response for a resolved node. */ Add a string array to a JSON object (no-op if count == 0). */

Source from the content-addressed store, hash-verified

4215/* Build an enriched snippet response for a resolved node. */
4216/* Add a string array to a JSON object (no-op if count == 0). */
4217static void add_string_array(yyjson_mut_doc *doc, yyjson_mut_val *obj, const char *key,
4218 char **strings, int count) {
4219 if (count <= 0) {
4220 return;
4221 }
4222 yyjson_mut_val *arr = yyjson_mut_arr(doc);
4223 for (int i = 0; i < count; i++) {
4224 yyjson_mut_arr_add_str(doc, arr, strings[i]);
4225 }
4226 yyjson_mut_obj_add_val(doc, obj, key, arr);
4227}
4228
4229static char *build_snippet_response(cbm_mcp_server_t *srv, cbm_node_t *node,
4230 const char *match_method, bool include_neighbors,

Callers 1

build_snippet_responseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected