Class: Collavre::Comments::McpCommand
- Inherits:
-
Object
- Object
- Collavre::Comments::McpCommand
- Defined in:
- app/services/collavre/comments/mcp_command.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(comment:, user:, tool:, creative: nil, meta_tool_service: default_meta_tool_service) ⇒ McpCommand
constructor
A new instance of McpCommand.
Constructor Details
#initialize(comment:, user:, tool:, creative: nil, meta_tool_service: default_meta_tool_service) ⇒ McpCommand
Returns a new instance of McpCommand.
6 7 8 9 10 11 12 |
# File 'app/services/collavre/comments/mcp_command.rb', line 6 def initialize(comment:, user:, tool:, creative: nil, meta_tool_service: ) @comment = comment @user = user @tool = tool @creative = creative @meta_tool_service = end |
Instance Method Details
#call ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'app/services/collavre/comments/mcp_command.rb', line 14 def call return unless command_match? arguments = parsed_arguments return unless arguments response = .call(action: "run", tool_name: tool_name, arguments: arguments) format_response(response) rescue StandardError => e Rails.logger.error("MCP command '#{tool_name}' failed: #{e.}") e. end |