google-bigquery__execute_sql
Run a SQL query in the project and return the result. Prefer the execute_sql_readonly
tool if possible.
This tool can execute any query that bigquery supports including:
SQL Queries (
SELECT,INSERT,UPDATE,DELETE,CREATE, etc.)AI/ML functions like
AI.FORECAST,AI.KEY_DRIVERS,ML.EVALUATE,ML.PREDICTAny other query that bigquery supports.
Example Queries:
-- Insert data into a table.
INSERT INTO `my_project.my_dataset`.my_table (name, age)
VALUES ('Alice', Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"projectId": "<projectId>",
"query": "<query>"
},
"name": "google-bigquery__execute_sql"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Required. The query to execute in the form of a GoogleSQL query. | |
| dryRun | No | Optional. If set to true, BigQuery doesn't run the job. Instead, if the query is valid, BigQuery returns statistics about the job such as how many bytes would be processed. If the query is invalid, an error returns. The default value is false. | |
| labels | No | Optional. The labels associated with this query. Labels can be used to organize and group query jobs. Label keys and values can be no longer than 63 characters, can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label keys must start with a letter and each label in the map must have a different key. | |
| projectId | Yes | Required. Project that will be used for query execution and billing. | |
| timeoutMs | No | Optional. Optional: Specifies the maximum amount of time, in milliseconds, that the client is willing to wait for the query to complete. By default, this limit is 20 seconds (20,000 milliseconds). | |
| jobTimeoutMs | No | Optional. Optional: Job timeout in milliseconds. If this time limit is exceeded, BigQuery will attempt to stop the query job. |