Sentinel-2 vessel-detection tool contracts#
Resolve one record#
Use catalog_list_collections with no arguments when the collection is unknown. It returns only
collections visible to the current host scope. Use catalog_search for bounded discovery:
{"collection":"sentinel-2-l2a","text":null,"filters":{"product":"S2MSI2A"},"bbox":[4.0,51.0,5.0,52.0],"when_from":"2026-09-11T00:00:00Z","when_to":"2026-09-12T00:00:00Z","cursor":null,"limit":20}
For a filename copied from the collection viewer, resolve it literally:
{"collection":"sentinel-sample","filters":{"filename":"S2A_MSIL2A_20260807T065321_N0512_R020_T39RZH_20260807T120617.SAFE"},"limit":20}
Omit text for this lookup. filters.filename is an exact, case-sensitive scalar basename;
no wildcard or operator is accepted. A complete .SAFE name in text also matches literally
without similarity fallback. Other text queries use literal catalog text matching.
Use shared retrieval separately for similarity; a neighbor does not prove a named image is absent. Exact scalar search
filters support filename, scene_id, platform, sensor, modality, product, location_id,
and port; arbitrary metadata filter names are not supported by this tool.
Follow next_cursor to collect all exact matches. Zero matches means no exact filename in the
searched collection, not no image anywhere; list authorized collections when the collection is
unknown. Errors or unavailable collections leave existence unverified. If multiple record IDs
match, preserve their identities and ask for the intended record; never choose a semantic neighbor.
Exact-read the selected returned ID and verify its metadata.filename matches before detection.
Do not invent the catalog ID from the SAFE name or derive acquisition-time equality filters from
its second-resolution timestamp; catalog timestamps may retain fractional seconds.
All optional fields may be omitted. limit is 1–500, the WGS84 bounding box is
[west,south,east,north], time bounds are UTC, and next_cursor is opaque. Search returns a page
of hits plus next_cursor and total; it does not replace an exact read. Confirm one selected hit
with:
{"collection":"sentinel-2-l2a","record_id":"S2A-L2A-001"}
catalog_get_record returns the exact sanitized record identity, metadata, geometry, and optional
acquisition time. Pass only its unchanged collection and record ID to the start tool. A public
catalog record does not prove that its private SAFE manifest is inference-ready. Production records
commonly use sensor: msi; use collection, provider collection, platform, and product metadata such
as S2MSI1C or S2MSI2A rather than requiring a literal sensor: sentinel-2. Choose the matching
L1C or L2A collection instead of applying the L2A example filter to all Sentinel-2 searches. The
asynchronous service controller validates the private manifest, and terminal status may report
INCOMPLETE_PRODUCT or SOURCE_CHANGED. Stop if discovery, exact read, or required host scope is
unavailable.
Run detection#
For a report from an existing run, exact-read status, verify Sentinel-2 and the selected source, and reuse its succeeded results. A render/view request does not require a new start call. If the run is still active, follow its lifecycle; on failure or cancellation preserve its structured error.
sentinel_2_vessel_detection_start accepts exactly one source reference:
{"collection":"sentinel-2-l2a","record_id":"S2A-L2A-001","idempotency_key":"case-001"}
Project identity and authorization come from the MCP request context. The tool does not accept
asset IDs, manifests, paths, endpoints, band lists, model names, thresholds, output locations, or
runtime controls. It verifies that the record is one supported Sentinel-2 product before GPU
dispatch and returns a run ID plus initial state. SENSOR_MISMATCH is terminal for this request;
do not switch tools automatically.
The idempotency key is 1–256 printable characters and scoped to the authorized project. Repeating the same key with the same request returns the same run. Reusing it with a different request is a conflict; choose a new key rather than altering or bypassing the request.
Call vessel_detection_get_status with:
{"run_id":"run-s2-001"}
Poll until succeeded, failed, or cancelled. Honor server retry guidance when returned;
otherwise wait five seconds between calls. Never busy-loop. Start successful result retrieval with:
{"run_id":"run-s2-001","limit":200}
limit defaults to 200 and cannot exceed 1000. The response contains total and next_cursor.
While next_cursor is not null, call vessel_detection_get_result again with the same run ID,
limit, and that cursor; stop only when it is null. A cursor is bound to its run and must never be
reused with another run. The complete immutable result retains the collection and record ID, source
hashes, model/runtime revisions, score meaning, machine-readable limitations, and WGS84 GeoJSON
Point geometry. Point coordinates are
[longitude, latitude]. A succeeded result with total: 0 means zero retained vessel candidates. A
failed or cancelled run is unknown, never zero. Internal storage paths never appear.
vessel_detection_cancel accepts a run ID. Cancellation is cooperative and may race with success;
read status again to learn the authoritative terminal state:
{"run_id":"run-s2-001"}
The service, not the caller or skill, resolves B02, B03, B04, and B08 at 10 metres; B05, B06, B07, B11, and B12 at 20 metres; and root processing metadata. It handles JP2 or GeoTIFF assets, enforces the fixed nine-band order, validates CRS and grids, aligns 20-metre bands to the B02 grid with the model-required method, applies quantification and baseline corrections, and performs fixed model normalization. SCL may be quality metadata but is not an inference input. Both supported L1C and L2A products use the service-owned, validated preprocessing path. Preserve limitations actually returned by the service; do not inject a generic L1C-to-L2A domain-shift warning.
Render a visual report#
Single-scene ship-finding reports default to local visual artifacts unless another format is
explicitly requested. Do not call vessel_detection_render_report. Read
media retrieval and viewing for discovery, exact record-ID encoding, selection,
receipts, completion checks, and host-owned localhost serving. After a
succeeded run and complete result pagination, use the authorized GeoNeMo media API origin
provided by the host or user. Do not infer an HTTP origin or port from the MCP URL.
Read every page of:
GET /v1/media/records/{collection}/{record_id}/product-manifest
Require contract 2.1 or newer within major 2, terminal pagination, the same canonical product
and inventory/tree hashes as the detection result, and exactly one downloadable 10-metre
measurement asset for each of B04, B03, and B02.
Download each selected asset by its exact asset ID:
GET /v1/media/records/{collection}/{record_id}/download?asset={asset_id}
Require a complete response and verify its media type, X-GeoNemo-Media-Asset,
X-GeoNemo-Media-Role, X-GeoNemo-Asset-SHA256, inventory hash, byte size, and computed SHA-256
against the manifest. The HTTP download role is manifest; the selected asset’s semantic role is
measurement. Validate these separately. Do not accept redirects to another origin, arbitrary
URLs, partial files,
previews, or assets from another record or inventory.
Create a new run-scoped directory beneath the user’s current workspace. Keep downloaded source
bands in that directory and create an initially absent report/ child. Invoke the applicable skill’s
pinned local renderer:
scripts/render_vessel_report.py render --staging-dir RUN_DIR --output-dir report
Pipe every unchanged result page and typed media-contract 2.x descriptor for the three locally
staged bands through stdin. The renderer rejects URLs, arbitrary paths, symlinks, external
sidecars, source mismatches, incomplete pagination, and changed checksums. Its
vessel-detection-visual-report/v1 manifest records the renderer and pinned library versions and
hashes every input page, band, and output artifact.
The renderer derives a fixed per-band 2nd–98th percentile B04/B03/B02 display stretch on a bounded
sampling grid, then writes overview.png on the native B04 grid. It draws only hollow circles and
restores an exact source-derived center window after all circles, so neither a candidate’s marker
nor a nearby marker obscures its center. The self-contained report.html supports pan, 1:1 view,
unrestricted pixel over-zoom, filtering, confidence sorting, and row-to-source-pixel navigation. It
shows every result candidate and the exact source, model, score, provenance, and limitation
metadata. Candidate sheets retain service-result order. They include at most the first 200 candidates;
this presentation bound never changes the detector total or truncate the HTML table. The images
and table are visualization only, not an independent detector or validation pass.
The agent owns the run directory and its retention. Keep it unless the user asks for cleanup; do
not publish, upload, or register the report with the GeoNeMo server. After verifying every output hash, give
the user a client-native clickable link to the absolute local report/report.html path. A media
retrieval, dependency, rendering, or local-link error is separate from the authoritative detection
state and must not turn a succeeded run into a failure. State that the requested report is
incomplete; a generic report, candidate count, or table alone is not a successful substitute.
Optional hosted managed bridge#
The direct GeoNeMo MCP schema above remains the interactive contract. The agent host may expose
an additional scoped adapter with work_id in place of the caller-generated detection key. This
is advertised separately and is never assumed available on the direct GeoNeMo server endpoint. Read
managed collection work for bounded stage execution and receipt
semantics. The host resolves keys and verifies collection, record, sensor, stage, and pinned
source/version before executing.