> This page is for Agent Handler.

> 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.