rails-pg-extras-mcp 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 51a70e772cecedb41e510b12575566f177b9e70fd374ae62dfb8f99bc8c04f87
4
- data.tar.gz: b26aef4c74f6bde11aa077435f174ea7325cf8642b86c354ad9b09210849abcb
3
+ metadata.gz: 6544b81c0de61c0ac92c52514874ec1672990525739d3ae4fe989d2f8f88f4eb
4
+ data.tar.gz: d9c1d471162694594c59165864ba48a2cd7bfcf0741e1dca4bd9246b769ea138
5
5
  SHA512:
6
- metadata.gz: bdbcd8cdd983d36e0db3eef92c2a7db89168bc581d2e98fcb6b0d131713f7dc8fbb531a23a90d3f009c089a97bb21273e61313daa6951507c8005b2078b9f83c
7
- data.tar.gz: 6e413fbfd0edd16253d5b2196a2608a42a00e31513fa68c50c33cf9a9959aa88a455bf62a922a49c782cf2bf41058268f6af8e253bed5655110892a15ce47da4
6
+ metadata.gz: 950732591722d121efe13ee44003c6573dc5bbbedf7df3476c71324aa9b6dc9c26ff5c55fc4e7714ae4d34ae674d7e7f7f3cc48cdfc11ebf592145b56c601b6f
7
+ data.tar.gz: 9024824533e151b01dc9150f4daa850ac0b0cbbfb875ebf34bdce8a1a03d65c45125b6094f1cb61ab6cbf843cf537531e81a9db53b6d9f6137d16952ff1ff6c3
@@ -126,6 +126,50 @@ class ExplainAnalyzeTool < ExplainBaseTool
126
126
  end
127
127
  end
128
128
 
129
+ class IndexInfoTool < FastMcp::Tool
130
+ description "Shows information about table indexes: name, table name, columns, index size, index scans, null frac"
131
+
132
+ arguments do
133
+ required(:table_name).filled(:string).description("The table name to get index info for")
134
+ end
135
+
136
+ def call(table_name:)
137
+ RailsPgExtras.index_info(args: { table_name: table_name }, in_format: :hash)
138
+ end
139
+
140
+ def self.name
141
+ "index_info"
142
+ end
143
+ end
144
+
145
+ class TableInfoTool < FastMcp::Tool
146
+ description "Shows information about a table: name, size, cache hit, estimated rows, sequential scans, indexes scans"
147
+
148
+ arguments do
149
+ required(:table_name).filled(:string).description("The table name to get info for")
150
+ end
151
+
152
+ def call(table_name:)
153
+ RailsPgExtras.table_info(args: { table_name: table_name }, in_format: :hash)
154
+ end
155
+ end
156
+
157
+ class TableSchemaTool < FastMcp::Tool
158
+ description "Shows the schema of a table"
159
+
160
+ arguments do
161
+ required(:table_name).filled(:string).description("The table name to get schema for")
162
+ end
163
+
164
+ def call(table_name:)
165
+ RailsPgExtras.table_schema(args: { table_name: table_name }, in_format: :hash)
166
+ end
167
+
168
+ def self.name
169
+ "table_schema"
170
+ end
171
+ end
172
+
129
173
  class ReadmeResource < FastMcp::Resource
130
174
  uri "https://raw.githubusercontent.com/pawurb/rails-pg-extras/refs/heads/main/README.md"
131
175
  resource_name "README"
@@ -163,6 +207,9 @@ module RailsPgExtrasMcp
163
207
  server.register_tools(DiagnoseTool)
164
208
  server.register_tools(MissingFkConstraintsTool)
165
209
  server.register_tools(MissingFkIndexesTool)
210
+ server.register_tools(IndexInfoTool)
211
+ server.register_tools(TableInfoTool)
212
+ server.register_tools(TableSchemaTool)
166
213
  server.register_tools(*QUERY_TOOL_CLASSES)
167
214
  server.register_tools(ExplainTool) if ENV["PG_EXTRAS_MCP_EXPLAIN_ENABLED"] == "true"
168
215
  server.register_tools(ExplainAnalyzeTool) if ENV["PG_EXTRAS_MCP_EXPLAIN_ANALYZE_ENABLED"] == "true"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsPgExtrasMcp
4
- VERSION = "0.2.1"
4
+ VERSION = "0.2.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-pg-extras-mcp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - pawurb