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

Function mcp_response_tool_count

tests/test_mcp.c:71–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71static size_t mcp_response_tool_count(const char *response) {
72 yyjson_doc *doc = response ? yyjson_read(response, strlen(response), 0) : NULL;
73 yyjson_val *root = doc ? yyjson_doc_get_root(doc) : NULL;
74 yyjson_val *result = root ? yyjson_obj_get(root, "result") : NULL;
75 yyjson_val *tools = result ? yyjson_obj_get(result, "tools") : NULL;
76 size_t count = tools && yyjson_is_arr(tools) ? yyjson_arr_size(tools) : 0U;
77 yyjson_doc_free(doc);
78 return count;
79}
80
81static char mcp_log_buf[4096];
82static bool mcp_saw_autoindex_log;

Callers 1

test_mcp.cFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected