Skip to main content
Glama

search_collections

Discover and list available geospatial data collections from STAC catalogs to identify relevant satellite imagery, weather data, and other spatial datasets for analysis.

Instructions

Search and list available STAC collections

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
catalog_urlNoSTAC catalog URL (optional, defaults to Microsoft Planetary Computer)
limitNoMaximum number of collections to return

Implementation Reference

  • The handler function that implements the core logic of the search_collections tool, searching STAC collections and formatting results as text or JSON.
    def handle_search_collections( client: STACClient, arguments: dict[str, Any], ) -> list[TextContent] | dict[str, Any]: limit = arguments.get("limit", 10) collections = client.search_collections(limit=limit) if arguments.get("output_format") == "json": return { "type": "collection_list", "count": len(collections), "collections": collections, } result_text = f"Found {len(collections)} collections:\n\n" for collection in collections: title = collection.get("title") or collection.get("id", "Untitled collection") identifier = collection.get("id", "unknown") result_text += f"**{title}** (`{identifier}`)\n" description = collection.get("description") if description: desc = str(description) truncated = desc[:MAX_DESC_PREVIEW] ellipsis = "..." if len(desc) > MAX_DESC_PREVIEW else "" result_text += f" {truncated}{ellipsis}\n" license_value = collection.get("license", "unspecified") result_text += f" License: {license_value}\n\n" return [TextContent(type="text", text=result_text)]
  • Internal registry mapping tool names to their handler functions, including search_collections.
    _TOOL_HANDLERS: dict[str, Handler] = { "search_collections": handle_search_collections, "get_collection": handle_get_collection, "search_items": handle_search_items, "get_item": handle_get_item, "estimate_data_size": handle_estimate_data_size, "get_root": handle_get_root, "get_conformance": handle_get_conformance, "get_queryables": handle_get_queryables, "get_aggregations": handle_get_aggregations, "sensor_registry_info": handle_sensor_registry_info, }
  • MCP server tool registration for search_collections, defining input parameters and proxying to execution.
    @app.tool async def search_collections( limit: int | None = 10, catalog_url: str | None = None ) -> list[dict[str, Any]]: """Return a page of STAC collections.""" return await execution.execute_tool( "search_collections", arguments={"limit": limit}, catalog_url=catalog_url, headers=None, )

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/BnJam/stac-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server