File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -66,20 +66,19 @@ void mcp::initialize_request::refreshParams() {
6666 params[" protocolVersion" ] = protoVersion ();
6767 params[" clientInfo" ][" name" ] = name ();
6868 params[" clientInfo" ][" version" ] = version ();
69- params[" capabilities" ] = {};
7069
70+ json capabilities = json::object ();
7171 for (auto cap = caps_.cbegin (); cap != caps_.cend (); ++cap) {
7272 json cap_json;
73-
7473 if (cap->subscribe ) {
7574 cap_json[" subscribe" ] = true ;
7675 }
7776 if (cap->listChanged ) {
7877 cap_json[" listChanged" ] = true ;
7978 }
80-
81- params[" capabilities" ][cap->name ] = cap_json;
79+ capabilities[cap->name ] = cap_json;
8280 }
81+ params[" capabilities" ] = capabilities;
8382
8483 this ->params (std::move (params));
8584}
Original file line number Diff line number Diff line change @@ -64,7 +64,8 @@ namespace toolcall
6464
6565 template <typename T>
6666 bool send (const T & message) {
67- return send (std::string (message.toJson ()));
67+ nlohmann::json json = message.toJson ();
68+ return send (json.dump (-1 ));
6869 }
6970
7071 virtual void start () = 0;
You can’t perform that action at this time.
0 commit comments