---
title: "Conventions"
description: "How nasa-mcp tools handle dates, units, URLs instead of bytes, paging and the 50 KB budget, the result envelope and errors."
type: Reference
tags:
  - conventions
  - dates
  - units
  - paging
  - errors
generated:
  by: "claude/opus-5.5"
  at: "2026-11-27T00:00:00Z"
sources:
  - id: design
    resource: "DESIGN.md"
    title: "nasa-mcp design"
    author: "team:nasa-mcp"
  - id: research
    resource: "RESEARCH.md"
    title: "nasa-mcp research notes (upstream services, 2026-11-27)"
    author: "team:nasa-mcp"
status: stable
---

<!--
SPDX-FileCopyrightText: 2026 Tyson Lee Swetnam
SPDX-License-Identifier: CC-BY-4.0
-->

# Conventions

## Names

Tools are named `nasa_<service>_<action>` (`^nasa_[a-z_]+$`, enforced at registration). Service
tokens are short: `neo` for NeoWs and `ssc` for SSCWeb; the others equal the service id. Every
description ends with a `Next:` sentence naming the natural next call.

## Dates and times

* Inputs take **`YYYY-MM-DD` (UTC)**. The server converts to each upstream's own format: YYMMDD for
  APOD, `yyyy-MM-dd` for DONKI, basic ISO 8601 (`20261127T000000Z`) for SSCWeb. SSCWeb's `start`
  and `end` take full ISO 8601 UTC times.
* Dates are validated before any request, because DONKI, EPIC and EONET silently ignore a bad date
  and return a default window, an empty list or everything.
* Defaults that the server fills in (today, a 30-day window, the latest image day) are listed in
  `resolved`.
* Output times are ISO 8601 UTC unless a field says otherwise: JPL close-approach times are TDB as
  published.

## Units

Numbers that upstream sends as strings (NeoWs, JPL SSD) are converted to numbers. Field names or
descriptions carry the unit: `missDistanceKm`, `relativeVelocityKmS`, `distAu`, `vRelKmS`,
`windSpeedMS`, `pressurePa`, energies in J and kt, Exoplanet radii in Earth radii and distances in
parsecs (the `units` map of `nasa_exoplanet_search`). 1 lunar distance = 0.00257 au.

## URLs, not bytes

Image, video, tile and data-file tools return **URLs**; the server never downloads or proxies
media. APOD `imageUrl`/`videoUrl`, EPIC archive PNG/JPG/thumbnail URLs, Image Library renditions,
GIBS WMS and Worldview URLs, Trek tile templates and sample tiles, OSDR download URLs. `http://`
links from upstream are rewritten to `https://`. Show them to the user, or let the client fetch
them.

## Paging and the result budget

* List tools take `offset`/`limit` (or the upstream's own `page`/`size`, documented per tool) and
  return `page = {total, returned, offset, limit, truncated, nextOffset, truncatedReason}`.
* A result is trimmed to a **50 000-byte budget** by dropping items from the tail of its main list
  (`truncatedReason: "budget"`, with a `nextSteps` line saying how to get the rest). A
  **200 000-byte hard cap** returns `result_too_large`.
* Some upstreams return every match at once (TechTransfer, Sentry, NHATS); the server pages those
  locally.

## The envelope

Every result has `resolved`, `notes`, `nextSteps` and
`source = {endpoints, via, cached, derived, citation}`:

* `source.endpoints` are the upstream URLs, **redacted** (`api_key=***`).
* `source.citation` is the credit line for the service. Quote it.
* `notes` carry service caveats that are never trimmed: InSight is a frozen archive, TLE is a
  third-party host, APOD images may be copyrighted, DEMO_KEY is in use.
* Result `_meta["io.nasa-mcp/upstream"] = {requests, cacheHits, apiNasaGovRateLimit?}`.

## Errors

Errors are tool results with `isError: true` whose text is
`{"error": {"code", "message", "details", "hint"?}}`; they carry no `structuredContent`. Codes:
`invalid_argument`, `not_found`, `auth_required`, `upstream_forbidden`, `rate_limited`,
`upstream_error`, `upstream_unavailable`, `feature_unavailable`, `not_available_in_http_mode`,
`query_too_large`, `result_too_large`, `download_limit_exceeded`, `unknown_tool`,
`internal_error`. Specifics go in `details.reason`.

Upstream quirks are mapped to these codes: JPL SBDB "not found" with HTTP 200 is `not_found`, and
its HTTP 300 "ambiguous" is `invalid_argument` with the candidate list; SSCWeb's HTTP-200
`StatusCode: ERROR` is `invalid_argument` with the `StatusSubCode`; the Exoplanet Archive's HTTP 400 VOTable error is
`invalid_argument` with the `QUERY_STATUS` text; OSDR `hits: 0` and a missing APOD day are
`not_found`; an api.nasa.gov 429 is `rate_limited` with `retryAfterS`.
