Enough to use

This commit is contained in:
Joshua Coles
2025-03-17 16:00:48 +00:00
parent 96ae3b2198
commit 60279f0b4e
2 changed files with 19 additions and 8 deletions
+2 -2
View File
@@ -4,6 +4,7 @@ require_relative "mcp/version"
module Mcp
class Error < StandardError; end
class ClientDisconnectedError < Error; end
class Client
def tools
@@ -20,11 +21,10 @@ module Mcp
private
def respond_to_missing?(name, include_private = false)
@tools.any? { |tool| tool["name"] == name.to_s } || super
end
def method_missing(name, **kwargs)
@client.call_tool(name, **kwargs)
@client.call_tool(name.to_s, kwargs)
end
end
end