Connect BigQuery to Toolspoke
Explore datasets and table schemas, price a query with a dry run, then run it. Toolspoke gives your agents 10 of its actions, and you decide which ones each project allows.
- Connection
- Provider REST API
- Authentication
- OAuth 2.0
- Actions exposed
- 10
- What a call bills
- Nothing
- Adapter
- Maintained by Toolspoke
- Category
- Data
Connected in three steps
Install BigQuery
Open the marketplace in your workspace, add BigQuery to the project your agents work in, and it appears on the gateway immediately.
Connect the credential
Provide the credential BigQuery asks for. Where to get it, and what it has to be able to reach, is the next section.
Give it to an agent
Describe the job in one sentence and the builder proposes the instructions, the toolkits it needs, a schedule and where it should answer, or start from a catalogue agent. It can use every BigQuery action the project leaves on.
Where the agent answers
Slack
Ask it in a channel or a thread, and it replies in the thread it was asked in.
Email
Email it. Each write waits for a person's go-ahead unless that action is allowed in advance.
GitHub
Mention it on a pull request, and it answers there.
Schedule
A routine wakes it on a schedule, or when a new item matches.
Any agent in the project can use BigQuery, and only the actions the project leaves on.
What BigQuery asks for
OAuth 2.0. You provide it once, when you install the connector. Toolspoke encrypts it at rest and decrypts it only for the length of a single call, and the gateway attaches it to the outbound request itself, so it is never part of the arguments an agent sends.
- OAuth client IDRequired
- Google Cloud console → APIs & Services → Credentials → OAuth 2.0 Client IDs (Desktop app). Enable the BigQuery API on the same project.
- 123-abc.apps.googleusercontent.com
- OAuth client secretRequired
- Shown next to the OAuth client ID in the Google Cloud console.
- OAuth refresh tokenRequired
- Generate once with the https://www.googleapis.com/auth/bigquery scope and offline access, then paste it here. To keep the install read-only, grant the authorising account BigQuery Data Viewer and Job User and nothing more.
- Default project IDRequired
- The billing project every job runs in and every dataset listing defaults to. A call may name a different project the same credential can reach.
- my-gcp-project
What an agent can do in BigQuery
10 actions, each one declared by name in the connector. A workspace policy grants a person all of them, a hand-picked selection, everything on the read side, everything on the write side, or none.
8 read, 1 write, 1 destructive
Reads
8Fetches data and changes nothing.
dry_run_queryValidate a query and report what it would cost, without running it. Returns totalBytesProcessed and the resolved schema; no job is created, no slot is used and nothing is billed. Call this before run_query on anything that touches a large table, bytes scanned is what BigQuery charges for, and a missing WHERE on a partitioned table is the difference between megabytes and terabytes. It also catches a wrong column or dataset name for free, so use it instead of a SELECT … LIMIT 1 to check that a query parses.
get_query_resultsFetch rows from a query job that has already run, by job id. Use it for the second and later pages of a large result set, and to collect the answer from a run_query call that returned jobComplete false. Reading results again costs nothing, the bytes were billed when the job ran. Job ids come from run_query's jobReference or from list_jobs.
list_datasetsList the datasets in a project with their ids, locations and labels. Call this first when you do not know what data the project holds; the datasetId it returns is what list_tables and get_dataset need. Costs nothing.
get_datasetFetch one dataset's metadata: description, location, default table expiry, labels and access entries. Use it when a query fails on a location mismatch, or to check who a dataset is shared with. Costs nothing.
list_tablesList the tables and views in one dataset, with their type, creation time and partitioning. Call it after list_datasets to find a table id, then get_table for the columns. Costs nothing.
get_tableFetch one table's full metadata, including the column schema with types, modes and descriptions, the row count, the bytes on disk and the partitioning and clustering fields. This is the call to make before writing any query: it names the columns exactly, and the partitioning field is what tells you the WHERE clause that keeps dry_run_query's byte estimate small. Costs nothing.
list_jobsList recent jobs in a project, newest first, with state, user and error result. Use it to find what is running now, to find the job id of a query somebody else ran, or to see why a scheduled load failed. Set state_filter to "running" to find a job worth cancelling. Costs nothing.
get_jobFetch one job in full: its configuration, state, timings, error result and query statistics including bytes processed and billed and slot milliseconds. Use it after run_query to find out what a query actually cost, and after a failure to read the error BigQuery recorded. Costs nothing.
Writes
1Creates or updates something on the other side.
run_queryRun a GoogleSQL query and return the result rows. Classified as a write because jobs.query is the same endpoint for SELECT, INSERT, MERGE and DDL, and the gateway cannot tell which a caller sent, pair it with an IAM role that only reads if this install should only read. Call dry_run_query first on anything unfamiliar: this call is billed on bytes scanned. Keep max_results small and put a LIMIT in the SQL. If the response comes back with jobComplete false, take jobReference.jobId and poll get_query_results.
Destructive
1Deletes or permanently alters something. Worth granting on purpose.
cancel_jobAsk BigQuery to stop a running job. Destructive because it ends work in progress: a load or DML job that was part-way through is abandoned, the bytes already scanned are still billed, and the job cannot be resumed, it has to be submitted again. Confirm the job id and its state with list_jobs or get_job first. Cancellation is a request, so poll get_job to see the job reach DONE.
What it will not do
The gateway enforces each of these, so they can be stated flatly.
- It cannot call anything else
- The 10 actions above are the whole of it. A call to any other name is refused before it reaches BigQuery rather than forwarded on, and connecting your account does not add to the list: it is fixed by the connector, not discovered at run time.
- It reaches no further than your credential
- Toolspoke holds no access to BigQuery of its own. Every call carries the credential you stored and nothing besides, so whatever that credential cannot reach, this connector cannot reach either.
- It never hears from BigQuery
- Nothing is pushed to it. There is no webhook, no subscription and no polling, so this connector cannot notice by itself that something changed in BigQuery. An agent has to ask.
- It does not smooth over provider limits
- Toolspoke does not retry, queue or back off around BigQuery's own rate limits. A call that BigQuery refuses comes back to the agent as a failed call.
Before you connect it
What can an agent do in BigQuery?
10 named actions: 8 that only read, 1 that write and 1 that delete or permanently alter something. They include dry_run_query, run_query and get_query_results. Nothing outside that list is reachable: the connector declares each operation by name rather than proxying whatever an agent asks for.
What credentials does the BigQuery connector need?
OAuth 2.0. The connector asks for oauth client id, oauth client secret, oauth refresh token and default project id. Values are encrypted at rest and attached to the outbound request by the gateway, so they are never part of the arguments an agent sends and never reach the audit log.
How does an agent get to use BigQuery?
Install BigQuery in a project and every agent in that project can use the actions the project leaves on. Describe a job in one sentence and the builder proposes the instructions, the toolkits it needs, a schedule and where it should answer, or start from a catalogue agent. The agent answers when someone asks it in Slack, emails it or mentions it on a GitHub pull request, or when its routine wakes it.
What does the BigQuery connector not do?
The 10 actions above are the whole of it. A call to any other name is refused before it reaches BigQuery rather than forwarded on, and connecting your account does not add to the list: it is fixed by the connector, not discovered at run time. Toolspoke holds no access to BigQuery of its own. Every call carries the credential you stored and nothing besides, so whatever that credential cannot reach, this connector cannot reach either. Nothing is pushed to it. There is no webhook, no subscription and no polling, so this connector cannot notice by itself that something changed in BigQuery. An agent has to ask. Toolspoke does not retry, queue or back off around BigQuery's own rate limits. A call that BigQuery refuses comes back to the agent as a failed call.
Can I limit which actions an agent can call?
Yes, in two places. The project switches BigQuery's actions on and off one at a time, for everyone in the project at once, and the screen groups them by read, write and destructive so turning off everything that deletes is one click. An individual agent key can then be narrowed further, to particular toolkits in a project and to particular actions in a toolkit. Whatever it was granted, a key never reaches a project its owner cannot.
What gets recorded when an agent calls BigQuery?
Every attempt, with the agent that made it and the person that agent belongs to, the full request payload, the response payload, the status, the duration, and what the call cost in sandbox time and model tokens. Values whose key names a secret are masked out before the record is shown to anyone. An operation the connector marks as not retained never has its response body written at all, so the gateway keeps no second copy of what was read.