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.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
model_name | Annotated[str, Field(description='Name of the Bridge Town model.')] | Yes | — | |
source_name | Annotated[str, Field(description='Logical data-source name for query_data.')] | Yes | — | |
staged_upload_id | `Annotated[str | None, 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.’)]` | No | None |
filename | `Annotated[str | None, Field(description=‘Original .csv or .xlsx filename; required only for inline fallback.’)]` | No | None |
file_content | `Annotated[str | None, 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.’)]` | No | None |
workspace_id | `Annotated[str | None, Field(description=WORKSPACE_ID_FIELD_DESCRIPTION)]` | No | None |
Returns
Section titled “Returns”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.
Example
Section titled “Example”Tool Call
Section titled “Tool Call”{ "name": "ingest_file_upload", "arguments": { "model_name": "forecasts", "source_name": "actuals", "filename": "actuals_2026q1.csv", "file_content": "PEJBU0U2NCBPRiAuY3N2IEZJTEUgQ09OVEVOVD4=" }}Response
Section titled “Response”{ "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.