Skip to content

Commit 09c2d1a

Browse files
committed
fixup! Allow Client#call_tool to accept a tool name
1 parent 55b715b commit 09c2d1a

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

lib/mcp/client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def prompts
112112
# Consult the documentation for your transport (e.g., MCP::Client::HTTP) for details.
113113
def call_tool(name: nil, tool: nil, arguments: nil, progress_token: nil)
114114
tool_name = name || tool&.name
115-
raise ArgumentError, "Either `name:` or `tool:` must be provided" unless tool_name
115+
raise ArgumentError, "Either `name:` or `tool:` must be provided." unless tool_name
116116

117117
params = { name: tool_name, arguments: arguments }
118118
if progress_token

test/mcp/client_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def test_call_tool_raises_when_no_name_or_tool
9090
client = Client.new(transport: mock)
9191

9292
error = assert_raises(ArgumentError) { client.call_tool(arguments: { foo: "bar" }) }
93-
assert_equal("Either `name:` or `tool:` must be provided", error.message)
93+
assert_equal("Either `name:` or `tool:` must be provided.", error.message)
9494
end
9595

9696
def test_resources_sends_request_to_transport_and_returns_resources_array

0 commit comments

Comments
 (0)