Skip to main content
Glama

get_query_results

Read-onlyIdempotent

Get the results of a BigQuery SQL query job.

Use this tool ONLY when:

  1. A previous execute_sql or execute_sql_readonly call returned job_complete: false with a job_id (poll with this tool until job_complete: true), OR

  2. You need to paginate through additional rows using page_token or start_index for a previously completed job.

Do NOT call this tool if the query already returned job_complete: true with all rows.

Supports pagination. Use max_results to limit results and page_token to retrieve the next page of results.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
jobIdYesRequired. Job ID of the query job.
locationNoOptional. The geographic location of the job.
pageTokenNoOptional. Page token, returned by a previous call, to request the next page of results.
projectIdYesRequired. Project ID of the query job.
timeoutMsNoOptional. Specifies the maximum amount of time, in milliseconds, that the client is willing to wait for the query to complete.
maxResultsNoOptional. Maximum number of results to read.
startIndexNoOptional. Zero-based index of the starting row.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
rowsNoAn object with as many results as can be contained within the maximum permitted reply size. To get any additional rows, you can call GetQueryResults and specify the jobReference returned above.
jobIdNoOutput only. The ID of the BigQuery job created for this query, if any. Present when a query job is created (e.g. for long-running operations, DML, scripts). Use this ID with `get_query_results`, `cancel_job`, or `get_job`.
errorsNoOutput only. The first errors or warnings encountered during the running of the job. The final message includes the number of errors that caused the process to stop. Errors here do not necessarily mean that the job has completed or was unsuccessful. For more information about error messages, see [Error messages](https://cloud.google.com/bigquery/docs/error-messages).
schemaNoThe schema of the results. Present only when the query completes successfully.
queryIdNoOutput only. The ID of the query.
jobCompleteNoWhether the query has completed or not. If rows or totalRows are present, this will always be true. If this is false, totalRows will not be available.
totalSlotMsNoOutput only. Number of slot ms the user is actually billed for.
totalBytesBilledNoOutput only. The total number of bytes billed for the query. Only applies if the project is configured to use on-demand pricing.
numDmlAffectedRowsNoOutput only. The number of rows affected by a DML statement.
totalBytesProcessedNoOutput only. The total number of bytes processed for this query.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added
  2. Removed
  3. Added
  4. Removed
  5. Added
  6. Removed
  7. Added
  8. Removed
  9. Added
  10. Removed
  11. Added
  12. Removed
  13. Added
  14. Removed
  15. Added
  16. Removed
  17. Added
  18. Removed
  19. Added
  20. Removed
  21. Added
  22. Removed
  23. Added
  24. Removed
  25. Added
  26. Removed
  27. Added
  28. Removed
  29. Added
  30. Removed
  31. Added
  32. Removed
  33. Added

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The annotations already declare readOnlyHint: true, idempotentHint: true, and destructiveHint: false, so the safety profile is covered. The description adds valuable behavioral context about polling semantics (job_complete states), pagination via page_token, and use of max_results to limit results. This goes beyond the structured annotations to explain the tool's operational pattern.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is tight and well-structured: a one-sentence purpose, then clear numbered conditions for use, a negative instruction, and a short pagination note. Every sentence earns its place and the most important scoping information is front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the rich input schema (7 params, all described) and the presence of an output schema, the description is comprehensive enough for correct invocation. It covers the workflow triggers, the polling loop, pagination, and the critical 'do not call' case. No significant missing context prevents an agent from using the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the parameter meanings are already fully documented. The description adds minimal extra value by pointing out that max_results limits results and page_token retrieves the next page, but that information largely mirrors the schema. A score of 3 is appropriate because the schema carries the semantic weight.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a clear verb+resource: 'Get the results of a BigQuery SQL query job.' It is distinct from sibling tools such as execute_sql, cancel_job, or get_table_info, which have different responsibilities. The purpose is immediately clear and specific.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly defines when to use the tool: after a prior execute_sql or execute_sql_readonly returned job_complete: false, or when paginating through additional rows. It also states when NOT to call it, saying to avoid calling if the query already returned job_complete: true with all rows. This gives an agent decisive routing guidance against alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources