Class: ExplainAnalyzeTool
- Inherits:
-
ExplainBaseTool
- Object
- FastMcp::Tool
- ExplainBaseTool
- ExplainAnalyzeTool
- Defined in:
- lib/rails-pg-extras-mcp.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.name ⇒ Object
118 119 120 |
# File 'lib/rails-pg-extras-mcp.rb', line 118 def self.name "explain_analyze" end |
Instance Method Details
#call(sql_query:) ⇒ Object
122 123 124 125 126 127 128 129 130 131 132 133 134 |
# File 'lib/rails-pg-extras-mcp.rb', line 122 def call(sql_query:) if sql_query.to_s.empty? return "sql_query param is required" end begin ValidateQuery.new(sql_query).call rescue ValidateQuery::InvalidQueryError => e return e. end super(sql_query: "EXPLAIN ANALYZE #{sql_query}") end |