Skip to main content
Glama

mcp-stargazing

Calculate the altitude, rise, and set times of celestial objects (Sun, Moon, planets, stars, and deep-space objects) for any location on Earth, with optional light pollution analysis.

Features

  • Altitude/Azimuth Calculation: Get elevation and compass direction for any celestial object.

  • Rise/Set Times: Determine when objects appear/disappear above the horizon.

  • Light Pollution Analysis: Load and analyze light pollution maps (GeoTIFF format).

  • Composite Planning: Build a ranked observing plan that combines place quality, weather, moonlight, and top targets.

  • Tool Discovery: Inspect registered MCP tools programmatically through get_tool_catalog.

  • Code Execution Ready:

    • Serializable Returns: All tools return JSON-serializable data (ISO strings for dates), making them directly usable by LLMs.

    • Pagination: analysis_area supports paging (page, page_size) to handle large datasets efficiently.

    • Stable Result Handles: analysis_area.resource_id identifies the cached non-pagination query so agents can fetch multiple pages safely.

    • Standardized Responses: Successful calls return { "data": ..., "_meta": ... }; business validation failures return { "error": ..., "_meta": ... }.

  • Performance:

    • Async Execution: Non-blocking celestial calculations.

    • Caching: Intelligent caching for Simbad queries and regional analysis.

    • Proxy Support: Native support for HTTP/HTTPS proxies (useful for downloading astronomical data).

  • Time Zone Aware: Works with local or UTC times.

  • Data Driven: Integrated database of 10,000+ deep-sky objects (Messier & NGC) for smart recommendations.

Related MCP server: chuk-mcp-celestial

Installation

This project uses uv for dependency management.

Local Installation

  1. Install uv:

    pip install uv
  2. Sync dependencies:

    uv sync

    This will create a virtual environment in .venv and install all dependencies defined in pyproject.toml.

  3. Activate the environment:

    source .venv/bin/activate
  4. Initialize Data (Required for Nightly Planner): This downloads the latest Messier and NGC catalog data to src/data/objects.json.

    python scripts/download_data.py

    Note: If you are behind a firewall, ensure HTTP_PROXY env var is set before running this script.

Docker Installation

You can also run the server using Docker, which handles all dependencies and data initialization automatically.

Docker catalog downloads use the official simbad.harvard.edu mirror. Override with --build-arg SIMBAD_SERVER=simbad.cds.unistra.fr to use the Strasbourg service. Standalone downloads retain the astroquery default unless SIMBAD_SERVER is set. The selected server is tried first; failed connection/query batches retry once and switch to the other official mirror. Subsequent batches prefer the working mirror. Downloads use bounded, indexed TAP queries with explicit asynchronous execution, avoiding astroquery 0.4.11's uploaded-name query path (which drops async_job). An empty batch or failure of both mirrors aborts rather than publishing a partial catalog. Connection probes have a 5-second connect and 15-second read timeout; asynchronous jobs have a 180-second execution limit. macOS Python can inherit the system proxy even without proxy environment variables; use process-local NO_PROXY=* only when deliberately testing direct connectivity. A successful small query does not verify the full catalog download or CI build.

  1. Build the image:

    docker build -t mcp-stargazing .

    Note: If you are behind a proxy, pass the proxy URL during build:

    docker build --build-arg HTTP_PROXY=http://127.0.0.1:7890 -t mcp-stargazing .
  2. Run the container:

    # Basic run (MCP on :3001 + SPF web UI on :5001)
    docker run -p 3001:3001 -p 5001:5001 mcp-stargazing
    
    # With Environment Variables
    docker run -p 3001:3001 -p 5001:5001 \
      -e QWEATHER_API_KEY=your_key \
      -e STARGAZING_DB_CONFIG=your_db_config \
      mcp-stargazing
  3. Access:

    • MCP server → http://localhost:3001/shttp (for AI agent / MCP client)

    • SPF web UI → http://localhost:5001/ (stargazing place finder frontend)

Docker Architecture

The container runs two services managed by supervisord, both sharing the same Python virtual environment via uv run:

Container
├── supervisord
│   ├── program:mcp      → uv run mcp-stargazing --mode shttp --port 3001
│   └── program:spf-web  → uv run uvicorn server.main:app --port 5001
│
Dependency resolution (single venv, no duplication):
  stargazing-core>=0.2.3  ←  resolved once from PyPI
  stargazing-place-finder>=0.9.7
  fastapi, uvicorn, ...   ←  SPF's transitive deps

MCP Server Usage

Start the MCP server to expose tools to AI agents or other clients.

Agent-first direction

plan_stargazing_session is the preferred composite decision entry point for third-party agents. It accepts a place name, center/radius, or exact bounds; resolves Seestar S50, HOPE D60 + ASI2600MC Air, or custom optics configurations; keeps provider and database choices on the server; and returns a first-class decision, alternatives, exact score components, evidence, uncertainties, material missing inputs, ranking-reversal conditions, and next actions.

get_best_stargazing_plan and get_multiday_stargazing_plan remain registered as compatibility entries for existing bbox-first callers. The deterministic 10-scenario gate and representative Codex/Claude black-box smoke passed before the primary entry point was registered. New independent astronomy lookup tools remain deferred while development focuses on production evidence and planning reliability. Background tasks and the 1.0 contract freeze are already delivered.

Background area analysis has bounded execution, duplicate submission, cancellation, deadlines, retention, and paged result retrieval. The task tools activate optional task_id / progress metadata; running progress is unknown, and runtime loss requires resubmission. See Task Lifecycle for the workflow, limits, and recovery semantics.

See Third-party Agent Contract, Workspace Technical Map, and Agent Evolution Checklist. The current 21-tool routing and parameter review is recorded in Tool Surface Audit. Evaluation assets and the two-client evidence are under evaluations/. The evaluation guide also documents prospective forecast capture and independent-observation pairing, with explicit site, time, measurement-definition and lead-time limits.

The pre-1.0 public schema baseline records the existing tool schemas and detailed planning/area models. SDK and real tools/list tests detect contract drift before new tools are added.

The independent 1.0 contract and migration guide freezes all 21 tools, task models, detailed payloads, annotations, and envelope semantics without replacing that historical snapshot. The two bbox-first planners remain supported and have no active deprecation notice. Future removal requires at least 90 days, two subsequent minor releases, and a later major. The package version and response _meta.version are separate; this contract freeze is not a release. For a complete primary-planner client, save one of the guide's JSON requests and run:

uv run python examples/agent_planning_demo.py --request request.json --url http://localhost:3001/shttp

1. Environment Setup

Create a .env file or export variables:

# Weather tools
# 推荐:使用你账号专属的 API Host(公共域名将从 2026 年起逐步停止服务)
export QWEATHER_API_HOST="abc1234xyz.def.qweatherapi.com"

# 鉴权(二选一)
# 1) API KEY(兼容旧用法)
export QWEATHER_API_KEY="your_api_key"
# 2) JWT(推荐,更安全)
# export QWEATHER_JWT_TOKEN="your_jwt_token"

