Skip to main content
Glama

nasa_osdr_files

Retrieve data files for NASA's Open Science Data Repository studies using accession numbers to access research datasets.

Instructions

NASA OSDR - Get data files for an OSD study

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accession_numberYesOSD study accession number (e.g., '87')

Implementation Reference

  • Main handler function osdrFilesHandler that executes the tool logic: validates accession_number, fetches files metadata from OSDR API, adds as resource, returns JSON.
    export async function osdrFilesHandler(args: OsdrFilesParams) {
      try {
        // Validate required parameters
        if (!args.accession_number) {
          throw new Error('Missing required parameter: accession_number must be provided.');
        }
        
        // Base URL for the OSDR API
        const baseUrl = 'https://osdr.nasa.gov/osdr/data/osd/files';
        const apiUrl = `${baseUrl}/${encodeURIComponent(args.accession_number)}`;
        
        // Make the API request using GET
        const response = await axios.get(apiUrl, {
          // OSDR API might require specific headers, e.g., Accept
          headers: {
            'Accept': 'application/json' 
          }
        });
        const data = response.data;
        
        // Create a resource URI 
        const resourceUri = `nasa://osdr/files/${encodeURIComponent(args.accession_number)}`;
        const resourceName = `OSDR Files for ${args.accession_number}`;
    
        // Add response to resources
        addResource(resourceUri, {
          name: resourceName,
          mimeType: "application/json", 
          text: JSON.stringify(data, null, 2)
        });
        
        // Format the response for MCP
        return {
          content: [{
            type: "text",
            text: JSON.stringify(data, null, 2)
          }]
        };
      } catch (error: any) {
        let errorMessage = `Error accessing NASA OSDR Files API: ${error.message}`;
        if (error.response) {
          // Include more detail from the API response if available
          errorMessage += `\nStatus: ${error.response.status}\nData: ${JSON.stringify(error.response.data)}`;
        }
        return {
          content: [{
            type: "text",
            text: errorMessage
          }],
          isError: true
        };
      }
    }
  • Type definition for input parameters: requires accession_number string.
    interface OsdrFilesParams {
      accession_number: string; 
    }
  • src/index.ts:1382-1394 (registration)
    Tool registration in tools/list handler, defining name 'nasa_osdr_files' and input schema matching the handler params.
      name: "nasa_osdr_files",
      description: "NASA OSDR - Get data files for an OSD study",
      inputSchema: {
        type: "object",
        properties: {
          accession_number: {
            type: "string",
            description: "OSD study accession number (e.g., '87')"
          }
        },
        required: ["accession_number"]
      }
    },
  • src/index.ts:1866-1886 (registration)
    Dynamic import and execution logic in handleToolCall for NASA tools, loads ./handlers/nasa/osdr_files.js and calls default export osdrFilesHandler.
    const handlerModule = await import(`./handlers/nasa/${endpoint}.js`);
    serverInstance?.sendLoggingMessage({
      level: "info",
      data: `Successfully imported handler module for: ./handlers/nasa/${endpoint}.js`,
    });
    
    // Try different potential handler function names
    const handlerFunctionName = `nasa${endpoint.charAt(0).toUpperCase() + endpoint.slice(1).replace(/-/g, '_')}Handler`; // e.g. nasaMars_roverHandler
    const simpleHandlerName = `${endpoint.replace(/-/g, '_')}Handler`; // e.g. mars_roverHandler
    
    const handlerFunction = handlerModule.default || 
                           handlerModule[handlerFunctionName] || 
                           handlerModule[simpleHandlerName];
    
    if (typeof handlerFunction === 'function') {
      serverInstance?.sendLoggingMessage({
        level: "info",
        data: `Executing handler function for ${endpoint}`,
      });
      return await handlerFunction(args);
    } else {
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 'Get data files' but doesn't disclose behavioral traits such as authentication needs, rate limits, response format, or whether it's read-only or mutative. This is inadequate for a tool with no annotation coverage.

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 key information ('NASA OSDR - Get data files for an OSD study'). There's no wasted text, making it appropriately sized and well-structured.

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 no annotations and no output schema, the description is incomplete. It doesn't explain what 'data files' entail (e.g., format, size, or structure of the return), leaving gaps in understanding the tool's behavior and output for a data retrieval operation.

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 the 'accession_number' parameter. The description adds no additional meaning beyond what's in the schema, such as examples or constraints, but the baseline is 3 since the schema handles the heavy lifting.

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 verb ('Get') and resource ('data files for an OSD study'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'nasa_cmr' or 'nasa_images', which might also retrieve NASA data, so it lacks sibling distinction.

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 prerequisites, exclusions, or compare it to other NASA-related tools in the sibling list, leaving usage context unclear.

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