Skip to main content
Glama

get_item

Retrieve a specific STAC Item from a collection using collection and item IDs to access geospatial data like satellite imagery or weather information.

Instructions

Get a specific STAC Item by collection and item ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collection_idYes
item_idYes
output_formatNotext
catalog_urlNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Core handler function that fetches and formats a STAC Item by collection_id and item_id using STACClient, supporting text or JSON output.
    def handle_get_item(
        client: STACClient,
        arguments: dict[str, Any],
    ) -> list[TextContent] | dict[str, Any]:
        collection_id = arguments["collection_id"]
        item_id = arguments["item_id"]
        item = client.get_item(collection_id, item_id)
        if item is None:
            return {"type": "item", "item": None}
        if arguments.get("output_format") == "json":
            return {"type": "item", "item": item}
        item_id_value = item.get("id", item_id)
        result_text = f"**Item: {item_id_value}**\n\n"
        collection_value = item.get("collection", collection_id)
        result_text += f"Collection: `{collection_value}`\n"
        dt_value = item.get("datetime")
        if dt_value:
            result_text += f"Date: {dt_value}\n"
        bbox = item.get("bbox")
        if isinstance(bbox, list | tuple) and len(bbox) >= BBOX_MIN_COORDS:
            result_text += (
                f"BBox: [{bbox[0]:.2f}, {bbox[1]:.2f}, {bbox[2]:.2f}, {bbox[3]:.2f}]\n"
            )
        result_text += "\n**Properties:**\n"
        properties = item.get("properties") or {}
        for key, value in properties.items():
            if isinstance(value, str | int | float | bool):
                result_text += f"  {key}: {value}\n"
        assets = item.get("assets") or {}
        asset_count = len(assets) if hasattr(assets, "__len__") else 0
        result_text += f"\n**Assets ({asset_count}):**\n"
        asset_entries = assets.items() if isinstance(assets, dict) else []
        for asset_key, asset in asset_entries:
            title = asset.get("title", asset_key) if isinstance(asset, dict) else asset_key
            result_text += f"  - **{asset_key}**: {title}\n"
            asset_type = (
                asset.get("type", "unknown") if isinstance(asset, dict) else "unknown"
            )
            result_text += f"    Type: {asset_type}\n"
            if isinstance(asset, dict) and "href" in asset:
                result_text += f"    URL: {asset['href']}\n"
        return [TextContent(type="text", text=result_text)]
  • Registers the 'get_item' tool with FastMCP server (@app.tool), defining input schema via type hints and delegating to execution.execute_tool.
    @app.tool
    async def get_item(
        collection_id: str,
        item_id: str,
        output_format: str | None = "text",
        catalog_url: str | None = None,
    ) -> list[dict[str, Any]]:
        """Get a specific STAC Item by collection and item ID."""
        return await execution.execute_tool(
            "get_item",
            arguments={
                "collection_id": collection_id,
                "item_id": item_id,
                "output_format": output_format,
            },
            catalog_url=catalog_url,
            headers=None,
        )
  • Internal tool dispatcher registry mapping tool name 'get_item' to the handle_get_item function.
    _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,
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states it's a read operation ('Get'), but doesn't disclose behavioral traits like authentication needs, rate limits, error handling, or what happens if the item doesn't exist. For a tool with no annotation coverage, this is a significant gap in transparency.

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 that front-loads the core purpose. Every word earns its place, with no wasted text, making it highly concise and well-structured for quick understanding.

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 (which reduces the need to describe return values) but no annotations and 0% schema description coverage, the description is incomplete. It covers the basic purpose but lacks details on parameters, behavioral context, and usage guidelines, making it only minimally adequate for this complexity level.

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. It mentions 'collection and item ID', which maps to two of the four parameters, but doesn't explain 'output_format' or 'catalog_url'. The description adds some meaning for the required parameters but leaves half of the parameters undocumented, failing to fully compensate for the coverage gap.

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

Purpose4/5

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

The description clearly states the action ('Get') and the resource ('a specific STAC Item'), specifying it's identified by collection and item ID. It distinguishes from siblings like 'search_items' by focusing on retrieval of a single item rather than searching. However, it doesn't explicitly contrast with 'get_collection', which might retrieve collection-level metadata.

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

Usage Guidelines3/5

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

The description implies usage when you need a specific STAC Item by collection and item ID, but doesn't explicitly state when to use this vs. alternatives like 'search_items' for broader queries or 'get_collection' for collection-level data. It provides basic context but lacks explicit exclusions or named alternatives.

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