# 如需临时兼容旧公共域名(不推荐),显式开启:
# export QWEATHER_ALLOW_PUBLIC_HOST=1

# Geocoding(默认零付费、零 key)
# CJK 查询默认使用内置离线行政区划数据;未命中时回退 Photon / Nominatim。
# 可选 provider 顺序覆盖(全部支持:gazetteer, photon, nominatim, amap)
# export GEOCODER_PROVIDERS="gazetteer,photon,nominatim"

# 仅当你希望显式启用付费的 Amap 地理编码时才需要:
# export GEOCODER_PROVIDERS="amap,gazetteer,photon,nominatim"
# export AMAP_KEY="your_amap_key"

# Optional: Proxy for downloading astronomical data (Simbad/IERS)
# Highly recommended if you are in a restricted network environment
export HTTP_PROXY="http://127.0.0.1:7890"
export HTTPS_PROXY="http://127.0.0.1:7890"

2. Start Server

Streamable HTTP (SHTTP) mode (Recommended for most agents):

# Basic start
python -m src.main --mode shttp --port 3001 --path /shttp

# With proxy explicitly passed (overrides env vars)
python -m src.main --mode shttp --port 3001 --path /shttp --proxy http://127.0.0.1:7890

SSE mode:

python -m src.main --mode sse --port 3001 --path /sse

dev mode is no longer supported because current FastMCP versions no longer provide run_dev(). Use local, shttp, or sse.

3. Response Format

Successful business responses return data in a standardized JSON format:

{
  "data": {
    // Tool-specific return data
    "altitude": 45.5,
    "azimuth": 180.0
  },
  "_meta": {
    "version": "1.0.0",
    "status": "success"
  }
}

Business validation failures use the same envelope style:

{
  "error": {
    "code": "INVALID_TIME_FORMAT",
    "message": "Invalid time format: invalid-time-format",
    "details": {
      "time_string": "invalid-time-format"
    }
  },
  "_meta": {
    "version": "1.0.0",
    "status": "error"
  }
}

At the MCP protocol layer, tools/list and get_tool_catalog are kept aligned, and JSON-RPC request ids are preserved in both SHTTP and SSE transport tests.

Every tool's standard MCP description includes Use when, Do not use when, Requires, Returns, and Follow-up guidance. These explain the primary planner versus compatibility entries, facts versus observing decisions, synchronous versus background area searches, and common scope traps such as server-local time and constellation-center lookup. The wrapped catalog keeps its summary description and full docstring; explicit decorator descriptions are complete and take precedence. See the tool routing audit.

4. Available Tools

External AI callers should follow the planning result interpretation guide. The critical field, uncertainty, score and location boundaries are also in standard MCP descriptions, visible through tools/list without opening this README.

Composite planners score the requested night's hourly forecast, including low/mid/high cloud layers. Current conditions or daily averages never substitute for missing forecast hours. Open-Meteo requests 16 forecast days; actual usable coverage depends on each provider/model and field. Out-of-horizon spatial weather is omitted rather than snapped to the last model time. Missing/partial night coverage is explicit in notes/uncertainties; a degraded ranking is provisional. Weather evidence records the provider, interval, available hours and cloud aggregation. Weather base scores stay within 0–100; known forecasts with no usable cloud/rain/wind interval receive zero weather credit. Multi-night runs reuse raw place/weather retrievals, then evaluate each night separately; this reduces repeated I/O but does not guarantee a 60-second call.

