rails-lens
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| RAILS_LENS_PROJECT_PATH | Yes | Absolute path to the root directory of the Rails application to analyze |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| rails_lens_introspect_modelA | モデルの全依存関係(associations, callbacks, validations, scopes, concerns, schema等)を返す。 モデルを変更する前に必ずこのツールで影響範囲を確認すること。 |
| rails_lens_find_referencesC | コード参照検索 |
| rails_lens_list_modelsA | Railsアプリのモデル一覧を取得 |
| rails_lens_trace_callback_chainC | コールバック連鎖トレース |
| rails_lens_dependency_graphC | 依存関係グラフ生成 |
| rails_lens_get_schemaA | RailsアプリのDBスキーマ情報を取得 |
| rails_lens_get_routesA | RailsアプリのルーティングをすべてJSON形式で返す |
| rails_lens_analyze_concernB | Rails ConcernのInclude関係・メソッドを分析 |
| rails_lens_refresh_cacheA | キャッシュを手動で無効化する(tool_name省略時は全キャッシュ) |
| rails_lens_explain_method_resolutionC | モデルのメソッド解決順序(MRO)・祖先チェーン・メソッドオーナーを返す |
| rails_lens_gem_introspectC | モデルに影響を与えているGemのメソッド・コールバック・ルートを返す |
| rails_lens_analyze_impactA | カラムやメソッドを変更した場合の影響範囲(コールバック・バリデーション・ビュー・メーラー等)を分析する |
| rails_lens_test_mappingA | モデルやメソッドに関連するテストファイルを検出し、実行コマンドを返す |
| rails_lens_dead_codeA | 未使用のメソッド・コールバック・スコープを検出し、削除の安全性を confidence 付きで報告する |
| rails_lens_circular_dependenciesB | モデル間の循環依存(コールバック相互更新・双方向association)を検出し、Mermaid図で可視化する |
| rails_lens_extract_concern_candidateA | Fat Model のメソッドを凝集度で分析し、Concern切り出し候補を根拠付きで提示する |
| rails_lens_data_flowB | HTTPリクエストからDB保存までのデータフローを可視化する ルーティング→Strong Parameters→コールバックの順で解析する。 |
| rails_lens_migration_contextB | テーブルのスキーマ・インデックス・外部キー・マイグレーション履歴を返し、適切な警告とテンプレートを提供する |
| rails_lens_screen_mapB | 画面とソースコードの双方向マッピングを提供する。 3つのモードがある:
画面を変更する前にこのツールで影響範囲を確認すること。 特にパーシャルやヘルパーの変更は複数画面に影響する可能性がある。 |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 19 tools
Most tools have distinct purposes like analyzing concerns, dead code, or screen mappings. However, a few tools like analyze_impact, introspect_model, and dependency_graph may overlap in scope, though descriptions help differentiate them.
All tools follow the consistent prefix 'rails_lens_' and use snake_case. The naming pattern mixes verb-object (analyze_impact, extract_concern_candidate) with noun phrases (dead_code, dependency_graph), but the overall style is predictable.
With 19 tools, the count is in the borderline range (16-25). For a comprehensive Rails analysis server, the breadth is justified, but some tools could potentially be merged without losing clarity.
The tool set covers a wide range of Rails analysis needs: models, schema, routes, migrations, callbacks, dependencies, dead code, test mapping, screen mapping, and more. There are no obvious gaps for the intended purpose of understanding and refactoring Rails applications.