Skip to content

Commit 3f48d65

Browse files
committed
use constant from json_rpc_handler
1 parent fae77a6 commit 3f48d65

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/mcp/client.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
module MCP
44
class Client
5-
JSON_RPC_VERSION = "2.0"
6-
75
# Initializes a new MCP::Client instance.
86
#
97
# @param transport [Object] The transport object to use for communication with the server.
@@ -38,7 +36,7 @@ def initialize(transport:)
3836
# end
3937
def tools
4038
response = transport.send_request(request: {
41-
jsonrpc: JSON_RPC_VERSION,
39+
jsonrpc: JsonRpcHandler::Version::V2_0,
4240
id: request_id,
4341
method: "tools/list",
4442
})
@@ -67,7 +65,7 @@ def tools
6765
# Consult the documentation for your transport (e.g., MCP::Client::HTTP) for details.
6866
def call_tool(tool:, arguments: nil)
6967
response = transport.send_request(request: {
70-
jsonrpc: JSON_RPC_VERSION,
68+
jsonrpc: JsonRpcHandler::Version::V2_0,
7169
id: request_id,
7270
method: "tools/call",
7371
params: { name: tool.name, arguments: arguments },

0 commit comments

Comments
 (0)