Skip to main content
Glama

link_query

Run a cross-dataset / cross-topic analytical SQL query that the per-topic query_dataset filters can't express — e.g. join education, Census, or immigration facts to a dimension (or another dataset) on shared geography (immigration and Census county topics share county_fips directly). READ-ONLY, SANDBOXED DuckDB: one SELECT (or WITH … SELECT); no DDL/DML/COPY/ATTACH/INSTALL/PRAGMA/SET/CALL; you may only read_parquet() the curated gold paths returned by link_tables (call it first and paste the snippets) — querying a file path directly is rejected. Joins use the keys from describe_dimension's link_keys (districts.district_census_id bridges to Census via the crosswalk — it is a school-district code, not a county FIPS, so a district is not 1:1 with a county). Results are row- and byte-capped and time-limited; truncated flags when capped — add aggregation or a tighter WHERE rather than dumping rows. NULL means suppressed, not zero. On a violation you get a self-describing error naming the offending token/path.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes
limitNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden, and it discharges much of it: read-only sandboxed DuckDB, single SELECT/WITH only, an explicit forbidden-verb list, required read_parquet on curated gold paths, row/byte caps with a `truncated` flag, time limits, NULL-as-suppressed semantics, and self-describing errors. That is unusually rich disclosure. It remains a 3 only because it does not state authentication/authorization requirements or the exact cap thresholds, and no annotations exist to cover that residual gap.

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 purpose and the disambiguating contrast to query_dataset before diving into constraints. Dense and long, but nearly every clause carries operational information; only the parenthetical on district_census_id versus county FIPS is a mild digression from what an agent needs to form the first call.

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

Completeness5/5

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

An output schema exists, so return values need not be explained, and the description still adds the non-obvious result semantics an agent needs: the `truncated` cap flag, NULL-as-suppression, and the format of violation errors. For a tool of this complexity, the definition is complete.

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

Parameters4/5

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

Schema coverage is 0%, so the description must compensate, and it does so thoroughly for the dominant `sql` parameter — single-statement restriction, forbidden operators, required read_parquet gold-path form, and join-key guidance. The optional `limit` parameter is never mentioned in the description or schema, leaving that one parameter's semantics and its interaction with the server-side cap undefined.

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 and resource ('cross-dataset / cross-topic analytical SQL query') and immediately distinguishes itself from the sibling query_dataset by naming the case it cannot handle (per-topic filters can't express joins). An agent can tell it apart from query_dataset and aggregate without opening any schema.

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?

Gives explicit sequencing and prerequisites: call link_tables first, paste its read_parquet snippets, and use describe_dimension's link_keys for joins. It names the rejected alternative (querying a file path directly) and directs capped-result cases toward aggregation or tighter WHERE. Explicit when/when-not routing.

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.

Resources