Skip to content

Commit 044d5be

Browse files
committed
change input -> arguments
1 parent 01baaee commit 044d5be

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ end
647647
# Call a specific tool
648648
response = client.call_tool(
649649
tool: tools.first,
650-
input: { message: "Hello, world!" }
650+
arguments: { message: "Hello, world!" }
651651
)
652652
```
653653

lib/mcp/client.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Client
1717
# @note
1818
# The transport does not need to be a specific class, but must implement:
1919
# - #tools
20-
# - #call_tool(tool:, input:)
20+
# - #call_tool(tool:, arguments:)
2121
def initialize(transport:)
2222
@transport = transport
2323
end
@@ -55,22 +55,22 @@ def tools
5555
# Calls a tool via the transport layer.
5656
#
5757
# @param tool [MCP::Client::Tool] The tool to be called.
58-
# @param input [Object, nil] The input to pass to the tool.
58+
# @param arguments [Object, nil] The arguments to pass to the tool.
5959
# @return [Object] The result of the tool call, as returned by the transport.
6060
#
6161
# @example
6262
# tool = client.tools.first
63-
# result = client.call_tool(tool: tool, input: { foo: "bar" })
63+
# result = client.call_tool(tool: tool, arguments: { foo: "bar" })
6464
#
6565
# @note
66-
# The exact requirements for `input` are determined by the transport layer in use.
66+
# The exact requirements for `arguments` are determined by the transport layer in use.
6767
# Consult the documentation for your transport (e.g., MCP::Client::HTTP) for details.
68-
def call_tool(tool:, input: nil)
68+
def call_tool(tool:, arguments: nil)
6969
response = transport.send_request(request: {
7070
jsonrpc: JSON_RPC_VERSION,
7171
id: request_id,
7272
method: "tools/call",
73-
params: { name: tool.name, arguments: input },
73+
params: { name: tool.name, arguments: arguments },
7474
})
7575

7676
response.dig("result", "content")

test/mcp/client_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def test_tools_sends_request_to_transport_and_returns_tools_array
3333
def test_call_tool_sends_request_to_transport_and_returns_content
3434
transport = mock
3535
tool = MCP::Client::Tool.new(name: "tool1", description: "tool1", input_schema: {})
36-
input = { foo: "bar" }
36+
arguments = { foo: "bar" }
3737
mock_response = {
3838
"result" => { "content" => "result" },
3939
}
@@ -43,11 +43,11 @@ def test_call_tool_sends_request_to_transport_and_returns_content
4343
args.dig(:request, :method) == "tools/call" &&
4444
args.dig(:request, :jsonrpc) == "2.0" &&
4545
args.dig(:request, :params, :name) == "tool1" &&
46-
args.dig(:request, :params, :arguments) == input
46+
args.dig(:request, :params, :arguments) == arguments
4747
end.returns(mock_response).once
4848

4949
client = Client.new(transport: transport)
50-
result = client.call_tool(tool: tool, input: input)
50+
result = client.call_tool(tool: tool, arguments: arguments)
5151

5252
assert_equal("result", result)
5353
end

0 commit comments

Comments
 (0)