Class: Tools::FindReviewsTool
- Inherits:
-
ApplicationTool
- Object
- MCP::Tool
- ApplicationTool
- Tools::FindReviewsTool
- Defined in:
- app/mcp/tools/find_reviews_tool.rb
Overview
MCP Tool for finding customer reviews.
Reviews contain real customer feedback about products and installations.
Class Method Summary collapse
Class Method Details
.call(query:, min_rating: 4, limit: 10, server_context: nil) ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'app/mcp/tools/find_reviews_tool.rb', line 36 def call(query:, min_rating: 4, limit: 10, server_context: nil) limit = [[limit.to_i, 1].max, 30].min = [[.to_i, 1].max, 5].min reviews = SemanticSearchService.find_reviews(query, limit: limit * 2) reviews = reviews.select { |r| r. >= }.first(limit) json_response( query: query, min_rating: , total_results: reviews.size, reviews: reviews.map { |r| format_review(r) } ) end |