location.center plus radius_km requests regional site selection, not a plan locked to that coordinate. Quietness/popularity adjustments require the corresponding preference flags; these scores are heuristics, not measured noise or crowd counts. night_window retains its documented civil-dark meaning (Sun below −6°), not astronomical darkness (−18°). Civil-dark duration is not a promise of usable deep-sky exposure time; verify twilight and access before departure.

  • get_celestial_pos: Calculate altitude/azimuth.

  • get_celestial_rise_set: Calculate rise/set times (Returns ISO strings). Use event_scope="calendar_day" for the historical full-local-day behavior, or event_scope="next_events" to find the first rise and first set after the supplied time, rolling across midnight when needed.

  • get_moon_info: Detailed moon phase, illumination, and age.

  • list_visible_planets: List of all planets currently above the horizon with positions.

  • get_constellation: Find the position (Alt/Az) of a constellation center.

  • get_nightly_forecast: Smart planner returning curated list of best objects to view tonight (Planets + Deep Sky) plus the local civil-dark night_window with dusk, dawn, duration, date, and timezone.

  • get_weather_by_name / get_weather_by_position: Fetch current weather with automatic retry on network failures.

    • Atmospheric state is included in summary.current.atmosphere and summary.hourly[*].atmosphere, with provenance and independent errors in summary.atmosphere_sources (also available in each provider's normalized data). The optional state contains PM2.5/PM10, NO₂/O₃/SO₂/CO, dust, AOD at 550 nm, visibility and boundary-layer height. CO uses μg/m³; AOD is dimensionless.

    • Atmospheric time is an explicit-offset model valid time. Current atmosphere uses its own hourly time, which can differ from parent weather observation_time. data_kind=model_estimate, temporal_role, per-field source keys and source metadata distinguish estimates from observations and retrieval from model run time.

    • Open-Meteo reuses the weather response and makes one additional CAMS global request. Exact valid-time joins preserve the shorter air horizon; missing values are unknown. Air failures do not discard valid weather. Explicit provider=qweather/wttr makes no hidden Open-Meteo call and currently has no atmosphere data.

    • Native CAMS global data is approximately 45 km and 3-hourly; hourly output may be interpolated. AOD is column extinction, not surface visibility; local boundary-layer height is not a pollution ceiling. No AQI, pollution attribution or new ranking score is calculated. See the reviewed contract extension.

  • get_local_datetime_info: Get current local time information.

  • get_tool_catalog: Discover available MCP tool metadata and parameters.

  • plan_stargazing_session: Preferred end-to-end entry point for deciding when, where, and what to observe across one to seven nights.

    • Inputs: a request object containing location (exactly one of place_name, center, or bounds), start_date, optional time_zone, nights, observation_style, equipment, candidate/target limits, and popularity preferences.

    • Equipment: stable presets are seestar_s50 and hope_d60_asi2600mc_air; advanced callers may use custom or override individual optical fields.

    • Target windows: equipment shortlists are checked individually with the public core scheduler inside the selected weather window (25° minimum altitude, 30-minute minimum run). Complete curves with no slot are excluded. Missing/invalid/partial curves remain explicitly unverified references; generic targets are also references. Read selected_target_window_check evidence and target_window_unverified / target_window_exclusions uncertainties. Independent slots may overlap; this is not a joint shooting plan or a Moon-separation, tracking, weather or exposure guarantee. Legacy transit_alt retains its source-specific meaning.

    • Returns: normalized request and resolved geography, a first-choice decision, ranked alternatives, traceable evidence, uncertainties, material missing_inputs, would_change_if conditions, and concrete next_actions.

    • Atmospheric evidence: weather evidence[*].facts.atmosphere summarizes model values within the selected observing window, with per-field missing samples, units and sources. It explains uncertainty without changing scores or eligibility; coverage is not validated transparency or seeing. See window evidence.

    • Routing: use this for a complete observing decision. Use weather, celestial, telescope, or place tools directly for focused fact lookups.

  • get_best_stargazing_plan: Build a ranked regional observing plan with candidate places, weather summaries, best observation windows, and top targets.

    • Inputs: south, west, north, east, time, time_zone, candidate_limit, target_limit, weather_provider, max_locations, min_height_diff, road_radius_km, network_type, observation_style, avoid_popular_spots, prefer_quiet_at_night, popularity_radius_km, db_config_path.

    • Candidate recall: candidate_limit is the number of ranked candidates returned. The service evaluates a bounded recall pool before final truncation, so a location with better weather can overtake a statically higher-ranked location.

    • Cost-aware evaluation: the recall pool receives a low-cost weather screen first; night-window and target-forecast evaluation then runs only for the strongest internal candidates before the final ranking.

    • Regional weather signal: when available, the server samples the stargazing-core spatial cloud-cover grid once for the whole bbox and blends it into regional comparison; a spatial-model failure degrades without failing the plan.

    • Returns: query, summary, and candidates, where query.analysis_resource_id links the plan back to the underlying neutral analysis_area search when available. When popularity preferences are enabled, MCP applies a single adjustment from the returned heuristic fields, surfaces those reasons in candidates[*].recommendation_reasons, and summarizes the top recommendation in summary.popularity_preferences_enabled, summary.primary_recommendation_drivers, and summary.recommended_location_reason_summary. Each candidate's score_breakdown.factor_contributions exposes the signed place, weather, popularity, and accessibility contributions used for ranking; explanatory reasons use the same active factors. The driver values form a stable enum: dark_sky, high_place_score, clear_weather, good_visibility, observation_style_fit, low_popularity_risk, quiet_at_night, and strong_targets.

    • Popularity ownership: all composite planners (single-night, multi-night, and plan_stargazing_session) request SPF place scores with avoid_popular_spots=false and prefer_quiet_at_night=false, preserving popularity_radius_km and the heuristic evidence. MCP alone applies the requested preferences; screening and final evaluation each start from the neutral score. Request echoes retain the user's preferences. To reproduce query.analysis_resource_id (or the primary planner's place evidence.resource_id), repeat the same area search with both preference flags disabled. Standalone analysis_area still forwards preferences to SPF and uses a separate cache entry when enabled.

    • Observation style: balanced preserves the default behavior. deep_sky emphasizes dark skies and low moonlight, visual raises the weather weight, planetary reduces moon penalties and prioritizes planets, and beginner also favors nearby road access.

    • Night window: each candidate includes night_window when civil darkness can be determined, with local date, civil dusk, following civil dawn, duration, and timezone. best_observation_window now represents a continuous dark-sky run when hourly data permits; start_time, weather fields, and the additive end_time, duration_hours, and quality_score are returned together.

  • get_multiday_stargazing_plan: Compare one to seven consecutive nights and return the best night and location across the region.

    • Inputs: south, west, north, east, start_date, time_zone, nights, plus the same candidate, weather, street-network, and observation-style options as get_best_stargazing_plan.

    • Returns: query, a cross-night summary with best_night_date, best_location_name, and best_score, and nights[] where each night contains its night_window, nightly plan, errors, and warnings.

    • Degradation: Weather or forecast sub-queries may degrade into summary.warnings and per-candidate notes, while the overall planning response remains successful.

  • get_telescope_targets: Match deep-sky objects against telescope optics — find what's best visible with your equipment.

    • Inputs: focal_length_mm, lon, lat, time, time_zone, plus optional optics fields such as aperture_mm, sensor dimensions, pixel size, reducer/Barlow factor, mount type, filter, and limit.

    • Returns: Ranked targets with visibility scores, altitude/azimuth, rise/set/transit data, FOV fit, surface brightness, mosaic guidance, and the normalized telescope configuration.

  • get_shooting_plan: Generate an optimized imaging schedule for a target, maximizing time above altitude threshold.

    • Inputs: the same telescope/observer fields as get_telescope_targets, plus optional limit and min_altitude.

    • Observation time: naive values use time_zone; ISO values with an explicit UTC offset preserve that instant, consistently with target matching.

    • Returns: targets, moon, a single-night plan with timed imaging slots, config, and total.

  • light_pollution_map: Query light pollution data for a bounding box area.

    • Inputs: south, west, north, east, zoom (default 10).

    • Returns: A grid of data points with Bortle class, brightness, and SQM values.

    • Unavailable data: points explicitly labelled as upstream defaults retain their coordinates, label, and overlay marker; their numeric and colour values are null, with a count in _meta.warnings. A default Bortle 5/SQM 20 is not source data. An unmarked or source-backed Bortle 5 is preserved; values alone are not used to infer a placeholder. This map does not change planning scores or establish dataset age.

  • analysis_area: Find best stargazing spots in a region.

    • Configuration invalidation: the production cache observes the explicitly bound STARGAZING_CONFIG path and file metadata. Changes invalidate old cached results while keeping query resource_id stable. Old task results expire; calculations begun under an older configuration cannot publish into the new context. Configuration changes/unverifiable metadata use structured CONFIGURATION_ERROR. This does not establish source-data age or monitor database/GeoTIFF contents.

    • Recomputation configuration: actual place computations reload the public SPF configuration and reuse analyzer resources only when effective values and parameters match. This fixes stale settings persisting even after a result-cache miss. Analyzer reload does not establish source-data age; result invalidation is handled separately by cache observation. See bridge freshness boundaries.

    • Cache lifetime: results use a one-hour monotonic elapsed TTL and a 128-entry LRU. Paging and cache hits do not renew the TTL; system-clock corrections do not extend or shorten it. resource_id identifies a query, not a source-data version or a freshness guarantee. See data freshness boundaries.

    • Inputs: south, west, north, east, max_locations, min_height_diff, road_radius_km, network_type, avoid_popular_spots, prefer_quiet_at_night, popularity_radius_km, db_config_path, page, page_size.

    • Returns: List of spots with pagination metadata (total, page, page_size, total_pages) and a resource_id that identifies the cached non-pagination query parameters. Each item may also include popularity heuristic fields such as static_popularity_risk_score, night_quiet_likelihood_score, and popularity_notes.

    • Validation: page >= 1, page_size >= 1, and popularity_radius_km > 0; invalid arguments return CONFIGURATION_ERROR.

Background area tools:

  • submit_area_analysis: accepts a request with bounds and place-search preferences; returns a task snapshot and normalized request. max_locations is 1–100. Deployment paths and execution budgets remain server policy.

  • get_area_analysis_task: accepts task_id; returns state, timestamps, failure details, execution_pending, and the successful result_revision when present. Polling a failed task succeeds as a status lookup; inspect data.state and data.failure.

  • cancel_area_analysis_task: accepts task_id; records idempotent cancellation. A running provider call retains its execution slot until it finishes, and its late results are discarded.

  • get_area_analysis_result: accepts task_id, page, and page_size; returns the existing AnalysisAreaResult pagination shape. It never silently recomputes missing data. Expired or replaced publications require resubmission.

