Skip to content

[EIE] Add STAC item search tool#31

Open
paridhi-parajuli wants to merge 3 commits intodevelopfrom
tool/eie-stac-item-search
Open

[EIE] Add STAC item search tool#31
paridhi-parajuli wants to merge 3 commits intodevelopfrom
tool/eie-stac-item-search

Conversation

@paridhi-parajuli
Copy link
Copy Markdown
Collaborator

@paridhi-parajuli paridhi-parajuli commented Feb 13, 2026

Summary

Add MCP-compatible tool for searching items from STAC given a collection_id, temporal and spatial range.

What it does

  • Supports filtering by collection_id, spatial range (bbox), temporal range (datetime), result limit (limit)
  • Uses the search method from the pystac_client
  • Returns structured output: item_ids, count, error
  • Registers with the MCP tool registry via @mcp_tool decorator

Files changed

  • akd_ext/tools/stac_item_search.py — New tool implementation
  • akd_ext/tools/init.py — Added exports
  • pyproject.toml — Added pystac-client as dependency

Testing

import asyncio

from akd_ext.tools.eie.stac_item_search import (
    STACItemSearchTool,
    STACItemSearchInputSchema,
)


async def test_tool():
    tool = STACItemSearchTool()

    params = STACItemSearchInputSchema(
        collections=["no2-monthly"],
        bbox=[-125.0, 24.5, -66.9, 49.5],
        datetime="2021-01-01/2021-12-31",
        limit=5,
    )

    result = await tool.arun(params)

    print("Result:")
    print("Item IDs:", result.item_ids)
    print("Count:", result.count)
    print("Error:", result.error)


async def main():
    await test_tool()


if __name__ == "__main__":
    asyncio.run(main())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant