Capability and script contracts#

Host capabilities#

The GeoNeMo MCP server provides catalog_search and retrieval_search. The reference NeMo agent host adds catalog_extent and catalog_overlap; another host provides them only if it says so. When one is not advertised, report that the capability is unavailable.

  • catalog_search accepts one collection, bounded text, a WGS84 bounding box, exact metadata filters, and a result limit within the request’s host-owned project scope. It returns authoritative {collection, record_id} references plus whatever footprints, WGS84 envelopes, completeness fields, and warnings the service provides. Use scalar filters.filename for a case-sensitive exact basename with no text. Complete .SAFE names in text also use literal filename lookup, with no semantic fallback. Other text uses literal catalog text matching. Similarity uses the separately advertised retrieval_search capability with an explicit corpus, profile and exact space IDs. Exact scalar filters support filename, scene_id, platform, sensor, modality, product, location_id and port; arbitrary metadata keys and filename operators are unsupported. Follow all returned cursors, exact-read the selected ID, and verify its metadata.filename. Multiple IDs require disambiguation; errors are not absence. Zero matches establish no exact filename only in the searched collection, never from unrelated neighbors. Use authoritative acquisition times; a filename timestamp may omit fractional seconds.

  • catalog_extent reads the authoritative collection summary and runs the pinned extent procedure. It returns both [west, south, east, north] and named bounds, an envelope polygon, and an explicit warning that the union envelope is not continuous imagery coverage. It performs no reverse geocoding and supplies no place name.

  • catalog_overlap accepts one authorized collection, bounded search constraints, and either hotspots or aligned-sets. The host searches authoritatively, converts only the exact returned records to script input, rejects records from another collection, and runs the pinned deterministic procedure; it does not expose general shell execution.

  • Before retrieval, the host verifies discovery advertises the required media route and uses typed inspection contract 2.x to select an exact non-companion asset. Bounded retrieval preserves MediaContent.asset_id, media type, role, and georeferencing method. The host owns service URLs, authentication, checksum verification, size limits, and disclosure policy.

analyze_bbox_overlap.py#

Pipe one JSON object to stdin. The extent command accepts one authoritative collection name, record count, and WGS84 bounds; it emits named coordinates and envelope-only semantics.

For the overlap commands, records contains two through 200 unique collection, record_id, exactly one of bbox or GeoJSON geometry, and optional modality, product, and sensor. Polygon and MultiPolygon geometry is deterministically reduced to its envelope. Bboxes are non-antimeridian WGS84 [west,south,east,north] arrays. Unknown keys are rejected.

  • extent accepts no fields beyond collection, record_count, and bounds.

  • hotspots accepts minimum_count (2–200) and limit (1–100).

  • aligned-sets accepts set_size (2–8), minimum_coverage, minimum_iou, minimum_area_km2, required attribute arrays, rank_by, limit, and max_combinations.

The script returns a common JSON envelope. Its GeoJSON contains catalog-envelope evidence only. Every command that emits a bbox also emits bbox_order: ["west", "south", "east", "north"]. Each hotspot also emits location, and each aligned set emits common_location, with explicit west_longitude, south_latitude, east_longitude, and north_latitude bounds, a named center, and deterministic display_location. The display string presents latitude/N-S before longitude/E-W so callers do not need to relabel positional GeoJSON coordinates. Both commands retain only the exact requested top limit while scanning; aligned-sets evaluates at most 100,000 combinations and never materializes every matching set. When the combination bound is reached, truncated is true and exactness is best_evaluated.

select_region_footprints.py#

Run bounds with {region: <GeoJSON>} to validate a non-antimeridian WGS84 Polygon or MultiPolygon and derive its [west, south, east, north] envelope. Run select with region and at most 50 authoritative records, each containing only collection, record_id, and geometry. The host retrieves those records; a model cannot replace the candidate page.

Selection requires positive-area intersection of the actual polygons. Boundary contact alone does not qualify. Polygon holes and MultiPolygon components are retained. Invalid target geometry fails the request. Missing or invalid source footprints appear in unverified, not excluded. Outputs preserve identities unchanged and report candidate, matched, excluded and unverified counts. Source footprints do not establish observable pixels or cloud-free coverage. Each geometry is bounded to 4,096 two-dimensional vertices; input is bounded to 4 MiB. The Shapely dependency is exact and locked. The script performs no service, network, or file access.

When the host advertises catalog_search.region, it uses bounds before catalog retrieval, then select on the exact returned page. region and bbox are mutually exclusive. The host’s next_cursor still refers to the original candidate page: a page may select no records and still return has_more: true. Follow every non-null cursor, including "NA", unchanged. Catalog totals describe envelope candidates, not exact polygon matches or completed processing. Durable continuation, detector waits, retries and wakeups remain GeoNeMo server responsibilities.

verify_raster_overlap.py#

Run verify --staging-dir DIR and pipe a JSON object containing two to twelve unique raster entries. Each entry has collection, record_id, asset_id, media_contract_version compatible with 2.x, media_type, media_role, georeferencing_method, and a relative file beneath DIR. The media type must match the file extension; companion assets and unsupported georeferencing are rejected. Optional max_pixels bounds the equal-area analysis grid. Files must be regular, non-symlink GeoTIFF or JPEG 2000 rasters.

Inputs must use the extension-matched GTiff or JP2OpenJPEG driver and be self-contained. The script disables GDAL PAM, directory discovery, VRT/network drivers, curl-backed extensions, and external georeferencing; conventional external mask, overview, auxiliary, and world-file sidecars are rejected. The script reprojects at most 16 bands per source and rejects any source above 50 million pixels or 50 million total pixel-band samples before decoding masks. It reprojects dataset-valid masks to a bounded EPSG:6933 grid spanning the union of authoritative extents with nearest-neighbor resampling and reports intersection area, union area, overlap IoU, and overlap coverage per raster. This proves mask overlap at the reported grid resolution; it does not prove registration, cloud-free content, or semantic similarity. complete requires valid cells from every raster. unusable means at least one raster has zero valid analysis-grid cells; zero metrics in that state do not establish the absence of observable overlap.