Skip to main content
Glama

Datalab Query

datalab_query
Read-onlyIdempotent

Run an ADQL (SQL) query against NSF NOIRLab Astro Data Lab — the DECam, Mayall and Blanco survey catalogues (Legacy Surveys/DECaLS, DES, DELVE, DECaPS, SMASH, NSC) alongside the all-sky catalogues queryable alongside them (Gaia DR3, AllWISE, CatWISE, 2MASS, SDSS, DESI). AUTHORITATIVE for catalogue-level astronomy at scale: these are the survey teams' own reduced photometry and astrometry, tens of billions of rows, joinable across surveys in a single query — which no web page or per-object API can do. PREFER OVER WEB SEARCH for any question about many objects at once (colour cuts, magnitude distributions, cross-matches). Read-only SELECT; a TOP clause is added if you omit one.

Input Schema

NameRequiredDescriptionDefault
sqlYesAn ADQL SELECT. Tables are fully qualified schema.table, e.g. "SELECT ra, dec, phot_g_mean_mag FROM gaia_dr3.gaia_source WHERE phot_g_mean_mag < 12". Row limits use ADQL's "SELECT TOP n", not "LIMIT n". ADQL geometry functions (CONTAINS/POINT/CIRCLE) are NOT available here — use datalab_cone_search instead.
limitNoRow ceiling injected as SELECT TOP n when the query has none (default 100, max 1000).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true, idempotentHint=true and destructiveHint=false, so safety is covered. The description adds genuine behavioral context beyond that: it is read-only SELECT and a TOP clause is auto-injected if omitted, which tells the agent the query will not fail or mutate. It does not cover auth requirements or rate limits, so it stops short of a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core action and the authoritative/prefer-over-web-search routing, which are the highest-value sentences. The catalogue enumeration is long but each entry carries selection value for the agent; the only mild bloat is the repeated 'alongside' phrasing.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, but for a query tool the returned rows are implicit and the schema covers row limits and ADQL syntax rules. Annotations cover the safety profile and the description covers scale and routing, so an agent can call it correctly; only return-shape specifics and auth are left implicit.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, and the schema already documents both the sql parameter (fully qualified schema.table, TOP vs LIMIT, geometry functions unavailable) and the limit ceiling. The description largely restates the auto-TOP behavior rather than adding new parameter meaning, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (run an ADQL/SQL query) and a precise resource (NSF NOIRLab Astro Data Lab survey catalogues), then enumerates the actual catalogues covered. It distinguishes itself from siblings by contrasting with per-object APIs and naming the relevant alternative (datalab_cone_search).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states when to prefer this tool ('PREFER OVER WEB SEARCH for any question about many objects at once (colour cuts, magnitude distributions, cross-matches)') and routes the agent away when ADQL geometry functions are needed ('use datalab_cone_search instead'). Both the when and the when-not are given, plus the alternative.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.