Workflow: submit → poll until succeeded → fetch pages. Use plan_stargazing_session for a complete observing decision; these task tools are for raw place analysis. Existing synchronous analysis_area remains available.

The AI recovery acceptance report records ten read-only state/result questions completed by each of two clients, with auditable calls and explicit limits. It does not qualify AI submission/cancellation workflows or real provider uptime. The separate active-workflow report qualifies submission, status-confirmed pagination, cancellation, and active-query reuse in three isolated workflows per client. It uses real workers with a controlled provider; real provider uptime remains outside this acceptance gate.

5. Error Handling

All tools return JSON-serializable data and use structured error handling:

  • Standard Error Codes: INVALID_COORDINATES, INVALID_TIMEZONE, INVALID_TIME_FORMAT, MISSING_API_KEY, API_AUTH_FAILURE, API_TIMEOUT, API_RATE_LIMIT, EXTERNAL_API_ERROR, NETWORK_ERROR, CONFIGURATION_ERROR

  • Task Error Codes: TASK_NOT_FOUND, TASK_RUNTIME_CHANGED, TASK_CAPACITY_EXCEEDED, TASK_NOT_READY, TASK_UNAVAILABLE, TASK_RESULT_EXPIRED; see task recovery guidance.

  • Weather Tools: Include automatic retry logic for network failures (up to 3 attempts with exponential backoff)

  • Business Error Responses: Structured MCPError-derived payloads with actionable messages for calling agents

  • Protocol Tests: tools/list, get_tool_catalog, and SSE request-id behavior are covered by protocol-level tests

  • Validation: Input parameters are validated before processing with clear error messages

Examples

  • Background Area Analysis: python examples/background_area_demo.py

    • Submits, polls, and fetches a result page; accepts --task-id to resume polling or --cancel --task-id ... to cancel explicitly.

  • Nightly Planner: python examples/nightly_forecast_demo.py

    • Shows a curated list of planets and deep-sky objects visible tonight, accounting for moonlight.

  • Visible Planets: python examples/visible_planets_demo.py

    • Lists which planets are currently up.

  • Moon Info: python examples/moon_phase_demo.py

    • Prints a 30-day moon phase calendar.

  • Orchestration: python examples/code_execution_orchestration.py

    • Demonstrates a full workflow: Get time -> Get Celestial Pos -> Check Weather -> Find Spots.

    • Shows how to handle the standardized response format programmatically.

  • Pagination: python examples/pagination_demo.py

    • Demonstrates fetching large result sets page by page using the resource_id.

  • Telescope Targets: python examples/telescope_targets_demo.py

    • Ranks deep-sky targets for a RedCat51-style optical configuration.

  • Shooting Plan: python examples/shooting_plan_demo.py

    • Produces a time-ordered single-night imaging plan.

Project Structure

.
├── src/
│   ├── functions/            # Tool implementations grouped by domain
│   │   ├── celestial/        # Celestial calculations (pos, rise/set)
│   │   ├── metadata/         # Tool discovery surface (`get_tool_catalog`)
│   │   ├── planning/         # Single-night and multi-night composite planning
│   │   ├── telescope/        # Telescope target matching + shooting plan
│   │   ├── weather/          # Weather API integration
│   │   ├── places/           # Location and area analysis
│   │   └── time/             # Time utilities
│   ├── services/             # Transport-independent application services
│   │   └── planning.py       # Single-night and multi-night planning orchestration
│   ├── schemas/              # Pydantic v2 data models
│   ├── analysis_cache.py     # Caching logic for analysis results
│   ├── response.py           # Standardized response formatting
│   ├── server_instance.py    # FastMCP server instance (avoids circular imports)
│   ├── main.py               # Entry point and tool registration
│   ├── celestial.py          # Core astronomy logic (Astropy wrappers)
│   ├── placefinder.py        # Place-finder bridge logic
│   └── qweather_interaction.py # Thin QWeather URL wrappers
├── tests/                    # Unified test suite covering every registered tool
├── examples/                 # Runnable usage examples, including both telescope tools
├── docs/                     # Design docs and roadmap
├── Dockerfile                # Multi-stage Docker build
├── supervisord.conf          # Dual-service process manager config
└── pyproject.toml            # Project configuration and dependencies

Testing

Run the unified test suite:

uv run pytest -v tests/

Key tests include:

  • test_serialization.py: Ensures all tools return valid JSON with the correct schema.

  • test_integration.py: Mocks external APIs to verify the entire toolchain.

  • test_mcp_client.py: Verifies tools/list, tools/call, and SSE request-id protocol behavior.

  • test_structured_errors.py: Verifies business validation failures stay in the structured response envelope.

Cross-repository compatibility is checked by the reusable dependency-chain workflow. It tests stargazing-core → stargazing-place-finder → mcp-stargazing using baseline and candidate wheels, and blocks changes that add downstream failures.

Contributing

  1. Follow the Code Execution with MCP best practices.

  2. Ensure all new tools return standard JSON responses using src.response.format_response.

  3. Add tests in tests/ for any new functionality.

  4. Follow the repository agent conventions in AGENTS.md for all MCP tool and agent-facing changes.

  5. Refer to docs/agent-contract.md and docs/ROADMAP.md for the public agent direction and implementation roadmap.

Evidence-gated observing recommendations

Only candidates with the requested night's dated weather and a usable observation window compete for the selected session and its alternatives. Unknown weather is not replaced by an assumed score and is not classified as bad weather. Known forecasts without a usable window are also excluded, with a distinct reason. If none qualify, the primary planner returns decision=null, no alternatives, explicit uncertainties and next actions. Known place, sky and generic target facts remain in evidence entries whose source is unranked_planning_reference; facts.status is weather_unknown or no_usable_window. These entries have no session score or comparison to the decision. Equipment configuration is retained as evidence when supplied; reference targets are generic, not equipment-matched.

Compatibility planners retain reference candidates and notes, but leave recommended-place and best-night summary fields null when no session qualifies. Their numeric weather fields remain schema-compatible: absent weather has zero base score, contribution and weight as placeholders, not a claim of bad weather. Place weights are not renormalized. Reference candidate scores and positions must not be interpreted as an observing-session ranking. Successful execution still means only that the request was processed.

Deep-sky imaging quality gate

observation_style=deep_sky uses policy deep-sky-v1: each admitted forecast hour requires effective cloud cover <=25% (the maximum of total/low/mid/high layers), known precipitation probability <=0.20 and known wind <=20 km/h. A continuous run must last at least two hours after clipping to astronomical darkness (Sun below -18 degrees). Duplicate timestamps and gaps longer than one hour cannot manufacture a run. Unknown rain or wind is excluded, not filled with a favorable value. No astronomical-dark interval means no deep-sky window; civil darkness is never substituted.

