9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/action_mcp/server/handlers/tool_handler.rb', line 9
def process_tools(rpc_method, id, params)
params ||= {}
with_error_handling(id) do
unless params.is_a?(Hash)
raise JSON_RPC::JsonRpcError.new(:invalid_params, message: "Tool params must be an object")
end
handler = tool_method_handlers[rpc_method]
if handler
send(handler, id, params)
else
Rails.logger.warn("Unknown tools method: #{rpc_method}")
raise JSON_RPC::JsonRpcError.new(:method_not_found, message: "Unknown tools method: #{rpc_method}")
end
end
end
|