34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
# File 'lib/debug_mcp/tools/rails_info.rb', line 34
def call(session_id: nil, server_context:)
client = server_context[:session_manager].client(session_id)
client.auto_repause!
RailsHelper.require_rails!(client)
parts = []
parts << build_app_section(client)
parts << build_root_section(client)
parts << build_db_section(client)
parts << build_routes_section(client)
text = parts.compact.join("\n\n")
if text.include?("(unavailable)")
text += "\n\n#{RailsHelper::TRAP_CONTEXT_HINT}" if RailsHelper.trap_context?(client)
end
MCP::Tool::Response.new([{ type: "text", text: text }])
rescue DebugMcp::Error => e
MCP::Tool::Response.new([{ type: "text", text: "Error: #{e.message}" }])
end
|