Skip to main content
Glama

search_collections

Search and retrieve geospatial data collections from STAC APIs to access satellite imagery, weather data, and other spatial-temporal assets.

Instructions

Return a page of STAC collections.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
catalog_urlNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The core handler function that executes the search_collections tool logic: searches STAC collections using STACClient, handles JSON/text output formats, and formats results with titles, descriptions, and licenses.
    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)]
  • Registers the 'search_collections' tool with FastMCP server using @app.tool decorator, defines input parameters via type hints, and delegates execution to the internal execution module.
    @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,
        )
  • Internal registration mapping the 'search_collections' tool name to its handler function (handle_search_collections) in the tool execution dispatcher.
    _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,
    }
  • Import of the search_collections handler into the execution module.
    from stac_mcp.tools.search_collections import handle_search_collections
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions returning a 'page' of collections, hinting at pagination, but doesn't clarify if this is a read-only operation, what authentication might be needed, rate limits, or error handling. For a search tool with no annotations, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste. It's appropriately sized and front-loaded, clearly stating the core function without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has an output schema, the description doesn't need to explain return values. However, with no annotations, low schema coverage, and 2 parameters, the description is incomplete—it doesn't address usage, parameters, or behavioral details, leaving gaps for a search tool in this context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate, but it provides no information about parameters. With 2 parameters (limit and catalog_url) undocumented in both schema and description, users lack context on their purpose, such as how 'limit' affects pagination or what 'catalog_url' specifies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool returns a page of STAC collections, which is a clear purpose with a specific resource (STAC collections). However, it doesn't distinguish this from sibling tools like 'get_collection' or 'search_items', leaving ambiguity about when to use this versus those alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. With siblings like 'get_collection' (likely for single collections) and 'search_items' (for items within collections), the description offers no context on usage scenarios, prerequisites, or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/Wayfinder-Foundry/stac-mcp'

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