Skip to main content
Glama
podaac

CMR Model Context Protocol

Official
by podaac

get_datasets

Retrieve Earth science datasets from NASA's CMR using specific keywords, date ranges, and DAAC filters to streamline data discovery and access.

Instructions

Get a list of datasets form CMR based on keywords.

Args:
    startdate: (Optional) Start date of search request (like "2002" or "2022-03-22")
    stopdate: (Optional) Stop date of search request (like "2002" or "2022-03-22")
    daac: the daac to search, e.g. NSIDC or PODAAC
    keywords: A list of keyword arguments to search collections for.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
daacNo
keywordNo
startdateNo
stopdateNo

Implementation Reference

  • Core execution logic of the get_datasets tool: constructs search arguments from inputs, performs dataset search using earthaccess, logs count, and joins formatted dataset strings with separators.
    args = {}
    if keyword is not None:
         args['keyword'] = keyword
    if daac is not None:
         args['daac'] = daac
    if startdate is not None or stopdate is not None:
         args['temporal'] = (startdate, stopdate)
    
    collections = earthaccess.search_datasets(count=5,  **args )
    logger.debug(len(collections))
    
    #alerts = [format_dataset(feature) for feature in data["features"]]
    return "\n---\n".join([format_dataset(ds) for ds in collections])
  • Input schema defined by function parameters with types and default values, plus comprehensive docstring describing arguments and usage.
    async def get_datasets(
        startdate: str = None,
        stopdate: str = None,
        daac: Optional[str] = None,
        keyword: str= None) -> str:
        """Get a list of datasets form CMR based on keywords.
    
        Args:
            startdate: (Optional) Start date of search request (like "2002" or "2022-03-22")
            stopdate: (Optional) Stop date of search request (like "2002" or "2022-03-22")
            daac: the daac to search, e.g. NSIDC or PODAAC
            keywords: A list of keyword arguments to search collections for.
        """
  • cmr-search.py:33-33 (registration)
    Registers the get_datasets function as an MCP tool using the FastMCP decorator.
    @mcp.tool()
  • Supporting function to format a single dataset (feature) into a human-readable string, handling errors gracefully.
    def format_dataset(feature: dict) -> str:
        """Format an alert feature into a readable string."""
        props = feature
    
        logger.debug(props.concept_id())
    
        try:
            return f"""
    ConceptID: {props.concept_id()}
    Description: {props.abstract()}
    Shortname: {props.summary()['short-name']}
    """
        except Exception as e:
            logging.error(traceback.format_exc())
            #Currently an error in earthaccess that relies on `FileDistributionInformation` to exist will be caught here from the 'summary()' method. 
            # Returning empty string.
            return ""
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the tool retrieves data ('Get a list'), implying a read-only operation, but fails to detail critical behaviors like error handling, rate limits, authentication needs, or response format. This leaves significant gaps in understanding how the tool behaves in practice.

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

Conciseness4/5

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

The description is efficiently structured with a clear purpose statement followed by parameter explanations. Each sentence adds value without redundancy. However, the minor typo ('form' instead of 'from') slightly detracts from polish, and the parameter list could be more integrated into the flow rather than a separate block.

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's moderate complexity (4 parameters, no output schema, no annotations), the description is partially complete. It covers the purpose and parameters adequately but lacks details on behavioral traits, usage context, and return values. This makes it functional but insufficient for fully informed use without additional assumptions or trial-and-error.

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

Parameters4/5

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

The description adds meaningful context for all parameters beyond the schema, which has 0% coverage. It explains that 'startdate' and 'stopdate' are for search requests with format examples, 'daac' specifies the source to search, and 'keywords' are for searching collections. This compensates well for the lack of schema descriptions, though it could clarify parameter interactions or constraints.

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 tool's purpose: 'Get a list of datasets from CMR based on keywords.' It specifies the verb ('Get'), resource ('datasets'), and source ('CMR'), making it easy to understand what the tool does. However, with no sibling tools mentioned, there's no explicit differentiation from alternatives, preventing a perfect score.

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?

The description provides no guidance on when to use this tool versus alternatives, prerequisites, or context for its application. It only lists parameters without explaining the tool's role in workflows or decision criteria for invocation, leaving users to infer usage from the purpose alone.

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

Related 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/podaac/cmr-mcp'

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