Skip to main content
Glama

Onboard a new data source, step 1: create a data spec and get upload URL(s)

onboard_data_source

First step of setting up a new data integration: creates a data spec. By default (sourceType "file") this returns presigned upload URL(s) for the sample file (and optional format/target-schema file). Creating the spec does NOT upload anything: you must PUT each file to its URL yourself (or have the user attach it so your platform can), confirm the PUT returned HTTP 200, and only then call finish_data_source_onboarding with the returned specId to kick off AI analysis and wait for it to complete. finish_data_source_onboarding checks storage and refuses if the upload never landed, so skipping the upload cannot be worked around by retrying it.

Use sourceType "tables" instead when the request is to derive/aggregate data that is ALREADY loaded into workspace tables — e.g. "build me a daily summary of the customers table", or "set up a job that reads from the orders table and maintains a running total" — rather than loading a new file. It generates a SQL query (INSERT or MERGE, per merge) via AI instead of a Python parser, run through the query engine instead of a Glue job. There are never sample/format files, but targetOption still works the same three ways as sourceType "file" (see targetOption below) — so this call returns files: [] and you can call finish_data_source_onboarding immediately UNLESS targetOption is "target-schema-file", in which case it returns one upload URL for that file, same as the file-source path. The generated SQL automatically windows itself to rows added since the spec's last successful run. sourceType "tables" ALSO requires autoRefresh — how this spec stays up to date is not optional to decide, and must not be inferred from other jobs/triggers that happen to already exist in the workspace: ask the user whether it should re-run automatically whenever a specific upstream spec finishes loading ("spec_success" — the natural choice when the request is "run this after X finishes/loads"), on a plain cron-like cadence ("schedule" — the natural choice when the request is "run this every day/hour" with no mention of depending on another job), or stay manual-only ("none" — re-run later with run_data_job). If the request already states the timing unambiguously, that answers it; otherwise ask before calling this tool. Getting this wrong either way has a real cost: "none" means the summary silently goes stale until someone remembers to re-run it by hand, while an unwanted trigger keeps re-running (and charging credits for) a spec the user only wanted once. See autoRefresh below.

Input Schema

