Parse the JSON object inside an MCP tool result. NULL when absent. */
| 21301 | |
| 21302 | /* Parse the JSON object inside an MCP tool result. NULL when absent. */ |
| 21303 | static yyjson_doc *budget_result_doc(const char *result) { |
| 21304 | char *text = extract_text_content(result); |
| 21305 | yyjson_doc *doc = text ? yyjson_read(text, strlen(text), 0) : NULL; |
| 21306 | free(text); |
| 21307 | return doc; |
| 21308 | } |
| 21309 | |
| 21310 | static const char *budget_doc_str(yyjson_doc *doc, const char *key) { |
| 21311 | return doc ? yyjson_get_str(yyjson_obj_get(yyjson_doc_get_root(doc), key)) : NULL; |
no test coverage detected