Unravel Engine C++ Reference
Loading...
Searching...
No Matches
mcp_protocol.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <optional>
5#include <string>
6
7namespace unravel::mcp
8{
9
10struct tool_result;
11
13{
14 std::string method;
15 std::string params_json;
16 std::optional<std::string> id_json;
17 bool has_id{false};
18};
19
20auto json_escape(const std::string& value) -> std::string;
21auto make_json_string(const std::string& value) -> std::string;
22auto make_json_rpc_result(const std::optional<std::string>& id_json, const std::string& result_json) -> std::string;
23auto make_json_rpc_error(const std::optional<std::string>& id_json, int code, const std::string& message) -> std::string;
24auto make_tool_result(const std::string& text, bool is_error = false) -> std::string;
25auto make_tool_result(const tool_result& result) -> std::string;
26
27auto parse_json_rpc_request(const std::string& body, json_rpc_request& out, std::string& error) -> bool;
28
29} // namespace unravel::mcp
std::string error
Definition mcp_async.cpp:33
auto parse_json_rpc_request(const std::string &body, json_rpc_request &out, std::string &error) -> bool
auto make_json_string(const std::string &value) -> std::string
auto make_json_rpc_error(const std::optional< std::string > &id_json, int code, const std::string &message) -> std::string
auto json_escape(const std::string &value) -> std::string
auto make_tool_result(const std::string &text, bool is_error) -> std::string
auto make_json_rpc_result(const std::optional< std::string > &id_json, const std::string &result_json) -> std::string
std::optional< std::string > id_json