NameRequiredDescriptionDefault
mergeNoUpsert instead of plain append when true (default false). For sourceType "tables": generates a MERGE statement instead of an INSERT — use true for a running aggregate/summary that updates existing rows. For sourceType "file" with targetOption "existing-tables": upserts loaded rows by the target table's inferred key instead of always inserting — use true whenever the request implies re-loading the same rows shouldn't create duplicates (e.g. "upsert on id", syncing/backfilling into a table that already has overlapping rows). Already automatic, no need to request it via additionalPrompt: target columns with no corresponding source column are null on newly inserted rows, and on a match keep their existing value rather than being nulled out.
specNameYesName for the new data spec.
sourceTypeNoDefaults to "file" (upload a sample file). Use "tables" to query existing workspace table(s) — see sourceTables — instead of loading a new file. Use "compaction" to bin-pack the small data files of existing tables: it moves no data and produces no new table, so it takes NO target of any kind, needs no analysis, and is ready to run the moment it is created.
autoRefreshNosourceType "tables" only. Required for it — ask the user rather than assuming, and do not infer this from other jobs/triggers already in the workspace (a similar existing pipeline is not the user's answer for this one). "spec_success" re-runs this spec whenever autoRefreshUpstreamSpecName finishes loading; "schedule" re-runs it on autoRefreshFrequency; "none" leaves it manual-only (re-run later with run_data_job).
descriptionNoOptional description of the data spec.
workspaceIdNoWorkspace to act on. Defaults to your only workspace if you have exactly one.
sourceTablesNoNames of existing workspace tables. Required for sourceType "tables" (the tables the generated query reads from) and for sourceType "compaction" (the tables to compact).
targetOptionNoWhere transformed data should land — works the same for both sourceType values: "auto-infer" (default) lets the AI design the target table (for sourceType "tables", it designs the schema and the query together in one pass), "existing-tables" uses a table already in the workspace (requires targetTables), "target-schema-file" creates the table from a provided schema file (requires targetSchemaFileName).
targetTablesNoNames of existing workspace tables to target — exactly one entry for sourceType "tables" (the generated query has a single target), one or more for sourceType "file". Required when targetOption is "existing-tables". Optional otherwise: for "target-schema-file"/"auto-infer" the target table (and its name) is derived automatically — from the schema file, or AI-designed — unless you want to pin the name yourself, in which case pass exactly one entry.
formatFileNameNosourceType "file" only. File name of an optional format spec file.
sampleFileNameNosourceType "file" only (and required for it). File name of the sample data file (e.g. "customers.csv") — used to derive content-type, not read from disk.
additionalPromptNoInstructions for the AI. For sourceType "tables", describe what the query should compute from the source table(s) (e.g. "count signups per day per region"). This is stored on the spec verbatim and reused on every future re-analysis, so keep it to instructions that actually change behavior — do not restate default platform behavior (e.g. that unmapped target columns are null/preserved, see merge above) just to document it, since a note that's only true for one case (like new rows) can read as a standing instruction later and cause confusion on updates.
autoRefreshFrequencyNoRequired when autoRefresh is "schedule".
expirePriorSnapshotsNosourceType "compaction" only, default false. When false the job commits the compacted files and changes nothing else — prior snapshots still reference the replaced files, so no storage is freed. When true it also expires every snapshot older than its own commit and deletes the replaced files in the same run, which frees storage but ends the ability to roll back to before the compaction.
targetSchemaFileNameNoFile name of a target schema file. Required when targetOption is "target-schema-file", for either sourceType.
autoRefreshUpstreamSpecNameNoRequired when autoRefresh is "spec_success". The spec whose successful job completion should re-run this one.

Output Schema

NameRequiredDescriptionDefault
filesYes
specIdYes
messageYes
nextStepYesThe finish_data_source_onboarding call to make (once upload(s) are done, or immediately for sourceType "tables").
specNameYes
triggerIdNosourceType "tables" only, when autoRefresh was not "none": the auto-refresh trigger created alongside the spec.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / expirePriorSnapshots
      Added value: +{
      +  "description": "sourceType \"compaction\" only, default false. When false the job commits the compacted files and changes nothing else — prior snapshots still reference the replaced files, so no storage is freed. When true it also expires every snapshot older than its own commit and deletes the replaced files in the same run, which frees storage but ends the ability to roll back to before the compaction.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / sourceTables / description
      Previous value: -"sourceType \"tables\" only: names of existing workspace tables the generated query reads from. Required for sourceType \"tables\"."New value: +"Names of existing workspace tables. Required for sourceType \"tables\" (the tables the generated query reads from) and for sourceType \"compaction\" (the tables to compact)."
    • changedInput schema / properties / sourceType / description
      Previous value: -"Defaults to \"file\" (upload a sample file). Use \"tables\" to query existing workspace table(s) — see sourceTables — instead of loading a new file."New value: +"Defaults to \"file\" (upload a sample file). Use \"tables\" to query existing workspace table(s) — see sourceTables — instead of loading a new file. Use \"compaction\" to bin-pack the small data files of existing tables: it moves no data and produces no new table, so it takes NO target of any kind, needs no analysis, and is ready to run the moment it is created."
    • changedInput schema / properties / sourceType / enum
      Previous value: -[
      -  "file",
      -  "tables"
      -]New value: +[
      +  "file",
      +  "tables",
      +  "compaction"
      +]
  2. Changed3 schema fields changed
    • addedInput schema / properties / autoRefreshFrequency / properties / unit / description
      Added value: +"Schedule cadence."
    • addedInput schema / properties / description / description
      Added value: +"Optional description of the data spec."
    • addedInput schema / properties / specName / description
      Added value: +"Name for the new data spec."
  3. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Goes well beyond the annotations (readOnly=false, destructive=false, idempotent=false) by disclosing that no upload happens here, that finish_data_source_onboarding enforces the upload and cannot be retried around, and that a wrong autoRefresh choice either stales the output or charges credits. The annotation bar is low and this adds substantial operational context. However, the 'idempotentHint=false' implication (repeated calls may create duplicate specs) is never addressed.

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

Conciseness3/5

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

The purpose is front-loaded in the first sentence, but the body is a dense wall of text with repeated re-emphasis (autoRefresh asked-vs-inferred is restated three times) and dangling references ('See autoRefresh below') that point at the schema, not the text. For a 16-parameter tool length is defensible, but it is not tightly edited.

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?

Given the tool's complexity, the description covers workflow order, prerequisites, alternatives, and the cost consequences of a wrong choice, and an output schema already handles return values. An agent has everything needed to call this correctly.

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 is 3, but the description genuinely adds cross-parameter semantics the schema can't convey: how targetOption behaves identically across sourceType values, why 'tables' returns files: [] unless targetOption is 'target-schema-file', and the cost/behavior consequences of the autoRefresh choices.

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+resource ('creates a data spec') and its side effect ('returns presigned upload URL(s)'). It explicitly positions itself as step 1 of a two-call workflow and names the sibling that continues it (finish_data_source_onboarding), so an agent can distinguish it without opening the 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 when-to-use routing across all three sourceType values ('file' vs 'tables' for already-loaded tables vs 'compaction'), with concrete request examples. It also states the required sequencing (PUT files, confirm HTTP 200, then call finish_data_source_onboarding) and that autoRefresh must be asked of the user rather than inferred.

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