Module: ActionMCP::Server::Handlers::ToolHandler

Includes:
ErrorAware
Included in:
JsonRpcHandler
Defined in:
lib/action_mcp/server/handlers/tool_handler.rb

Instance Method Summary collapse

Instance Method Details

#process_tools(rpc_method, id, params) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/action_mcp/server/handlers/tool_handler.rb', line 9

def process_tools(rpc_method, id, params)
  params ||= {}

  with_error_handling(id) do
    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