These are versioned screening heuristics, not measured success probabilities or universal hardware limits. Other observing styles retain the existing more permissive weather gate. The public night_window remains civil darkness; only the deep-sky observation window is clipped. Existing response schemas are unchanged. Weather evidence records imaging_policy and astronomical_bounds; deep-sky window cloud/rain/wind fields report the worst admitted hour, while quality is a relative score. This still does not guarantee seeing, transparency, dew control, target altitude throughout the session, field access or a noise-free site.

Provider stage logs (planning_stage) record elapsed seconds, outcome and request identity; request-local cache reads (planning_cache_read) are separate. Concurrent stage durations must not be added as wall-clock latency. Timing uses a monotonic clock and never changes the MCP response envelope or writes into the stdio protocol stream.

Shared imaging presets and ranking

The HOPE hope_d60_asi2600mc_air public ID and configured optical values are preserved; its values are projected from the core equipment catalog also exposed by SPF. With core 0.2.3, equipment matching requires 30 consecutive sampled minutes above 25° in astronomical darkness, rather than midnight/dawn visibility. It penalizes oversized FOV coverage and short usable runs, and uses usable-window mean altitude and Moon interference. Pure open clusters use the pinned OpenNGC optical-size overlay. Civil-night curve fields retain their meanings. Scores remain relative heuristics, not calibrated SNR, weather clearance, or exposure predictions.

Available Tools

21 tools
analysis_areaA

Analyze a geographic area for suitable stargazing locations.

Use when: you need synchronous place candidates or cached pages for a fixed regional query. Do not use when: the search needs background polling/cancellation or a complete night plan. Requires: south/west/north/east bounds; keep search parameters fixed while changing pages. Follow-up: analysis_area with the same query for other pages; submit_area_analysis for background work; plan_stargazing_session for dates, weather, and target decisions.

This tool searches for dark, accessible locations with good viewing conditions. Results are cached based on search parameters. Server configuration changes can invalidate cached pages without changing resource_id. A configuration change during calculation returns structured CONFIGURATION_ERROR; resubmit after the configuration is stable. Cache lifetime is not source-data age.

Fast mode: Set road_radius_km=0 to skip road connectivity checks. This avoids OSMnx network downloads from Overpass API and is much faster — use it when you only need candidate locations with light pollution and elevation data, without road distance analysis.

Args: south, west, north, east: Bounding box coordinates. max_locations: Maximum number of candidate locations to find (before pagination). min_height_diff: Minimum elevation difference for prominence. road_radius_km: Search radius for road access. Set to 0 to skip road checks. network_type: Type of road network ('drive', 'walk', etc.). avoid_popular_spots: Penalize heuristically popular locations when ranking results. prefer_quiet_at_night: Favor locations that are likelier to quiet down at night. popularity_radius_km: Preference horizon for the popularity heuristics. db_config_path: Optional path to database config. page: Page number (1-based). page_size: Number of results per page.

Returns: Dict with keys "data", "_meta". "data" contains: - items: List of location results for the current page. - total: Total number of locations found. - page: Current page number. - page_size: Current page size. - resource_id: Cache key for the non-pagination search parameters.

Inputs: east (required), west (required), north (required), south (required), +10 more. Returns: object

cancel_area_analysis_taskA
Idempotent

Logically cancel queued/running area work and discard its late results.

Use when: a submitted area task is no longer needed and its late result must not publish. Do not use when: you want to delete cached data or interrupt another domain's operation. Requires: task_id returned by submit_area_analysis in the same server runtime. Returns: idempotent cancellation snapshot; an existing terminal state stays unchanged. A running provider call keeps its execution slot until it actually finishes. Follow-up: get_area_analysis_task to confirm state and execution_pending; wait for physical work to drain before considering resubmission.

Inputs: task_id (required). Returns: object

get_area_analysis_resultA
Read-onlyIdempotent

Page a successful area task's existing cached result without recomputing.

Use when: get_area_analysis_task reports succeeded and you need its original result pages. Do not use when: the task is queued/running and you only need to poll its state. Requires: the successful task_id, page >= 1, and page_size >= 1. Returns: cached items, pagination metadata, and resource_id with the task's publication version checked; this call never silently recomputes missing data. Follow-up: get_area_analysis_result with the same task_id for other pages; get_area_analysis_task for state; resubmit the normalized request on TASK_RESULT_EXPIRED.

Inputs: task_id (required), page, page_size. Returns: object

get_area_analysis_taskA
Read-onlyIdempotent

Poll an area task's state, deadline, failure, and normalized request.

Use when: you have a task_id and need execution state, failure, or remaining physical work. Do not use when: you need result pages; do not submit a new job merely to poll. Requires: task_id returned by submit_area_analysis in the same server runtime. Returns: task snapshot with state, failure, request, and execution_pending. Running progress is unknown; success does not guarantee the separate result cache still exists. Follow-up: get_area_analysis_result after success; cancel_area_analysis_task if unwanted. On TASK_RUNTIME_CHANGED, resubmit the original request rather than polling the old ID.

Inputs: task_id (required). Returns: object

get_best_stargazing_planA

Create a composite stargazing plan for a region and time.

Use when: an existing bbox-first integration needs ranked regional places for one night. Do not use when: starting a new intent-based integration, providing a place name, comparing several nights, or only requesting weather facts. Requires: south/west/north/east bounds, observation time, and timezone. Returns: data.query, ranked data.candidates with scores, windows, weather and targets, and data.summary; all within the standard response envelope. recommendation_score is a relative ranking, not a probability or go/no-go threshold. _meta.status=success can still contain summary.warnings and candidate notes. Only candidates with dated weather and a usable window can be recommended. Missing-weather references retain their place weight without renormalization; weather base score/contribution/weight are zero compatibility placeholders, not bad-weather facts. summary.recommended_location_name is null when none qualify. Missing night-hour weather is unknown, not clear; a null best_observation_window is not an all-night opening. night_window is civil darkness (Sun below -6 degrees), not astronomical darkness (-18 degrees) or guaranteed exposure time. Inspect the returned candidate coordinates; a regional result is not a fixed-site plan. Follow-up: plan_stargazing_session is preferred for new integrations; get_multiday_stargazing_plan preserves bbox-first comparison across nights.

Inputs: east (required), time (required), west (required), north (required), +14 more. Returns: object

get_celestial_posA

Calculate the altitude and azimuth angles of a celestial object.

Use when: you need one named object's position at a specified place and instant. Do not use when: you need an all-night target list or a complete observing decision. Requires: object name, observer coordinates, observation time, and its IANA timezone. Follow-up: get_celestial_rise_set for events; get_nightly_forecast for night targets; plan_stargazing_session for a complete observing decision.

Args: celestial_object: Name of object (e.g. "sun", "moon", "andromeda") lon: Observer longitude in degrees lat: Observer latitude in degrees time: Observation time string "YYYY-MM-DD HH:MM:SS" time_zone: IANA timezone string

Returns: Dict with keys "data", "_meta". "data" contains "altitude" and "azimuth" (degrees).

Inputs: lat (required), lon (required), time (required), time_zone (required), +1 more. Returns: object

get_celestial_rise_setA

Calculate the rise and set times of a celestial object.

