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) — upload the file(s) per the returned instructions, then call finish_data_source_onboarding with the returned specId to kick off AI analysis and wait for it to complete.

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

TableJSON 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

TableJSON 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.9/5.0
Behavior5/5

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

With all annotations being false and uninformative, the description carries the transparency burden and succeeds: it explains side effects (creates a spec, returns upload URLs or files: []), notes that the generated SQL for 'tables' auto-windows to newly added rows, and warns about stale data and credit charges if autoRefresh is guessed incorrectly. None of this contradicts the annotations.

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?

The description is front-loaded and densely useful, but it is long and repeats some guidance that also appears in the parameter schema, such as autoRefresh instructions and targetOption behavior. It earns most of its length given the tool's complexity, but a bit of trimming would make it tighter.

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?

For a 16-parameter tool with nested objects and an output schema, the description plus schema leaves little ambiguity: it gives the next step, return behavior, prerequisites for tables mode, and the conditions for immediate follow-up versus target-schema-file upload. The remaining mode, compaction, is adequately handled by the sourceType schema entry.

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

Parameters5/5

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

Although schema coverage is already 100%, the description adds decision heuristics beyond the schema: when to choose sourceType 'tables', how targetOption behaves across both source types, and the high-stakes meaning of autoRefresh choices. This materially improves correct parameter selection.

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?

The description identifies the tool as the first step of a new data integration ('creates a data spec' and 'returns presigned upload URL(s)') and explicitly names the follow-up tool, finish_data_source_onboarding. It also distinguishes sourceType 'file' from sourceType 'tables' so the agent can tell what resource the tool acts on.

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?

It gives explicit selection criteria: use sourceType 'tables' when the request derives or aggregates data already in workspace tables, use 'file' when uploading a new file, and call finish_data_source_onboarding after uploads. It also tells the agent to ask the user about autoRefresh rather than inferring it from existing workspace jobs, which is a clear when-to-use rule with alternatives.

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