class RubyLLM::InputRequest

A request for input from the user while a tool works on a call: an MCP server’s question, received by MCP.before_input_request callbacks, or a tool’s own, from Tool#ask. A form request asks for values; a URL request asks the user to visit a page, such as to connect an account.

before_input_request do |request|
  if request.url?
    system "open", request.url
    request.answer
  else
    request.answer(environment: "staging")
  end
end

In a chat, a request no callback answers pauses the tool call until Chat#answer or Chat#decline settles it; see Chat#pending_inputs.