Module: RosettAi::Mcp::ResponseHelper
- Defined in:
- lib/rosett_ai/mcp/response_helper.rb
Overview
Standardized MCP tool response formatting.
Provides consistent response structure for all MCP tools with success, finding, and error states.
Class Method Summary collapse
-
.error(message, data = {}) ⇒ Hash
Build an error response hash.
-
.finding(message, data = {}) ⇒ Hash
Build a finding response hash (not an error, but notable).
-
.success(message, data = {}) ⇒ Hash
Build a success response hash.
Class Method Details
.error(message, data = {}) ⇒ Hash
Build an error response hash.
41 42 43 |
# File 'lib/rosett_ai/mcp/response_helper.rb', line 41 def error(, data = {}) { error: true, message: }.merge(data) end |
.finding(message, data = {}) ⇒ Hash
Build a finding response hash (not an error, but notable).
32 33 34 |
# File 'lib/rosett_ai/mcp/response_helper.rb', line 32 def finding(, data = {}) { finding: true, message: }.merge(data) end |
.success(message, data = {}) ⇒ Hash
Build a success response hash.
23 24 25 |
# File 'lib/rosett_ai/mcp/response_helper.rb', line 23 def success(, data = {}) { success: true, message: }.merge(data) end |