| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | |
| 3 | #ifndef NETDATA_MCP_JSONRPC_H |
| 4 | #define NETDATA_MCP_JSONRPC_H |
| 5 | |
| 6 | #include <json-c/json.h> |
| 7 | #include "mcp.h" |
| 8 | |
| 9 | int mcp_jsonrpc_error_code(MCP_RETURN_CODE rc); |
| 10 | BUFFER *mcp_jsonrpc_build_error_payload(struct json_object *id_obj, int code, const char *message, |
| 11 | const struct mcp_response_chunk *chunks, size_t chunk_count); |
| 12 | BUFFER *mcp_jsonrpc_build_success_payload(struct json_object *id_obj, const struct mcp_response_chunk *chunk); |
| 13 | BUFFER *mcp_jsonrpc_process_single_request(MCP_CLIENT *mcpc, struct json_object *request, bool *had_error); |
| 14 | BUFFER *mcp_jsonrpc_build_batch_response(BUFFER **responses, size_t count); |
| 15 | |
| 16 | #endif // NETDATA_MCP_JSONRPC_H |