class Rubydex::MCPServer::FindDeadCodeCandidatesTool
Public Instance Methods
(?limit: Integer, ?offset: Integer) → Tool::Response
Source
# File lib/rubydex/mcp_server/tools/find_dead_code_candidates_tool.rb, line 16 def call(limit: nil, offset: nil) declarations = @graph.dead_code_candidates.sort_by(&:name) page, total = paginate(declarations, offset, limit, 100) candidates = page.map do |declaration| { name: declaration.name, kind: declaration_kind(declaration), locations: declaration.definitions.sort_by(&:location).map do |definition| display_location(definition.location) end, } end response(candidates: candidates, total: total) end