Use when: you need one object's rise/set events. Choose calendar_day for the local date containing time, or next_events for the next rise and next set after time. Do not use when: you need a continuous observing window or a complete night plan. Requires: object name, observer coordinates, time, timezone, and the intended event scope. Follow-up: get_celestial_pos for position; plan_stargazing_session for observing windows.

Args: celestial_object: Name of object (e.g. "sun", "moon", "andromeda") lon: Observer longitude in degrees lat: Observer latitude in degrees time: Date string "YYYY-MM-DD HH:MM:SS" time_zone: IANA timezone string event_scope: "calendar_day" (default) finds the events in the local calendar day containing time. "next_events" finds the next rise and next set independently, rolling into following days when needed.

Returns: Dict with keys "data", "_meta". "data" contains "rise_time" and "set_time".

Inputs: lat (required), lon (required), time (required), time_zone (required), +2 more. Returns: object

get_constellationA

Get the position (altitude/azimuth) of the center of a constellation.

Use when: you need a named constellation's center position at a place and instant. Do not use when: you need to identify which constellation contains arbitrary coordinates, or to choose individual observing targets. Requires: constellation name, observer coordinates, time, and timezone. Follow-up: get_nightly_forecast for individual night targets; plan_stargazing_session for a complete observing decision.

Args: constellation_name: Name of constellation (e.g. "Orion", "Ursa Major") lon: Observer longitude in degrees lat: Observer latitude in degrees time: Observation time string "YYYY-MM-DD HH:MM:SS" time_zone: IANA timezone string

Returns: Dict with keys "data", "_meta". "data" contains name, altitude, azimuth.

Inputs: lat (required), lon (required), time (required), time_zone (required), +1 more. Returns: object

get_local_datetime_infoA

Retrieve the current datetime and timezone.

Use when: you need the server environment's current time and local timezone. Do not use when: you need time at a remote observing site or already have its timezone. Requires: no inputs; local means the server environment, not the user's observing site. Follow-up: use the observing site's explicit time_zone in celestial and plan_stargazing_session requests; do not infer it from the server timezone.

Returns: Dict with keys "data", "_meta". "data" contains "current_time" (ISO string).

Inputs: no named parameters. Returns: object

get_moon_infoA

Get detailed information about the Moon's phase and position.

Use when: you need lunar phase or illumination facts, with optional observer-local events. Do not use when: you need to rank observing sites or assess a target's overall suitability. Requires: time and timezone; supply both lat and lon for local position and rise/set. Follow-up: get_telescope_targets for equipment-aware targets; plan_stargazing_session for the combined effect of moonlight, weather, place, and observing goals.

When lat and lon are provided, also returns the Moon's local altitude, azimuth, moonrise, and moonset relative to the observer.

Args: time: Date string "YYYY-MM-DD HH:MM:SS" time_zone: IANA timezone string lat: Observer latitude in degrees (optional, for local position) lon: Observer longitude in degrees (optional, for local position)

Returns: Dict with keys "data", "_meta". "data" contains illumination, phase_name, age_days, elongation, earth_distance, and optionally altitude/azimuth plus moonrise/moonset (UTC unix timestamps).

Inputs: time (required), time_zone (required), lat, lon. Returns: object

get_multiday_stargazing_planA

Compare one to seven consecutive nights and recommend the best night and place.

Use when: an existing bbox-first integration compares one to seven consecutive nights. Do not use when: starting a new intent-based integration, querying nonconsecutive dates, more than seven nights, or checking background task status. Requires: south/west/north/east bounds, local start_date, timezone, and optional night count. Returns: normalized data.query, per-night plans, the best night, and summary; each night uses its own civil-dark window. recommendation_score is a relative ranking, not a probability or go/no-go threshold. _meta.status=success can still contain per-night errors, warnings and candidate notes. Compare the dated forecast hours for each night; do not reuse summary.current or summary.daily as night weather. Missing night-hour coverage is unknown, not clear. Civil darkness (Sun below -6 degrees) is not astronomical darkness (-18 degrees) or guaranteed exposure time; a null best_observation_window is not an all-night opening. Follow-up: plan_stargazing_session is preferred for new integrations; get_best_stargazing_plan for the compatible single-night regional detail.

Inputs: east (required), west (required), north (required), south (required), +15 more. Returns: object

get_nightly_forecastA

Get a curated list of best objects to view for the night.

Use when: place and night are known and you need general night targets and a night window. Do not use when: you need telescope-specific target matching or regional site selection. Requires: observer coordinates, time within the intended night, timezone, and optional limit. Interpretation: this is an astronomy forecast, not a weather forecast. Deep-sky altitude and score are evaluated at the supplied time; deep_sky.score sorts lower first and must not be compared with telescope suitability_score (higher first). The legacy transit_alt is an altitude estimate at that scoring time, not a separately solved meridian transit. night_window is civil darkness (Sun below -6 degrees), not astronomical darkness (-18 degrees) or guaranteed exposure time. Follow-up: get_telescope_targets for known optics; get_shooting_plan for an imaging schedule; plan_stargazing_session when place or night still needs comparison.

Args: lon: Observer longitude in degrees lat: Observer latitude in degrees time: Observation time "YYYY-MM-DD HH:MM:SS" inside the intended night. A bare date means local midnight and can belong to the previous evening's night. time_zone: IANA timezone string limit: Max number of deep-sky objects to return (default 20)

Returns: Standard envelope; data contains: - moon_phase: Moon details - planets: List of visible planets - deep_sky: Sorted list of deep sky objects (Messier/NGC) - night_window: Civil-dark window for the requested night

Inputs: lat (required), lon (required), time (required), time_zone (required), +1 more. Returns: object

get_shooting_planA

Generate a single-night astrophotography shooting plan.

Use when: optics, place, and night are fixed and you need matched targets in timed slots. Do not use when: you still need to choose a site or compare nights, or only need target ranks. Requires: focal length, observer coordinates, time, and the observing timezone (defaults to UTC); optional sensor, optical, and minimum-altitude settings. Follow-up: get_telescope_targets for target details; plan_stargazing_session to reconsider place, date, equipment preset, or observing constraints.

Runs match_telescope_targets then generate_shooting_schedule, returning targets + moon + timed shooting slots in one response. Interpretation: target altitude is at civil dusk, not the requested clock time; use altitude_curve or get_celestial_pos for another time. The schedule uses a civil-dark window (Sun below -6 degrees), not astronomical darkness (-18 degrees), and does not validate weather, access, obstructions or achieved integration time. Empty/null slots or exposure values are not an all-night imaging commitment.

Returns: data.targets[] — same structure as get_telescope_targets data.moon — {illumination, phase, moonrise, moonset, always_down, always_up, dark_fraction, altitude_curve} data.plan — {date, slots[{start_time, end_time, target_name}], total_exposure_min, moon_phase, moon_illumination, moon_delay_min} data.config — the TelescopeConfig used data.total — number of matched targets

Inputs: lat (required), lon (required), time (required), focal_length_mm (required), +12 more. Returns: object

get_telescope_targetsA

