Class: OvertureMaps::MCPServer::CountFeaturesTool

Inherits:
MCP::Tool
  • Object
show all
Defined in:
lib/overture_maps/mcp_server.rb

Class Method Summary collapse

Class Method Details

.call(theme:, type: nil, server_context: nil, **bbox_args) ⇒ Object



142
143
144
145
146
147
148
# File 'lib/overture_maps/mcp_server.rb', line 142

def self.call(theme:, type: nil, server_context: nil, **bbox_args)
  bbox = Helpers.resolve_bbox(bbox_args)
  count = Query.new(theme: theme, type: type, bbox: bbox).count
  Helpers.text_response({ theme: theme, type: type, bbox: bbox.to_s, count: count })
rescue OvertureMaps::Error, ArgumentError => e
  Helpers.error_response(e.message)
end