Skip to main content
Glama

nasa_gibs

Access and retrieve satellite imagery from NASA's Global Imagery Browse Services for specific dates and layers to visualize Earth observation data.

Instructions

Global Imagery Browse Services - satellite imagery

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
layerYesLayer name (e.g., MODIS_Terra_CorrectedReflectance_TrueColor)
dateYesDate of imagery (YYYY-MM-DD)
formatNoImage format (png, jpg, jpeg)
resolutionNoResolution in pixels per degree

Implementation Reference

  • Main handler function nasaGibsHandler that fetches GIBS satellite imagery, processes the image, registers it as a resource, and returns image data.
    export async function nasaGibsHandler(params: GibsParams) {
      try {
        const { date, layer, resolution, format, bbox } = params;
        
        // Default bbox if not provided
        const bboxParam = bbox || '-180,-90,180,90';
        
        // Construct the GIBS URL
        const baseUrl = 'https://gibs.earthdata.nasa.gov/wms/epsg4326/best/wms.cgi';
        
        // Convert format to proper MIME type format for WMS
        const mimeFormat = format === 'jpg' ? 'jpeg' : format;
        
        const requestParams = {
          SERVICE: 'WMS',
          VERSION: '1.3.0',
          REQUEST: 'GetMap',
          FORMAT: `image/${mimeFormat}`,
          LAYERS: layer,
          CRS: 'EPSG:4326',
          BBOX: bboxParam,
          WIDTH: 720,
          HEIGHT: 360,
          TIME: date
        };
        
        // Make the request to GIBS directly
        const response = await axios({
          url: baseUrl,
          params: requestParams,
          responseType: 'arraybuffer',
          timeout: 30000
        });
        
        // Convert response to base64
        const imageBase64 = Buffer.from(response.data).toString('base64');
        
        // Register the image as a resource
        const formattedDate = date || new Date().toISOString().split('T')[0];
        const resourceUri = `nasa://gibs/imagery?layer=${layer}&date=${formattedDate}`;
        
        addResource(resourceUri, {
          name: `NASA GIBS: ${layer} (${formattedDate})`,
          mimeType: `image/${format}`,
          // Store metadata as text (optional)
          text: JSON.stringify({
            layer: layer,
            date: formattedDate,
            bbox: bboxParam,
            width: 720,
            height: 360
          }),
          // Store the actual image data as a blob
          blob: Buffer.from(response.data)
        });
        
        // Return metadata and image data
        return {
          content: [
            {
              type: "text",
              text: `NASA GIBS satellite imagery for ${layer} on ${date || 'latest'}`
            },
            {
              type: "image",
              mimeType: `image/${format}`,
              data: imageBase64
            },
            {
              type: "text",
              text: `Resource registered at: ${resourceUri}`
            }
          ],
          isError: false
        };
      } catch (error: any) {
        console.error('Error in GIBS handler:', error);
        
        if (error.name === 'ZodError') {
          return {
            content: [
              {
                type: "text",
                text: `Invalid request parameters: ${error.message}`
              }
            ],
            isError: true
          };
        }
        
        return {
          content: [
            {
              type: "text",
              text: `Error retrieving GIBS data: ${error.message}`
            }
          ],
          isError: true
        };
      }
    }
  • Zod schema for validating input parameters to the nasa_gibs tool.
    export const gibsParamsSchema = z.object({
      date: z.string().optional(),
      layer: z.string(),
      resolution: z.number().optional(),
      format: z.enum(['png', 'jpg', 'jpeg']).optional().default('png'),
      bbox: z.string().optional()
  • src/index.ts:1543-1556 (registration)
    MCP server request handler registration specifically for the 'nasa/gibs' method, which dispatches to handleToolCall.
    server.setRequestHandler(
      z.object({ 
        method: z.literal("nasa/gibs"),
        params: z.object({
          layer: z.string(),
          date: z.string(),
          format: z.enum(['png', 'jpg', 'jpeg']).optional(),
          resolution: z.number().optional()
        }).optional()
      }),
      async (request) => {
        return await handleToolCall("nasa/gibs", request.params || {});
      }
    );
  • src/index.ts:458-461 (registration)
    Tool 'nasa_gibs' listed in the tools/manifest response.
      name: "nasa_gibs",
      id: "nasa/gibs",
      description: "Global Imagery Browse Services satellite imagery"
    },
  • Input schema for 'nasa_gibs' tool advertised in tools/list response.
      name: "nasa_gibs",
      description: "Global Imagery Browse Services - satellite imagery",
      inputSchema: {
        type: "object",
        properties: {
          layer: {
            type: "string",
            description: "Layer name (e.g., MODIS_Terra_CorrectedReflectance_TrueColor)"
          },
          date: {
            type: "string",
            description: "Date of imagery (YYYY-MM-DD)"
          },
          format: {
            type: "string",
            description: "Image format (png, jpg, jpeg)"
          },
          resolution: {
            type: "number",
            description: "Resolution in pixels per degree"
          }
        },
        required: ["layer", "date"]
      }
    },
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 mentions 'satellite imagery' without detailing aspects like rate limits, authentication needs, output format (e.g., image URL or data), or any constraints (e.g., date ranges, availability). This leaves significant gaps in understanding how the tool behaves.

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 very brief ('Global Imagery Browse Services - satellite imagery'), which is efficient and front-loaded. However, it's under-specified rather than concise, as it lacks necessary details for a tool with 4 parameters and no annotations, slightly reducing its effectiveness.

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 (4 parameters, no output schema, no annotations), the description is incomplete. It doesn't explain what the tool returns (e.g., image data, metadata), usage constraints, or how it differs from siblings, making it inadequate for an AI agent to use effectively without additional context.

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 parameters. The description adds no additional meaning beyond what's in the schema (e.g., no examples beyond the schema's layer example, no explanation of resolution units). This meets the baseline for high schema coverage.

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 'Global Imagery Browse Services - satellite imagery' states the general domain (satellite imagery) and service name but lacks a specific verb or action. It doesn't clearly distinguish what this tool does (e.g., fetch, retrieve, browse) compared to sibling tools like 'nasa_images' or 'nasa_epic', making the purpose vague.

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 any context, prerequisites, or exclusions, leaving the agent without direction on selecting this tool over similar ones in the sibling list.

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