> This page is for Workforce.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.merge.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.merge.dev/_mcp/server.

# Google BigQuery

**Authentication:** OAuth. See [Magic Link](/merge-agent-handler/features/magic-link) for the runtime auth flow, or [Application credentials](/merge-agent-handler/admin-setup/add-oauth-credentials) to bring your own OAuth app.

## Sample use cases

* Run a query to count signups by source over the last 30 days from the `analytics.events` table.
* List the largest tables in the `prod` dataset by row count.
* Show me query jobs from the last 24 hours that scanned more than 1TB.

## Available Tools

#### list_datasets

List datasets in a BigQuery project. Returns dataset IDs, descriptions, and locations. Use list_projects first to get available project IDs.

#### get_dataset

Get detailed information about a specific BigQuery dataset including description, location, labels, and access controls. Use list_datasets to find available dataset IDs.

#### create_dataset

Create a new dataset in a BigQuery project. Specify location (US, EU, etc.) at creation time — it cannot be changed later. Use list_projects to find available project IDs.

#### update_dataset

Update a BigQuery dataset's description, friendly name, labels, or default table expiration. Location cannot be changed. Use list_datasets to find available dataset IDs.

#### delete_dataset

Delete a BigQuery dataset. Set delete_contents=true to delete all tables in the dataset. Without it, the dataset must be empty. Use list_datasets to find available dataset IDs.

#### list_jobs

List BigQuery jobs in a project. Filter by state (done, pending, running) and projection level. Returns job IDs, types, status, and statistics.

#### get_job

Get detailed information about a specific BigQuery job including status, configuration, and statistics. Use list_jobs to find job IDs, or use the job_id from a run_query response.

#### cancel_job

Cancel a running BigQuery job. The job may still complete if it finishes before the cancellation takes effect. Use list_jobs with state_filter='running' to find cancellable jobs.

#### list_projects

List all BigQuery projects accessible to the authenticated user. Returns project IDs, names, and numeric IDs. Use this to discover available projects before querying datasets or tables.

#### run_query

Execute a SQL query in BigQuery and return results.

#### get_query_results

Get results from a previously executed query using its job ID.

#### list_tables

List tables in a BigQuery dataset. Returns table IDs, types, and creation times. Use list_datasets first to get available dataset IDs.

#### get_table

Get detailed information about a BigQuery table including schema, row count, size, and partitioning config. Use list_tables to find available table IDs.

#### create_table

Create a new table in a BigQuery dataset with a typed schema. Supports STRING, INTEGER, FLOAT, BOOLEAN, TIMESTAMP, RECORD, and more. Use list_datasets to find available dataset IDs.

#### update_table

Update a BigQuery table's description, friendly name, labels, or schema (add new columns only — cannot remove/rename). Use list_tables to find available table IDs.

#### delete_table

Delete a BigQuery table permanently. This cannot be undone. Use list_tables to find available table IDs.

#### list_table_data

Read rows from a BigQuery table. Returns data as column:value dicts with pagination support. For filtered/aggregated data, use run_query instead. Use list_tables to find table IDs.

#### insert_table_data

Stream-insert rows into a BigQuery table. Each row is a dict of column_name:value pairs. Returns insert errors if any rows fail. Use list_tables to find table IDs.

#### copy_table

Copy a BigQuery table to a new location (within/across datasets or projects).

#### export_table_to_gcs

Export a BigQuery table to Google Cloud Storage in CSV, JSON, Avro, or Parquet format.