Return the actual MCP envelope, including structuredContent for JSON, so a * test exercises both transport boundaries instead of a formatter in isolation. */
| 4550 | /* Return the actual MCP envelope, including structuredContent for JSON, so a |
| 4551 | * test exercises both transport boundaries instead of a formatter in isolation. */ |
| 4552 | static yyjson_doc *dm_preview_status(const char *project, bool json) { |
| 4553 | cbm_mcp_server_t *srv = cbm_mcp_server_new(NULL); |
| 4554 | if (!srv) { |
| 4555 | return NULL; |
| 4556 | } |
| 4557 | char args[1200]; |
| 4558 | snprintf(args, sizeof(args), "{\"project\":\"%s\",\"diagnostics\":\"full\"%s}", project, |
| 4559 | json ? ",\"format\":\"json\"" : ""); |
| 4560 | char *response = cbm_mcp_handle_tool(srv, "index_status", args); |
| 4561 | yyjson_doc *out = response ? yyjson_read(response, strlen(response), 0) : NULL; |
| 4562 | free(response); |
| 4563 | cbm_mcp_server_free(srv); |
| 4564 | return out; |
| 4565 | } |
| 4566 | |
| 4567 | static const char *dm_preview_text(yyjson_doc *envelope) { |
| 4568 | yyjson_val *root = envelope ? yyjson_doc_get_root(envelope) : NULL; |
no test coverage detected