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

Function doccand_forwarded

tests/test_mcp.c:15490–15511  ·  view source on GitHub ↗

The doc_candidates key of captured worker args: 1 true, 0 false, -1 absent, * -2 not a single boolean (or unparseable args). */

Source from the content-addressed store, hash-verified

15488/* The doc_candidates key of captured worker args: 1 true, 0 false, -1 absent,
15489 * -2 not a single boolean (or unparseable args). */
15490static int doccand_forwarded(const doccand_executor_capture_t *capture) {
15491 yyjson_doc *doc = capture->args ? yyjson_read(capture->args, strlen(capture->args), 0) : NULL;
15492 yyjson_val *root = doc ? yyjson_doc_get_root(doc) : NULL;
15493 if (!root || !yyjson_is_obj(root)) {
15494 yyjson_doc_free(doc);
15495 return -2;
15496 }
15497 int keys = 0;
15498 int value = -1;
15499 size_t idx;
15500 size_t max;
15501 yyjson_val *key;
15502 yyjson_val *val;
15503 yyjson_obj_foreach(root, idx, max, key, val) {
15504 if (strcmp(yyjson_get_str(key), "doc_candidates") == 0) {
15505 keys++;
15506 value = yyjson_is_bool(val) ? (yyjson_get_bool(val) ? 1 : 0) : -2;
15507 }
15508 }
15509 yyjson_doc_free(doc);
15510 return keys > 1 ? -2 : value;
15511}
15512
15513static int doccand_forward_call(cbm_mcp_server_t *srv, doccand_executor_capture_t *capture,
15514 const char *repo, const char *extra) {

Callers 1

doccand_forward_callFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected