Skip to main content
Glama

jpl_nhats

Query NASA's NHATS database to find accessible Near-Earth Objects for potential missions using delta-V, duration, and launch window parameters.

Instructions

Human-accessible NEOs (Near-Earth Objects) data

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dvNoMinimum total delta-V (km/s). Values: 4-12, default: 12
durNoMinimum total mission duration (days). Values: 60-450, default: 450
stayNoMinimum stay time (days). Values: 8, 16, 24, 32, default: 8
launchNoLaunch window (year range). Values: 2020-2025, 2025-2030, 2030-2035, 2035-2040, 2040-2045, 2020-2045, default: 2020-2045
hNoObject's maximum absolute magnitude (mag). Values: 16-30
occNoObject's maximum orbit condition code. Values: 0-8
desNoObject designation (e.g., '2000 SG344' or '433')
spkNoObject SPK-ID (e.g., '2000433')
plotNoInclude base-64 encoded plot image

Implementation Reference

  • The `nhatsHandler` function implements the core logic of the `jpl_nhats` tool. It queries the JPL NHATS API at `https://ssd-api.jpl.nasa.gov/nhats.api`, transforms input parameters, fetches data using axios, creates resource URIs like `jpl://nhats/object/{des}`, stores the JSON response as a resource, and returns formatted content or error.
    export async function nhatsHandler(args: Record<string, any>) {
      try {
        // Base URL for the NHATS API
        const baseUrl = 'https://ssd-api.jpl.nasa.gov/nhats.api';
        
        // Validate parameters if needed
        // Parameters are fairly flexible in this API, so minimal validation is needed
        
        // Transform parameter names from underscore to hyphenated format
        const transformedParams = transformParamsToHyphenated(args);
        
        // Make the API request
        const response = await axios.get(baseUrl, { params: transformedParams });
        const data = response.data;
        
        // Create a resource URI that represents this query
        let resourceUri: string;
        
        if (args.des) {
          // Object mode - query for a specific object
          resourceUri = `jpl://nhats/object/${args.des}`;
        } else if (args.spk) {
          // Object mode - query for a specific object by SPK-ID
          resourceUri = `jpl://nhats/object/${args.spk}`;
        } else {
          // Summary mode - query for a list of objects with constraints
          const constraints = Object.entries(args)
            .map(([key, value]) => `${key}=${value}`)
            .join('&');
          
          resourceUri = `jpl://nhats/summary${constraints ? '?' + constraints : ''}`;
        }
        
        // Add response to resources
        addResource(resourceUri, {
          name: args.des || args.spk 
            ? `NHATS data for object: ${args.des || args.spk}`
            : 'NHATS summary data',
          mimeType: "application/json",
          text: JSON.stringify(data, null, 2)
        });
        
        // Format the response
        return {
          content: [{
            type: "text",
            text: JSON.stringify(data, null, 2)
          }]
        };
      } catch (error: any) {
        return {
          content: [{
            type: "text",
            text: `Error accessing JPL NHATS API: ${error.message}`
          }],
          isError: true
        };
      }
    }
    
    // Export default for dynamic imports
    export default nhatsHandler; 
  • src/index.ts:518-523 (registration)
    Registration of the `jpl_nhats` tool in the `tools/manifest` response, specifying its name, internal ID `jpl/nhats`, and description.
      name: "jpl_nhats",
      id: "jpl/nhats",
      description: "Human-accessible NEOs (Near-Earth Objects) data"
    },
    {
      name: "jpl_cad",
  • Detailed input schema and description for the `jpl_nhats` tool defined in the `tools/list` handler response, including parameters like `dv`, `dur`, `des`, `spk`, etc.
      name: "jpl_nhats",
      description: "Human-accessible NEOs (Near-Earth Objects) data",
      inputSchema: {
        type: "object",
        properties: {
          dv: {
            type: "number",
            description: "Minimum total delta-V (km/s). Values: 4-12, default: 12"
          },
          dur: {
            type: "number",
            description: "Minimum total mission duration (days). Values: 60-450, default: 450"
          },
          stay: {
            type: "number",
            description: "Minimum stay time (days). Values: 8, 16, 24, 32, default: 8"
          },
          launch: {
            type: "string",
            description: "Launch window (year range). Values: 2020-2025, 2025-2030, 2030-2035, 2035-2040, 2040-2045, 2020-2045, default: 2020-2045"
          },
          h: {
            type: "number",
            description: "Object's maximum absolute magnitude (mag). Values: 16-30"
          },
          occ: {
            type: "number",
            description: "Object's maximum orbit condition code. Values: 0-8"
          },
          des: {
            type: "string",
            description: "Object designation (e.g., '2000 SG344' or '433')"
          },
          spk: {
            type: "string",
            description: "Object SPK-ID (e.g., '2000433')"
          },
          plot: {
            type: "boolean",
            description: "Include base-64 encoded plot image"
          }
        }
      }
    },
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 of behavioral disclosure. It mentions 'human-accessible' data, which hints at usability but does not specify whether this is a read-only operation, what data format is returned, potential rate limits, or authentication needs. For a tool with 9 parameters and no annotations, 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 phrase: 'Human-accessible NEOs (Near-Earth Objects) data'. It is front-loaded and wastes no words, making it highly concise and well-structured for its limited content.

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 (9 parameters, no output schema, no annotations), the description is incomplete. It does not explain what the tool returns (e.g., data format, structure), how to interpret results, or behavioral aspects like error handling. This leaves significant gaps for an agent to use the tool effectively.

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?

The input schema has 100% description coverage, with detailed explanations for each parameter (e.g., 'dv' as minimum delta-V, 'plot' for including an image). The description adds no additional parameter semantics beyond what the schema provides, so it meets the baseline of 3 where the schema does the heavy lifting.

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 'Human-accessible NEOs (Near-Earth Objects) data' states the resource (NEO data) but lacks a specific verb indicating what action the tool performs (e.g., retrieve, filter, analyze). It distinguishes from siblings like 'jpl_cad' or 'nasa_neo' by specifying 'human-accessible' and 'NEOs', but the purpose remains vague without an action verb.

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. It does not mention any context, prerequisites, or exclusions, nor does it differentiate from sibling tools like 'jpl_sentry' or 'nasa_neo' that might also handle NEO data. This leaves the agent without clear usage instructions.

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