Skip to main content
Glama

nasa_eonet

Access NASA's Earth Observatory Natural Event Tracker to retrieve data on wildfires, volcanoes, and other natural events with filtering by category, date range, and status.

Instructions

Earth Observatory Natural Event Tracker - natural events data

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNoEvent category (wildfires, volcanoes, etc.)
daysNoNumber of days to look back
sourceNoData source
statusNoEvent status (open, closed)
limitNoMaximum number of events to return

Implementation Reference

  • The nasaEonetHandler function that executes the core logic of the 'nasa_eonet' tool. It queries NASA's EONET API for natural event data based on parameters like category, days, source, status, and limit, handles fallbacks for empty results, registers JSON data as resources, and returns success/error messages.
    export async function nasaEonetHandler(params: EonetParams) {
      try {
        const { category, days, source, status, limit } = params;
        
        // Build the endpoint path
        let endpointPath = '/v3/events';
        const apiParams: Record<string, any> = {};
        
        // Add query parameters - using more default values to ensure we get results
        if (days) apiParams.days = days;
        if (source) apiParams.source = source;
        if (status) apiParams.status = status;
        if (limit) apiParams.limit = limit;
        
        // If no status is provided, default to "all" to ensure we get some events
        if (!status) apiParams.status = "all";
        
        // If no days parameter, default to 60 days to ensure we get more events 
        if (!days) apiParams.days = 60;
        
        // If a category is specified, use the category-specific endpoint
        if (category) {
          endpointPath = `/v3/categories/${category}`;
        }
        
        // Use direct axios call with the EONET-specific base URL
        const response = await axios.get(`${EONET_API_BASE_URL}${endpointPath}`, {
          params: apiParams,
          timeout: 10000 // 10 second timeout
        });
        
        // If we don't have any events, try again with broader parameters
        if (!response.data.events || response.data.events.length === 0) {
          // Reset to the main events endpoint for maximum results
          endpointPath = '/v3/events';
          
          // Use broader parameters
          const broadParams = {
            status: 'all',       // Get both open and closed events
            days: 90,            // Look back further
            limit: limit || 50   // Increase the limit
          };
          
          const broadResponse = await axios.get(`${EONET_API_BASE_URL}${endpointPath}`, {
            params: broadParams,
            timeout: 10000
          });
          
          // Register the response as a resource
          const resourceId = `nasa://eonet/events?days=${broadParams.days}&status=${broadParams.status}`;
          addResource(resourceId, {
            name: `EONET Events (${broadParams.days} days, ${broadParams.status} status)`,
            mimeType: 'application/json',
            text: JSON.stringify(broadResponse.data, null, 2)
          });
          
          return { 
            content: [{
              type: "text",
              text: `Used broader search criteria due to no events found with original parameters. Found ${broadResponse.data.events?.length || 0} events.`
            }],
            isError: false
          };
        }
        
        // Register the response as a resource
        const resourceParams = [];
        if (days) resourceParams.push(`days=${days}`);
        if (category) resourceParams.push(`category=${category}`);
        if (status) resourceParams.push(`status=${status}`);
        
        const resourceId = `nasa://eonet/events${category ? '/categories/' + category : ''}?${resourceParams.join('&')}`;
        addResource(resourceId, {
          name: `EONET Events${category ? ' (' + category + ')' : ''}`,
          mimeType: 'application/json',
          text: JSON.stringify(response.data, null, 2)
        });
        
        // Return the original result
        return { 
          content: [{
            type: "text",
            text: `Found ${response.data.events?.length || 0} EONET events.`
          }],
          isError: false
        };
      } catch (error: any) {
        console.error('Error in EONET handler:', error);
        
        return {
          isError: true,
          content: [{
            type: "text",
            text: `Error: ${error.message || 'An unexpected error occurred'}`
          }]
        };
      }
    }
  • Zod schema (EonetSchema) defining the input parameters for the nasa_eonet tool, exported as eonetParamsSchema.
    const EonetSchema = z.object({
      category: z.string().optional(),
      days: z.number().int().positive().optional(),
      source: z.string().optional(),
      status: z.enum(['open', 'closed', 'all']).optional(),
      limit: z.number().int().positive().optional()
    });
  • Import of the nasaEonetHandler in the setup file, likely where tool registration occurs through module imports in the MCP architecture.
    import { nasaEonetHandler } from './nasa/eonet';
  • Export of the parameter schema and type for the nasa_eonet tool.
    export const eonetParamsSchema = EonetSchema;
    export type EonetParams = z.infer<typeof eonetParamsSchema>;
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 only states it's a tracker for natural events data, without detailing whether it's read-only, has rate limits, authentication needs, or what the output format might be. This is insufficient for a tool with 5 parameters and no output schema, leaving key behaviors unspecified.

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 concise with a single phrase, front-loaded with the tool's name and purpose. However, it could be more structured by explicitly stating the action (e.g., 'retrieve' or 'search') to improve clarity without adding unnecessary length.

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

Completeness2/5

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

Given the complexity of 5 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain return values, error handling, or usage context, which are critical for an agent to invoke the tool correctly. More detail is needed to compensate for the lack of structured data.

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

Parameters3/5

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

Schema description coverage is 100%, so the input schema fully documents all 5 parameters. The description adds no additional meaning beyond the schema, such as explaining relationships between parameters or default behaviors. Baseline 3 is appropriate since the schema handles parameter documentation adequately.

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 'Earth Observatory Natural Event Tracker - natural events data' states the tool's purpose but is vague. It identifies the domain (natural events data) and hints at tracking, but lacks a specific verb like 'retrieve' or 'search' and doesn't distinguish from siblings like nasa_firms or nasa_donki. It's not tautological but lacks precision.

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. The description doesn't mention context, prerequisites, or exclusions, and sibling tools like nasa_firms or nasa_donki might overlap in natural event tracking without clarification. This leaves the agent without direction for tool selection.

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/ProgramComputer/NASA-MCP-server'

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