134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
|
# File 'lib/status_mcp/server.rb', line 134
def call(query:)
services = load_data
fuzzy_results = find_services_fuzzy(services, query, threshold: 0.5)
if fuzzy_results.empty?
"No services found matching '#{query}'"
else
seen = {}
unique_results = fuzzy_results.select do |r|
name_key = r[:service]["name"]&.downcase
if seen[name_key]
false
else
seen[name_key] = true
true
end
end
unique_results.first(20).map { |r| format_service(r[:service]) }.join("\n\n")
end
end
|