Class: OvertureMaps::MCPServer::ExportGeojsonTool

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

Class Method Summary collapse

Class Method Details

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



165
166
167
168
169
170
171
172
173
# File 'lib/overture_maps/mcp_server.rb', line 165

def self.call(theme:, path:, type: nil, limit: nil, server_context: nil, **bbox_args)
  bbox = Helpers.resolve_bbox(bbox_args)
  query = Query.new(theme: theme, type: type, bbox: bbox)
  query = query.limit(limit) if limit
  output = query.export(File.expand_path(path))
  Helpers.text_response({ exported: output, bytes: File.size(output) })
rescue OvertureMaps::Error, ArgumentError => e
  Helpers.error_response(e.message)
end