MCP Tools
The server registers 7 MCP tools. The astroquery_* tools are generic: they can discover and call any archive function listed under Archives. The ads_* tools are optimized shortcuts for literature search.
Tool |
Summary |
|---|---|
List all available astroquery modules/services. |
|
List available functions for a module. |
|
Get detailed information about a specific function. |
|
Check authentication status for all services. |
|
Execute any astroquery function. |
|
Search NASA ADS and return a compact list of papers. |
|
Get details for a specific paper by bibcode. |
astroquery_list_modules
List all available astroquery modules/services.
Returns a list of modules like simbad, mast, ads, vizier, etc. with availability status.
Parameters
No parameters.
Returns
Dict with module_count and list of modules with name, class_path, available.
astroquery_list_functions
List available functions for a module.
Parameters
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
string or null |
|
Module to list functions for (e.g., ‘simbad’). If None, lists all functions from all modules. |
Returns
Dict with function_count and list of functions with name, kind, description, parameters. kind is “metadata” (results returned inline) or “retrieval” (fetches files, which are returned as artifact descriptors).
astroquery_get_function_info
Get detailed information about a specific function.
Parameters
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
string |
Module name (e.g., ‘simbad’) |
|
|
string |
Function name (e.g., ‘query_object’) |
Returns
Detailed function info including all parameters with types and descriptions.
astroquery_check_auth
Check authentication status for all services.
Returns diagnostic information about which services are authenticated, which environment variables are set, and any issues detected.
Parameters
No parameters.
Returns
Dict with authentication status for each service.
astroquery_execute
Execute any astroquery function.
Parameters
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
string |
Module name (e.g., ‘simbad’, ‘mast’, ‘ads’, ‘vizier’) |
|
|
string |
Function name (e.g., ‘query_object’, ‘query_region’) |
|
|
object or null |
|
Parameters to pass to the function. Special handling: |
|
integer |
|
Maximum rows kept per result table, for every module and function (default: 20). Each table reports row_count (rows returned), total_rows and truncated so callers can tell rows were dropped. Raise it, or narrow the query (smaller radius, filters, TOP in ADQL), when more rows are needed. |
Returns
Dict with success status, kind (“metadata” or “retrieval”) and serialized result (tables converted to dicts). Science products (FITS images and spectra, downloaded files, binary data, large arrays) are never inlined: in “result” they appear as {“artifact_id”, “filename”} references, and the response’s “artifacts” list describes each file with archive, product_id, filename, content_type, content_encoding, size_bytes, sha256, download_url, local_path, resource_uri and, for FITS files, fits_summary (HDU names/shapes and key header cards). Retrieval functions save files in a fresh folder of the server’s artifact store unless you pass an output folder.
Examples
# SIMBAD object query
astroquery_execute("simbad", "query_object", {"object_name": "M31"})
# SIMBAD region query
astroquery_execute("simbad", "query_region", {
"coordinates": {"ra": 10.68, "dec": 41.27},
"radius": {"value": 5, "unit": "arcmin"}
})
# MAST observations query
astroquery_execute("mast", "query_region", {
"coordinates": "M31",
"radius": 0.1
})
# Vizier catalog query
astroquery_execute("vizier", "query_object", {
"object_name": "M31",
"catalog": "II/246"
})
# Retrieval: SDSS images come back as artifact descriptors, not pixel data
astroquery_execute("sdss", "get_images", {
"coordinates": {"ra": 179.689, "dec": -0.454},
"band": "r"
})
ads_query_compact
Search NASA ADS and return a compact list of papers.
Returns only the chosen set of fields for each paper, so results stay short and easy to scan. Use this instead of astroquery_execute for most ADS queries.
Parameters
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
string |
ADS query string (e.g., “black hole X-ray”, “author:Smith”) |
|
|
“minimal” | “standard” | “extended” | “full” |
|
Which fields to return for each paper: |
|
integer |
|
Maximum number of papers to return (default: 10) |
|
string |
|
Sort order (default: “citation_count desc”) |
Returns
Dict with success status, count, results list, and metadata.
Examples
# Browse many papers quickly
ads_query_compact("NGC 3783", fields="minimal", max_results=20)
# Authors, journal and short abstracts
ads_query_compact("black hole X-ray variability", fields="standard")
# Add keywords and publication details
ads_query_compact("AGN feedback", fields="extended", max_results=5)
ads_get_paper
Get details for a specific paper by bibcode.
Use this after ads_query_compact to get full details about a specific paper of interest. Returns all metadata including full author list.
Parameters
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
string |
ADS bibcode (e.g., “2023ApJ…123..456S”) |
|
|
boolean |
|
Include the full abstract (default: True) |
Returns
Dict with success status and full paper details, including all authors.
Examples
# 1. Find papers with compact query
results = ads_query_compact("NGC 3783", fields="minimal", max_results=10)
# 2. Get bibcode of interesting paper
bibcode = results["results"][0]["bibcode"]
# 3. Get full details
paper = ads_get_paper(bibcode, include_abstract=True)
Server instructions
This text is sent to the SI client when it connects, to explain how to use the tools.
MCP server for astronomical data queries via astroquery.
## Coordinates (COMMONLY USED)
Astronomical coordinate operations via SkyCoord:
- Resolve names: astroquery_execute("coordinates", "from_name", {"name": "M31"})
- Get constellation: astroquery_execute("coordinates", "get_constellation", ...)
- Search nearby: astroquery_execute("coordinates", "search_around_sky", ...)
Returns rich coordinate data: RA/Dec (deg + HMS/DMS), Galactic, multiple frames
## ADS Queries (RECOMMENDED)
Literature search tools that return only the fields you need:
- `ads_query_compact()` - Search ADS and get a short list of papers
- `ads_get_paper()` - Get full details for a specific bibcode
Example ADS workflow:
1. ads_query_compact("NGC 3783", fields="minimal", max_results=10)
2. Pick interesting paper from results
3. ads_get_paper(bibcode, include_abstract=True)
## Generic Queries
Use these for other services or advanced queries:
- `astroquery_list_modules()` - See available services (SIMBAD, ADS, MAST, etc.)
- `astroquery_list_functions()` - See what functions a module provides
- `astroquery_get_function_info()` - Get detailed parameter info for a function
- `astroquery_execute()` - Call any astroquery function (returns ALL fields)
Example generic workflow:
1. astroquery_list_modules() -> see available modules
2. astroquery_list_functions("simbad") -> see SIMBAD functions
3. astroquery_get_function_info("simbad", "query_object") -> see parameters
4. astroquery_execute("simbad", "query_object", {"object_name": "M31"}) -> run query
Note: Generic astroquery_execute() for ADS returns every field ADS has for each paper.
Use ads_query_compact() instead for shorter results.
## Science products (FITS images, spectra, tarballs)
Functions are either kind="metadata" (catalog rows, product lists: returned inline) or
kind="retrieval" (download_*, get_images, get_spectra, get_product, ...: fetch files).
Retrieval results never contain file contents. Each file is saved on the server and described
in the response's "artifacts" list: archive, product_id, filename, content_type, size_bytes,
sha256, download_url (archive URL when known), local_path, resource_uri, and for FITS a short
header summary. Discover with metadata functions first (e.g. mast get_product_list), then
retrieve only what is needed. The file bytes are available via the resource_uri
(astroquery://artifacts/{artifact_id}) for the client, not for the model context.