Skip to main content
Glama
IBM
by IBM

stac_compute_index

Compute spectral indices like NDVI or NDWI from satellite imagery by automatically downloading required bands and applying the index formula, returning a single-band raster.

Instructions

Compute a spectral index (e.g., NDVI, NDWI) for a scene.

Automatically downloads the required bands, computes the index formula, and stores the result as a single-band float32 raster.

Supported indices:

  • ndvi: Vegetation (NIR - Red) / (NIR + Red)

  • ndwi: Water (Green - NIR) / (Green + NIR)

  • ndbi: Built-up (SWIR16 - NIR) / (SWIR16 + NIR)

  • evi: Enhanced Vegetation 2.5*(NIR - Red) / (NIR + 6Red - 7.5Blue + 1)

  • savi: Soil-Adjusted Vegetation ((NIR - Red) / (NIR + Red + 0.5)) * 1.5

  • bsi: Bare Soil ((SWIR16 + Red) - (NIR + Blue)) / ((SWIR16 + Red) + (NIR + Blue))

Args: scene_id: Scene identifier from a previous search index_name: Index to compute (ndvi, ndwi, ndbi, evi, savi, bsi) bbox: Optional crop bbox in EPSG:4326 [west, south, east, north] cloud_mask: Apply SCL-based cloud masking before computation (Sentinel-2 only) output_format: Output format - "geotiff" (default) or "png" output_mode: Response format - "json" (default) or "text"

Returns: JSON with artifact_ref and value_range for the computed index

Tips for LLMs: - Use stac_capabilities to see all available indices and required bands - Interpretation guide: - NDVI: >0.6 dense vegetation, 0.2-0.6 moderate, <0.2 bare/water - NDWI: >0 water, <0 land; useful for flood mapping - NDBI: >0 built-up, <0 natural land cover - EVI: similar to NDVI but corrects for atmospheric and soil effects - SAVI: like NDVI but better in areas with sparse vegetation - BSI: >0 bare soil, <0 vegetated - Only works for optical collections (Sentinel-2, Landsat) - Enable cloud_mask=True for cleaner results with Sentinel-2 data - For temporal change analysis, compute the same index on multiple dates and compare value_range

Example: ndvi = await stac_compute_index( scene_id="S2B_...", index_name="ndvi", bbox=[0.85, 51.85, 0.95, 51.92] )

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bboxNo
scene_idYes
cloud_maskNo
index_nameYes
output_modeNojson
output_formatNogeotiff
Behavior4/5

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

With no annotations, the description carries the full burden. It explains that the tool automatically downloads required bands, computes the index formula, and stores the result as a single-band float32 raster. It also describes the return format (JSON with artifact_ref and value_range). No contradictions with annotations (none provided). Could mention potential storage implications, but overall transparent.

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 somewhat lengthy with full formulas and tips, but it is well-structured: summary, supported indices list, args, returns, tips, example. Every section adds value, though a few details (like exact formulas) could be condensed if redundancy is avoided.

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

Completeness5/5

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

Given 6 parameters, no output schema, and no annotations, the description is comprehensive. It explains inputs, outputs, usage context, and provides interpretation tips. It feels complete for an AI agent to invoke correctly.

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

Parameters5/5

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

Schema coverage is 0%, so the description must compensate. It provides detailed parameter descriptions: scene_id, index_name with list and formulas, bbox format, cloud_mask explanation, output_format vs output_mode, and interpretation guides. This adds significant meaning beyond the raw schema, making it easy for an AI to use correctly.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool computes a spectral index like NDVI or NDWI for a scene. It specifies the verb 'compute' and the resource 'spectral index', distinguishing it from sibling tools like 'stac_download_bands' or 'stac_temporal_composite'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides usage context such as 'Only works for optical collections (Sentinel-2, Landsat)' and suggests using 'stac_capabilities' to see available indices. It advises enabling 'cloud_mask=True' for cleaner results and notes temporal change analysis. However, it does not explicitly state when not to use this tool or mention alternatives.

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/IBM/chuk-mcp-stac'

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