Skip to main content
Glama

Create a Data Set

dataset_create

Materialize a SQL query against one of your Data Sources into a cached Data Set table, refreshed on a schedule. Use this when a query is too slow to run live (the interactive budget is 60s, and a live query that runs anywhere near it spends the whole turn waiting), or when a dashboard needs filters — dashboard query parameters are supported on Data Sets only, because cached tables accept bind parameters and raw Data Sources do not. The Data Set is created immediately and its first build runs in the background; poll dataset_get for status until it reports 'ready'. The source connection must be one you own, not one shared with you. A SaaS source (postgres_list_connections marks it dataSetOnly) has no SQL: for it, sql is a JSON source-selection object — Google Sheets (public link) (type "google-sheets"): { "spreadsheetId": "<the id in the sheet's URL>", "sheet": "<tab name; optional, the first tab when omitted>" }; Airtable (type "airtable"): { "baseId": "app…", "tableId": "", "view": "" }; Salesforce (type "salesforce"): { "soql": "SELECT Id, Name, Amount FROM Opportunity" }; HubSpot (type "hubspot"): { "object": "contacts", "properties": "<optional comma-separated property names, e.g. email,firstname>" }; Google Sheets account (type "google-drive", find files with spreadsheet_list): { "spreadsheetId": "<the id spreadsheet_list returns, or the sheet's URL>", "sheet": "<tab name; optional, the first tab when omitted>", "range": "<optional A1 range whose first row is the header, e.g. A3:H>" }; Excel (Microsoft 365) account (type "microsoft-excel", find files with spreadsheet_list): { "driveId": "<the file's driveId from spreadsheet_list>", "itemId": "<the file's fileId from spreadsheet_list>", "sheet": "<worksheet name; optional, the first when omitted>", "range": "<optional A1 range whose first row is the header, e.g. A3:H>" }; Smartsheet account (type "smartsheet", find files with spreadsheet_list): { "sheetId": "<the sheet's fileId from spreadsheet_list, as text>" }. Those sources always refresh in full. Change a Data Set later with dataset_update; rebuild it now with dataset_refresh.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "name": "<name>",
      "connection": "<connection>",
      "sql": "<sql>"
    },
    "name": "dataset_create"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYesThe SQL to materialize. Runs against the Data Source on every refresh with a 120s budget, so it may be far heavier than an interactive query — aggregate here so the cached table is small and fast to read. For a SaaS source, the JSON source-selection object described above, as text.
nameYesName for the new Data Set. Must be unique to you.
syncKeyNoWith Sync: the unique key column rows are matched by. Omit to let it pick (the primary key, else a unique non-null column).
connectionYesName of the Data Source to read from, as returned by postgres_list_connections. Must be one you own.
descriptionNoOptional human-readable description.
refreshCronNo5-field UTC cron schedule. Mutually exclusive with refreshIntervalSeconds.
refreshModeNoHow a refresh brings the cached table up to date. "auto" (the default): Sync when the query allows it, otherwise reload every row — decided from the source at the first refresh, and again whenever the SQL changes. "sync": copy only rows that changed — needs a PostgreSQL source and a query over ONE table whose result includes its unique key and a changed-at timestamp (updated_at or similar); a query that cannot sync reloads every row and says why. Sync checks itself against full reloads and stops on any difference. "full": reload every row. "incremental": append rows past incrementalKey, never picking up edits or deletes — only for append-only tables; not for SaaS sources.
indexColumnsNoColumns to index on the cached table. Index the columns dashboard filters bind to — that is what makes a filtered read fast.
incrementalKeyNoWith refreshMode "incremental": the monotonically increasing column (an id or a created-at timestamp) a refresh reads past.
syncChangedColumnNoWith Sync: the timestamp column that changes whenever a row does. Omit to let it pick (updated_at, modified_at…).
freshnessWindowSecondsNoHow long a build stays fresh before a read triggers a lazy refresh. Defaults to 3600.
refreshIntervalSecondsNoRefresh every N seconds (minimum 300). Mutually exclusive with refreshCron. Omit both for manual refresh only.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the annotations (readOnlyHint=false, idempotentHint=false, destructiveHint=false) the description discloses the async lifecycle (created immediately, first build in background, poll until 'ready'), the ownership constraint (connection must be yours, not shared), and a source-specific behavior change (SaaS sources have no SQL and always refresh in full). No contradiction with the annotations — this is a non-destructive creation, which matches destructiveHint=false.

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 correctly: purpose, then when-to-use, then lifecycle, then the source-type catalog. No redundant sentences, but the inline JSON enumeration is dense and unbulleted, making it slow to scan for an agent that only needs the postgres path.

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?

With 12 parameters, no output schema and a background build, the description covers everything an agent needs to call it correctly: the required connection ownership, the sql duality (SQL vs JSON selection), the async polling contract, and the change/rebuild siblings. Nothing material is left to inference.

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 100%, so the baseline would be 3, but the description adds genuinely load-bearing content the schema only defers to: the per-source JSON shape of `sql` for google-sheets, airtable, salesforce, hubspot, google-drive, microsoft-excel and smartsheet, plus which sibling tool (spreadsheet_list) supplies the ids. Other params (syncKey, syncChangedColumn, refreshCron) receive no explanation beyond their schema text, which keeps this off a 5.

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 — 'Materialize a SQL query ... into a cached Data Set table' — and immediately explains the mechanism (cached, refreshed on a schedule). An agent can tell this apart from dataset_query (live reads), dataset_refresh (manual rebuild), and dataset_update (mutation of an existing set) 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?

Names two explicit conditions that select this tool: a query too slow for the 60s interactive budget, or a dashboard that needs filter parameters (which only work on Data Sets, not raw Data Sources). It also routes follow-up work: poll dataset_get for status, change later with dataset_update, rebuild now with dataset_refresh.

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