Module: ActionMCP::Server::Handlers::TaskHandler

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

Overview

Handler for MCP 2025-11-25 Tasks feature Tasks provide durable state machines for tracking async request execution

Instance Method Summary collapse

Instance Method Details

#process_tasks(rpc_method, id, params) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/action_mcp/server/handlers/task_handler.rb', line 11

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

  with_error_handling(id) do
    handler = task_method_handlers[rpc_method]
    if handler
      send(handler, id, params)
    else
      Rails.logger.warn("Unknown tasks method: #{rpc_method}")
      raise JSON_RPC::JsonRpcError.new(:method_not_found, message: "Unknown tasks method: #{rpc_method}")
    end
  end
end