Recommend astrophotography targets for a telescope setup.

Use when: place, time, and optics are known and you need ranked deep-sky imaging targets. Do not use when: you only need naked-eye targets, a timed schedule, or a choice of sites. Requires: focal length, observer coordinates, time, and timezone; supply known sensor and optical details for matching. For equipment presets use plan_stargazing_session. Follow-up: get_shooting_plan for timed imaging slots; plan_stargazing_session if the observing place or night still needs comparison; get_celestial_pos for altitude at a specific clock time (the target altitude field is at civil dusk).

Given a telescope/camera configuration and observing location+time, returns a ranked list of deep-sky objects best suited for imaging. Interpretation: altitude is at civil dusk, not at the requested clock time; azimuth is at civil midnight. Use altitude_curve or get_celestial_pos for another time. transit_alt is the sampled peak within the civil-night window, in degrees; transit_time and curve time values are UTC Unix seconds. Null rise/set values mean no crossing was found inside that window, not that an object can never rise/set. suitability_score is a heuristic (higher is better), not a probability or weather clearance. Missing photometry is unknown; do not infer a seasonal visibility error from missing magnitude or from the civil-dusk altitude alone.

Args: focal_length_mm: Telescope focal length in mm (e.g. 250 for RedCat51) lon: Observer longitude in degrees lat: Observer latitude in degrees time: Observation time string "YYYY-MM-DD HH:MM:SS" time_zone: IANA timezone string (e.g. "Asia/Shanghai", "UTC") aperture_mm: Telescope aperture in mm (optional, for limiting magnitude) sensor_width_mm: Camera sensor width in mm (optional) sensor_height_mm: Camera sensor height in mm (optional) sensor_pixel_size_um: Camera pixel size in microns (optional) central_obstruction_pct: Central obstruction percentage (0-50) reducer_factor: Focal reducer factor (default 1.0) barlow_factor: Barlow/extender factor (default 1.0) mount_type: "equatorial" or "altaz" (default "equatorial") filter_type: Filter type — "Hα", "OIII", "SII", or None for LRGB limit: Maximum number of targets to return (default 20)

Returns: data.targets[] — ranked list, best first. Each target has: name, type, magnitude, catalog altitude (civil dusk, degrees), azimuth (civil midnight, degrees), dawn_altitude angular_size_arcmin, angular_size_min_arcmin, angular_size_pa_deg surface_brightness (mag/arcmin²), fov_fit_score, fov_fill_ratio suitability_score (0-100), mosaic_recommended, optimal_rotation_deg rise_time, set_time, transit_time (UTC unix timestamps), transit_alt (degrees) altitude_curve[{time, alt}] civil_dusk, civil_dawn, observation_time data.moon — {illumination, phase, altitude_curve, always_down, always_up, dark_fraction, moonrise, moonset} data.config — the TelescopeConfig used data.total — number of targets returned

Inputs: lat (required), lon (required), time (required), time_zone (required), +11 more. Returns: object

get_tool_catalogA

Get metadata for all registered MCP tools.

Use when: you need the wrapped catalog with full documentation and parameter summaries. Do not use when: your client only needs standard MCP tools/list discovery or a business result. Requires: no inputs; this call discovers tools and does not perform observing analysis. Follow-up: choose a tool from its use/do-not-use guidance; plan_stargazing_session is the primary entry for complete observing decisions.

Returns: Dict with keys "data", "_meta". "data.tools" contains tool metadata objects.

Inputs: no named parameters. Returns: object

get_weather_by_nameA

通过地点名称获取综合天气(当前 + 小时预报 + 日预报)。

Use when: you have a place name and need weather facts for that resolved location. Do not use when: you already have exact coordinates or need a complete observing decision. Requires: an unambiguous place name; use full administrative names for Chinese locations. Provider selection can remain at the server's default aggregation policy. Follow-up: get_weather_by_position for precise coordinates; plan_stargazing_session to combine weather with darkness, targets, and alternative observing sites.

Geocoding uses offline China gazetteer (CJK) → Photon → Nominatim cascade. Weather data is aggregated from multiple providers with graceful fallback. Open-Meteo needs no API key; network/provider failures can still occur. Atmospheric fields: summary.current.atmosphere and summary.hourly[*].atmosphere contain optional model estimates with their own valid time and per-field provenance. Inspect summary.atmosphere_sources for source failures and resolution. Missing/null means unknown. CAMS global is approximately 45 km and natively 3-hourly; hourly output may be interpolated. AOD is column extinction, not surface visibility. Boundary-layer height is above local model ground, not a pollution ceiling. No AQI or pollution attribution is inferred. Interpretation: summary.current is current weather, summary.daily is calendar-day aggregation, and summary.hourly contains timestamped forecasts. For a future observing night select the actual hourly timestamps across local midnight and inspect providers and source for failures/provenance. Missing/null or out-of-horizon hours are unknown, not clear weather. Forecasts are predictions, not observations of future conditions; do not assume all providers or fields cover the same dates.

中文地名提示:建议使用完整行政区划名称,如 "浙江安吉"、"杭州西湖区"。 内置离线行政区划数据会正确解析到对应的行政区(如安吉县),而非 POI 商铺。 需要精确定位时优先使用 get_weather_by_position(lat, lon)。

Args: place_name: 地点名称。中文请使用完整行政区划(如 "浙江省安吉县"),避免仅用2-3字短名。 provider: provider 模式,可选 all/qweather/open-meteo/wttr。

Returns: Dict,包含 keys: "data", "_meta"(成功时)或 "error", "_meta"(失败时)。

Inputs: place_name (required), provider.

get_weather_by_positionA

通过经纬度获取综合天气(当前 + 小时预报 + 日预报)。

Use when: you have precise coordinates and need current and forecast weather facts. Do not use when: you only have a place name or need ranked observing sites or night targets. Requires: latitude and longitude; provider selection can remain at the default policy. Follow-up: get_weather_by_name for place-name input; plan_stargazing_session to compare observing places and nights using weather and other evidence.

Weather data is aggregated from multiple providers with graceful fallback. Open-Meteo needs no API key; network/provider failures can still occur. Atmospheric fields: summary.current.atmosphere and summary.hourly[*].atmosphere contain optional model estimates with their own valid time and per-field provenance. Inspect summary.atmosphere_sources for source failures and resolution. Missing/null means unknown. CAMS global is approximately 45 km and natively 3-hourly; hourly output may be interpolated. AOD is column extinction, not surface visibility. Boundary-layer height is above local model ground, not a pollution ceiling. No AQI or pollution attribution is inferred. Interpretation: summary.current is current weather, summary.daily is calendar-day aggregation, and summary.hourly contains timestamped forecasts. For a future observing night select the actual hourly timestamps across local midnight and inspect providers and source for failures/provenance. Missing/null or out-of-horizon hours are unknown, not clear weather. Forecasts are predictions, not observations of future conditions; do not assume all providers or fields cover the same dates.

Args: lat: 纬度 lon: 经度 provider: provider 模式,可选 all/qweather/open-meteo/wttr。

