{"id":"tables_query","name":"Tables Query","alias":"TablesQuery","aliases":[],"description_short":"Query any table in the data model with BigQuery Standard SQL syntax. Always prefix tables with \"catalog.\" (ex: catalog.crawl_pages_20251201).","description_long":"Query any data-model table with\n    BigQuery Standard SQL syntax. Always prefix tables with \"catalog.\" (for example,\n    catalog.crawl_pages_20251201).\n\n    The following query-string functions are supported:\n    - query_string_keys(input): returns ARRAY<STRING> with query-string keys.\n    - query_string_params(input): returns\n      ARRAY<STRUCT<key STRING, value STRING>> with query-string key/value pairs.\n    - remove_query_string(url, keys): removes URL query-string parameters whose keys\n      are in an ARRAY<STRING>. It removes the \"?\" when no parameter remains.\n\n    The parsing functions accept a raw query string with or without a leading \"?\",\n    or a complete URL. They preserve parameter order and duplicate keys, ignore\n    empty keys, and do not URL-decode values. remove_query_string accepts a complete URL.\n    For example:\n    SELECT query_string_params(url) FROM catalog.crawl_pages_20251201\n    SELECT remove_query_string(url, ['bar']) FROM catalog.crawl_pages_20251201\n\n    The logs crawls and visits tables (catalog.logs_google_crawls) have a\n    virtual `url` column, resolved from `url_hash` after the query runs. It can\n    only be selected, grouped by or counted: to filter, join, sort or transform\n    URLs, join catalog.logs_urls on url_hash.\n    ","description_tool_prompt":"Query any table in the data model with BigQuery Standard SQL syntax.\nAlways prefix tables with \"catalog.\" (ex: catalog.crawl_pages_20251201).\n\nCrawl tables exist in two flavours: SiteCrawler (catalog.crawl_pages_<crawl>) and AlertPanel (catalog.alert_panel_crawl_pages_<crawl>). AlertPanel crawls only cover a small subset of URLs, so use the SiteCrawler table by default - including when picking the most recent crawl - and only use an alert_panel_ table when AlertPanel data is explicitly requested.\n\nA table growing without bound over time (Search Console, analytics reports, served pages...) comes with a `time_filter`: the column, its type, an example and, when known, the first and last days with data in the project (`date_start`, `date_end`). tables_query rejects a query reading such a table unless a comparison on that column bounds it in the WHERE clause of the SELECT reading it (a filter on a CTE or subquery wrapping the table does not count).\n\nSupported query-string functions:\n- query_string_keys(input): returns ARRAY<STRING> with query-string keys.\n- query_string_params(input): returns ARRAY<STRUCT<key STRING, value STRING>> with query-string key/value pairs.\n- remove_query_string(url, keys): removes parameters whose key is included in an ARRAY<STRING> from a complete URL, and removes '?' when none remain.\n\nLogs crawls and visits tables (logs_<engine>_crawls, logs_<engine>_visits) have a virtual `url` column, resolved from url_hash after the query runs. Select it instead of joining logs_urls when you only need to show URLs. It can only be selected, grouped by or counted, not filtered, joined, sorted or passed to a function: for those, join catalog.logs_urls on url_hash.\n\nWrites: this tool can also run statements that modify data (CREATE, DROP, INSERT, UPDATE, DELETE), but only on tables the user created. Tables managed by Botify (crawl, logs, Search Console, ...) are read-only and can never be modified or dropped. Only modify or drop a table when the user asks for it.","source":null,"conversation_examples":[],"tags":[],"available_in_chat":true,"available_in_deepthink":true,"available_in_mcp":true,"mcp_audience":"all","config":{"type":"object","properties":{"bigquery_billing":{"default":"auto","description":"Who pays BigQuery for the query. 'botify': Botify runs it, and the data it scans is charged in credits. 'organization': it runs in your organization's own GCP project, configured by Botify, which Google bills directly; a flat fee per query is charged in credits instead of the scan. 'auto': your organization's project when one is configured, else Botify.","enum":["auto","botify","organization"],"title":"Bigquery Billing","type":"string"}},"required":[]},"item":{"type":"object","properties":{"query":{"description":"BigQuery SQL query to execute","title":"Query","type":"string"},"max_results":{"default":10000,"description":"Maximum number of results to return","maximum":10000,"minimum":1,"title":"Max Results","type":"integer"}},"required":["query"]},"response":{"properties":{"fields":{"description":"Field definitions with name and type","items":{"additionalProperties":{"type":"string"},"type":"object"},"title":"Fields","type":"array"},"results":{"description":"Query execution results as list of lists","items":{"additionalProperties":true,"type":"object"},"title":"Results","type":"array"}},"required":["fields","results"],"title":"TablesQueryProcessedItem","type":"object"},"has_canvas":false,"open_canvas_automatically":false}