Skip to content

ingest_file_upload

Ingest an authenticated staged CSV/XLSX upload as a model data source. Create a session at POST /api/models/{model_name}/data-sources/upload-sessions, PUT the file to its upload_url, then pass staged_upload_id. Inline base64 is limited to 64 KiB. This tool does not access Google accounts.

NameTypeRequiredDefaultDescription
model_nameAnnotated[str, Field(description='Name of the Bridge Town model.')]Yes
source_nameAnnotated[str, Field(description='Logical data-source name for query_data.')]Yes
staged_upload_id`Annotated[strNone, Field(description=‘Preferred source: staged-upload UUID from POST /api/models/{model_name}/data-sources/upload-sessions. Upload the file with PUT to the returned upload_url before calling this tool. Sessions are authenticated, model- and user-scoped, atomically consumed before processing, and expire in 24 hours. After any ingest failure, create a new staged upload instead of replaying this id.’)]`NoNone
filename`Annotated[strNone, Field(description=‘Original .csv or .xlsx filename; required only for inline fallback.’)]`NoNone
file_content`Annotated[strNone, Field(max_length=MAX_FILE_CONTENT_CHARS, description=‘Optional base64 fallback for a file no larger than 64 KiB decoded. Do not place larger file bodies in an MCP tool call; use staged_upload_id.’)]`NoNone
workspace_id`Annotated[strNone, Field(description=WORKSPACE_ID_FIELD_DESCRIPTION)]`NoNone

Returns a structured object. Top-level fields:

  • model_name (string)
  • source_name (string)
  • source_type (string)
  • data_source_id (string)
  • tables (array<string>)
  • row_count (integer)

See the response example below for the full payload shape.

{
"name": "ingest_file_upload",
"arguments": {
"model_name": "forecasts",
"source_name": "actuals",
"filename": "actuals_2026q1.csv",
"file_content": "PEJBU0U2NCBPRiAuY3N2IEZJTEUgQ09OVEVOVD4="
}
}
{
"model_name": "forecasts",
"source_name": "actuals",
"source_type": "parquet",
"data_source_id": "88888888-8888-8888-8888-888888888888",
"tables": [
"actuals"
],
"row_count": 24
}
  • Module: Data
  • Requires an authenticated Bridge Town session (OAuth) or an API token.