Returns: Dict,包含 keys: "data", "_meta"(成功时)或 "error", "_meta"(失败时)。

Inputs: lat (required), lon (required), provider.

light_pollution_mapA

Get light pollution data for a specific area.

Use when: you need a bounding-box grid of light pollution measurements for a map or analysis. Do not use when: you need ranked places or a complete observing decision. Requires: south/west/north/east bounds and optional grid zoom. Returns: data.grid points with brightness, Bortle class, and SQM, plus bounds and zoom. Follow-up: analysis_area for synchronous place candidates; submit_area_analysis for background place analysis; plan_stargazing_session for an observing decision.

Returns a grid of light pollution data points including brightness, Bortle class, and SQM.

Args: south, west, north, east: Bounding box coordinates. zoom: Grid resolution zoom level (default: 10). Higher = more detailed.

Inputs: east (required), west (required), north (required), south (required), +1 more. Returns: object

list_visible_planetsA

Get a list of solar system planets currently visible (above horizon).

Use when: you need planets above the observer's horizon at a specified instant. Do not use when: you need all-night visibility, darkness guarantees, or equipment ranking. Requires: observer coordinates, time, and timezone; above-horizon visibility alone does not establish dark-sky or telescope observing conditions. Follow-up: get_celestial_pos or get_celestial_rise_set for a selected planet; plan_stargazing_session for a planetary observing decision.

Args: lon: Observer longitude in degrees lat: Observer latitude in degrees time: Observation time string "YYYY-MM-DD HH:MM:SS" time_zone: IANA timezone string

Returns: Dict with keys "data", "_meta". "data" is a list of planet dicts (name, altitude, azimuth).

Inputs: lat (required), lon (required), time (required), time_zone (required). Returns: object

plan_stargazing_sessionPlan Stargazing SessionA
Read-onlyIdempotent

Preferred end-to-end planning entry point for choosing when, where, and what to observe across one to seven nights.

Use when: you need a complete observing decision or comparisons of places and nights. Do not use when: you only need raw weather, celestial facts, or task status. Requires: request.location (place name, center/radius, or exact bounds) and start_date; timezone, one-to-seven nights, observing goal, equipment preset/overrides, and supported preference fields have explicit defaults or are optional. A center/radius is a regional search, not a plan locked to the center point. The radius becomes an approximate search box, not a strict circular distance filter. Quietness/popularity adjustments require the corresponding preference flags. Pass request as a JSON object, not a JSON string; inspect resolved_location before describing a candidate as the exact user-specified site. Returns: normalized request, decision, alternatives, evidence, uncertainties, missing inputs, ranking-change conditions, and next actions in the standard envelope. Weather evidence uses dated night-hour forecasts. Missing weather or no usable window excludes a candidate from decision and alternatives; unranked_planning_reference evidence retains known location/sky facts with weather_unknown or no_usable_window status. If none qualify, decision=null. Partial coverage remains provisional. The night_window remains civil darkness. For deep_sky, observation windows require at least two continuous astronomical-dark hours, cloud <=25%, rain probability <=20%, and wind <=20 km/h, with known rain/wind fields. These are heuristic screening limits, not verified imaging success probabilities. Interpretation: recommendation_score is a relative ranking, not a probability or an absolute go/no-go threshold. _meta.status=success means execution succeeded; decision=null means no selected session. A null observation_window means no usable window was established, not an all-night opening. Inspect evidence, uncertainties, missing_inputs and next_actions even on success. nightly_weather_unavailable and no_usable_observation_window are high-uncertainty warnings; long_range_forecast requires a forecast recheck near departure. Never replace missing night hours with summary.current or summary.daily, or infer a provider from weather wording. Civil darkness means Sun below -6 degrees, not astronomical darkness at -18 degrees; its duration is not guaranteed exposure time. Popularity/quiet scores are heuristics, not measured noise or calibrated crowd probabilities. When equipment is supplied, decision.targets already contains equipment-matched targets; use that list to answer the selected session's target question without a second lookup. Read selected_target_window_check evidence before claiming shootability: complete equipment curves with no 25-degree, 30-minute model slot in the selected weather window are excluded. Missing or partial curves and generic targets remain unknown references. Altitude-only checks have unknown Moon constraints; independent slots may overlap and do not verify per-slot Moon separation, tracking or actual exposure. Keep the returned target order; do not compare scores across generic and equipment rankings. This is a synchronous call and can exceed a client default deadline; a timeout does not establish that a background planning task exists. Follow-up: get_shooting_plan for an imaging schedule at the selected place/night; get_weather_by_position for updated weather facts. Inspect missing inputs and next actions before treating a degraded decision as final.

Inputs: request (required). Returns: object

submit_area_analysisA

Submit bounded background place analysis and return its task identifier.

Use when: a geographic place search may outlive one tool call and needs background control. Do not use when: you need a complete observing decision or only want to poll an existing task. Requires: request.bounds and optional place-search preferences; max_locations must be from 1 to 100. Returns: task snapshot with task_id, resource_id, state, and normalized request. Active duplicate queries share a task. Completed retries may use cached data. Follow-up: get_area_analysis_task to poll; get_area_analysis_result after success; cancel_area_analysis_task if no longer needed; plan_stargazing_session for decisions.

Inputs: request (required). Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 21 tools

    Disambiguation3/5

    Most low-level tools are clearly separated, but the planning surface has notable overlap: plan_stargazing_session, get_best_stargazing_plan, and get_multiday_stargazing_plan all produce observing recommendations with only legacy/preferred wording distinguishing them. Similarly, analysis_area versus submit_area_analysis is understandable from descriptions, but the set still asks the agent to choose among several closely related workflows.

    Naming Consistency4/5

    The names are overwhelmingly snake_case and follow predictable patterns such as get_*, list_*, submit_*, cancel_*, and plan_*. A few names break the verb_noun convention, notably analysis_area and light_pollution_map, but the overall convention remains readable and stable.

    Tool Count3/5

    At 21 tools, the server is somewhat heavy for the domain, and the count is inflated by legacy bbox-first planning endpoints and full background-task lifecycle tools. The breadth is justified by real subdomains such as weather, celestial facts, site search, equipment planning, and scheduling, but the total is borderline for easy tool selection.

    Completeness5/5

    The surface covers the apparent domain thoroughly: planning, weather by name and coordinates, celestial positions and rise/set events, moon and planet facts, constellation lookup, light pollution, synchronous and background site analysis, task polling/cancellation/result paging, equipment-specific targets, and shooting schedules. Background area-analysis lifecycle is complete enough to avoid obvious dead ends.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      A
      quality
      D
      maintenance
      Provides altitude-azimuth coordinates for celestial objects including planets, over 117,000 stars, and 14,000 deep sky objects based on system time and configurable location.
      3
      1
      -
    • A
      license
      A
      quality
      F
      maintenance
      Provides authoritative astronomical data including moon phases, solar eclipses, and sun/moon rise and set times using the US Navy API or offline Skyfield calculations. It enables users to query Earth's seasons and celestial events for any location and date.
      8
      1
      Apache 2.0