Skip to content

query_data

Use query_data for read-only DuckDB analysis against project data sources

NameTypeRequiredDefaultDescription
project_nameAnnotated[str, Field(description='Name of the Bridge Town project whose data sources to query.')]Yes
sqlAnnotated[str, Field(description="SQL SELECT statement to execute against the project's registered data sources using DuckDB syntax.")]Yes
row_limitAnnotated[int, Field(description='Maximum number of rows to return. Defaults to 1000. Use to avoid overwhelming the context window with large result sets.')]No1000

Returns a structured object. Top-level fields:

  • columns (array<string>)
  • rows (array<array<string>>)
  • row_count (integer)
  • truncated (boolean)
  • sources (array<object>)

See the response example below for the full payload shape.

{
"name": "query_data",
"arguments": {
"project_name": "forecasts",
"sql": "SELECT month, revenue FROM actuals ORDER BY month LIMIT 3",
"row_limit": 1000
}
}
{
"columns": [
"month",
"revenue"
],
"rows": [
[
"2026-01-01",
100.0
],
[
"2026-02-01",
110.0
],
[
"2026-03-01",
121.0
]
],
"row_count": 3,
"truncated": false,
"sources": [
{
"source_name": "actuals",
"source_type": "parquet",
"tables": [
"actuals"
],
"snapshot_taken_at": null
}
]
}
  • Module: Data
  • Requires authentication via API token or Auth0 JWT.