run_query
Run raw ADQL queries against NASA's Exoplanet Archive for complex astronomy searches—aggregation, joins, and spatial cone searches beyond basic planet filters.
Instructions
Execute a raw ADQL query against the NASA Exoplanet Archive TAP service. ADQL is an SQL-like language for astronomical databases. Use this for complex queries that search_planets cannot handle: GROUP BY aggregations, COUNT statistics, JOINs across tables, spatial/cone searches, queries against non-planet tables (toi, transitspec, emissionspec, ml, Kepler KOI tables), or any query needing full SQL-like flexibility.
Use list_tables and list_columns first to discover available tables and column names. Common tables: pscomppars (one row per confirmed planet), ps (all published solutions — filter with default_flag=1 for one per planet), stellarhosts (host stars), toi (TESS candidates), transitspec (atmospheric transit spectra), emissionspec (atmospheric emission spectra), ml (microlensing planets).
ADQL supports: SELECT, WHERE, ORDER BY, GROUP BY, COUNT, JOIN, LIKE, BETWEEN, IS NULL, IS NOT NULL, TOP, mathematical functions, and spatial functions (CONTAINS, POINT, CIRCLE for cone searches). Example cone search: WHERE CONTAINS(POINT('ICRS',ra,dec), CIRCLE('ICRS',291.0,48.0,5.0))=1
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum rows to return (1-1000, default 100). Applied as maxrec parameter. You can also use TOP N in your ADQL SELECT clause. | |
| query | Yes | ADQL query string. Example: SELECT pl_name, pl_rade, pl_bmasse FROM pscomppars WHERE pl_rade < 2 AND pl_bmasse IS NOT NULL ORDER BY pl_rade |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |