{"id":23972,"date":"2025-10-22T09:48:33","date_gmt":"2025-10-22T02:48:33","guid":{"rendered":"https:\/\/gcloudvn.com\/?p=23972"},"modified":"2025-10-22T09:48:33","modified_gmt":"2025-10-22T02:48:33","slug":"bigquery-meets-adk-mcp-accelerate-agent-development-with-bigquerys-new-first-party-toolset","status":"publish","type":"post","link":"https:\/\/gcloudvn.com\/en\/kienthuc\/bigquery-meets-adk-mcp-accelerate-agent-development-with-bigquerys-new-first-party-toolset\/","title":{"rendered":"BigQuery meets ADK &amp; MCP: Accelerate agent development with BigQuery's new first-party toolset"},"content":{"rendered":"<p><span data-markdown-start-index=\"272\">The AI \u200b\u200bAgent revolution is happening at breakneck speed, and every business wants to have its own autonomous \u201cdigital workers\u201d. However, the path from idea to a truly useful AI Agent, capable of reasoning on internal data and performing complex tasks, is fraught with challenges: fragmented data, expensive model customization, and a lack of a unified development toolkit.<\/span><\/p>\n<p>To break down this barrier and empower developers, Google has made a strategic move. Google BigQuery combined with ADK &amp; MCP is now not just a data warehouse, but also the center of a whole new Agent development ecosystem with the launch of exclusive toolkits: Agent Development Kit (ADK) and Model Customization Platform (MCP).<\/p>\n<p><span data-markdown-start-index=\"1056\">This is more than just an update; it's a statement of a new approach that promises to dramatically accelerate the process of bringing intelligent, deeply customized AI Agents into business practice, directly from where your data lives.<\/span><\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_80 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewbox=\"0 0 24 24\" version=\"1.2\" baseprofile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/gcloudvn.com\/en\/kienthuc\/bigquery-meets-adk-mcp-accelerate-agent-development-with-bigquerys-new-first-party-toolset\/#Tai_sao_phai_ung_dung_Google_BigQuery_ket_hop_ADK_MCP\" >Why use Google BigQuery application combined with ADK &amp; MCP?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/gcloudvn.com\/en\/kienthuc\/bigquery-meets-adk-mcp-accelerate-agent-development-with-bigquerys-new-first-party-toolset\/#Huong_dan_Xay_dung_mot_tac_nhan_phan_tich_hoi_thoai_bang_cach_su_dung_cac_cong_cu_cua_ben_thu_nhat_BigQuery\" >Tutorial: Build a Conversational Analytics Agent using BigQuery\u2019s first-party tools<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/gcloudvn.com\/en\/kienthuc\/bigquery-meets-adk-mcp-accelerate-agent-development-with-bigquerys-new-first-party-toolset\/#Tuy_chon_1_Su_dung_bo_cong_cu_tich_hop_moi_cua_ADK_cho_BigQuery\" >Option 1: Use ADK\u2019s new built-in toolset for BigQuery<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/gcloudvn.com\/en\/kienthuc\/bigquery-meets-adk-mcp-accelerate-agent-development-with-bigquerys-new-first-party-toolset\/#Tuy_chon_2_Su_dung_cac_cong_cu_duoc_xay_dung_san_cua_BigQuery_trong_MCP_Toolbox_for_Databases\" >Option 2: Use BigQuery\u2019s pre-built tools in MCP Toolbox for Databases<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/gcloudvn.com\/en\/kienthuc\/bigquery-meets-adk-mcp-accelerate-agent-development-with-bigquerys-new-first-party-toolset\/#Khoi_tao_Conversational_Analytics_Agent\" >Run your Conversational Analytics Agent<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/gcloudvn.com\/en\/kienthuc\/bigquery-meets-adk-mcp-accelerate-agent-development-with-bigquerys-new-first-party-toolset\/#Ket_luan_Bien_Kho_du_lieu_thanh_%E2%80%9CXuong_san_xuat%E2%80%9D_AI_Agent\" >Conclusion: Turning the Data Warehouse into an AI Agent \u201cFactory\u201d<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Tai_sao_phai_ung_dung_Google_BigQuery_ket_hop_ADK_MCP\"><\/span>Why use Google BigQuery application combined with ADK &amp; MCP?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">As the excitement around AI agents reaches enterprise customers, a critical question emerges: How can we empower these agents to securely and intelligently interact with enterprise data systems like Google Cloud BigQuery?<\/span><\/p>\n<p>Currently, the developers building agentic applications have been forced to build and maintain their own custom tools, a process that is slow, risky, and distracts from building innovative applications. This introduces considerable development overhead and risk, as they become responsible for everything from authentication and error handling to keeping pace with BigQuery's evolving capabilities.<\/p>\n<p>To solve this, we are introducing a new, first-party toolset for BigQuery that includes tools to fetch metadata and execute queries (and we have more on the way):<\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">list_dataset_ids: Fetches BigQuery dataset ids present in a GCP project.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">get_dataset_info: Fetches metadata about a BigQuery dataset.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">list_table_ids: Fetches table ids present in a BigQuery dataset.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">get_table_info: Fetches metadata about a BigQuery table.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">execute_sql: Runs a SQL query in BigQuery and fetch the result.<\/span><\/li>\n<\/ul>\n<p>These official, Google-maintained tools provide a secure and reliable bridge to your data, and you can use them in two powerful ways: a built-in toolset in Google\u2019s Agent Development Kit (ADK) or through the flexible, open-source MCP Toolbox for Databases. This frees you to focus on creating value, not on building foundational plumbing.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Huong_dan_Xay_dung_mot_tac_nhan_phan_tich_hoi_thoai_bang_cach_su_dung_cac_cong_cu_cua_ben_thu_nhat_BigQuery\"><\/span><b>Tutorial: Build a Conversational Analytics Agent using BigQuery\u2019s first-party tools<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Our agent will query BigQuery\u2019s public dataset: thelook_ecommerce, a synthetic e-commerce dataset that includes customer details, product inventories, and order histories. The agent\u2019s primary role will be to generate SQL queries and provide meaningful responses to common business questions, such as: What are the top-selling products? Which products are frequently ordered together? And how many customers do we have in Colombia?<\/span><\/p>\n<p>You first need to create a python environment and install ADK.You can then invoke the adk utility to create a new bq-agent-app ADK application in the current folder:<\/p>\n<p><b>adk create bq-agent-app<\/b><\/p>\n<p><a href=\"https:\/\/gcloudvn.com\/en\/kienthuc\/collaborate-with-gemini-in-google-drive-now-available-on-mobile\/attachment\/1_uprgich\/\" rel=\"attachment wp-att-23915\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-23915\" src=\"https:\/\/gcloudvn.com\/wp-content\/uploads\/2025\/10\/1_uPRGICh.gif\" alt=\"\" width=\"976\" height=\"306\" srcset=\"https:\/\/gcloudvn.com\/wp-content\/uploads\/2025\/10\/1_uPRGICh.gif 976w, https:\/\/gcloudvn.com\/wp-content\/uploads\/2025\/10\/1_uPRGICh-768x241.gif 768w, https:\/\/gcloudvn.com\/wp-content\/uploads\/2025\/10\/1_uPRGICh-18x6.gif 18w\" sizes=\"auto, (max-width: 976px) 100vw, 976px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">Choose your model, select Vertex AI as the backend, and confirm your project id and region:<\/span><\/p>\n<p>You should now have a new folder named bq-agent-app. Navigate to agent.py and update the root LLM-Agent to reflect our conversational analytics agent:<\/p>\n<p><b>lang-py<\/b><\/p>\n<p><b>root_agent = Agent(<\/b><\/p>\n<p><b>\u00a0\u00a0model=&#8221;gemini-2.0-flash&#8221;,<\/b><\/p>\n<p><b>\u00a0\u00a0name=&#8221;bigquery_agent&#8221;,<\/b><\/p>\n<p><b>\u00a0\u00a0description=(<\/b><\/p>\n<p><b>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#8220;Agent that answers questions about BigQuery data by executing SQL queries&#8221;<\/b><\/p>\n<p><b>\u00a0\u00a0),<\/b><\/p>\n<p><b>\u00a0\u00a0instruction=&#8221;&#8221;&#8221; You are a data analysis agent with access to several BigQuery tools. Make use of those tools to answer the user&#8217;s questions.<\/b><\/p>\n<p><b>\u200b<\/b><\/p>\n<p><b>\u00a0\u00a0&#8220;&#8221;&#8221;,<\/b><\/p>\n<p><b>\u00a0\u00a0tools=[bigquery_toolset],<\/b><\/p>\n<p><b>)<\/b><\/p>\n<p>When defining your agent, you provide a unique name, specify the underlying LLM model, and can optionally include a description that helps other agents understand its purpose. The agent's core task or goal is defined in the instructions.<\/p>\n<p><span style=\"font-weight: 400;\">Finally, to enable the agent to interact with your data, it must be equipped with tools that allow it to interact with BigQuery so it can understand the available datasets and tables, and of course, execute queries. Let\u2019s consider our options when it comes to using BigQuery\u2019s first-party toolset.<\/span><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Tuy_chon_1_Su_dung_bo_cong_cu_tich_hop_moi_cua_ADK_cho_BigQuery\"><\/span><b>Option 1: Use ADK\u2019s new built-in toolset for BigQuery<\/b><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><a href=\"https:\/\/gcloudvn.com\/en\/kienthuc\/collaborate-with-gemini-in-google-drive-now-available-on-mobile\/attachment\/2_k6pqymv-max-1900x1900\/\" rel=\"attachment wp-att-23914\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-23914\" src=\"https:\/\/gcloudvn.com\/wp-content\/uploads\/2025\/10\/2_K6pQymV.max-1900x1900-1.png\" alt=\"\" width=\"1900\" height=\"985\" srcset=\"https:\/\/gcloudvn.com\/wp-content\/uploads\/2025\/10\/2_K6pQymV.max-1900x1900-1.png 1900w, https:\/\/gcloudvn.com\/wp-content\/uploads\/2025\/10\/2_K6pQymV.max-1900x1900-1-768x398.png 768w, https:\/\/gcloudvn.com\/wp-content\/uploads\/2025\/10\/2_K6pQymV.max-1900x1900-1-1536x796.png 1536w, https:\/\/gcloudvn.com\/wp-content\/uploads\/2025\/10\/2_K6pQymV.max-1900x1900-1-18x9.png 18w\" sizes=\"auto, (max-width: 1900px) 100vw, 1900px\" \/><\/a><\/p>\n<p>This first-party toolset is owned and maintained by Google. To assign these tools to your agent, you need to import the BigQueryToolset from the agents.tools module and then initialize the toolset:<\/p>\n<p><span style=\"font-weight: 400;\">lang-py<\/span><\/p>\n<p><span style=\"font-weight: 400;\">from google.adk.tools.bigquery import BigQueryCredentialsConfig<\/span><\/p>\n<p><span style=\"font-weight: 400;\">from google.adk.tools.bigquery import BigQueryToolset<\/span><\/p>\n<p><span style=\"font-weight: 400;\">import google.auth<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u200b<\/span><\/p>\n<p><span style=\"font-weight: 400;\"># Define an appropriate credential type<\/span><\/p>\n<p><span style=\"font-weight: 400;\">CREDENTIALS_TYPE = AuthCredentialTypes.OAUTH2<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u200b<\/span><\/p>\n<p><span style=\"font-weight: 400;\"># Write modes define BigQuery access control of agent:<\/span><\/p>\n<p><span style=\"font-weight: 400;\"># ALLOWED: Tools will have full write capabilites.<\/span><\/p>\n<p><span style=\"font-weight: 400;\"># BLOCKED: Default mode. Effectively makes the tool read-only.<\/span><\/p>\n<p><span style=\"font-weight: 400;\"># PROTECTED: Only allows writes on temporary data for a given BigQuery session.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u200b<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u200b<\/span><\/p>\n<p><span style=\"font-weight: 400;\">tool_config = BigQueryToolConfig(write_mode=WriteMode.ALLOWED)<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u200b<\/span><\/p>\n<p><span style=\"font-weight: 400;\">if CREDENTIALS_TYPE == AuthCredentialTypes.OAUTH2:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0# Initiaze the tools to do interactive OAuth<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0credentials_config = BigQueryCredentialsConfig(<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0client_id=os.getenv(&#8220;OAUTH_CLIENT_ID&#8221;),<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0client_secret=os.getenv(&#8220;OAUTH_CLIENT_SECRET&#8221;),<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0)<\/span><\/p>\n<p><span style=\"font-weight: 400;\">elif CREDENTIALS_TYPE == AuthCredentialTypes.SERVICE_ACCOUNT:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0# Initialize the tools to use the credentials in the service account key.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0creds, _ = google.auth.load_credentials_from_file(&#8220;service_account_key.json&#8221;)<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0credentials_config = BigQueryCredentialsConfig(credentials=creds)<\/span><\/p>\n<p><span style=\"font-weight: 400;\">else:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0# Initialize the tools to use the application default credentials.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0application_default_credentials, _ = google.auth.default()<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0credentials_config = BigQueryCredentialsConfig(<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0credentials=application_default_credentials<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0)<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u200b<\/span><\/p>\n<p><span style=\"font-weight: 400;\">bigquery_toolset = BigQueryToolset(credentials_config=credentials_config, \u00a0 tool_filter=[<\/span><\/p>\n<p><span style=\"font-weight: 400;\">&#8216;list_dataset_ids&#8217;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">&#8216;get_dataset_info&#8217;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">&#8216;list_table_ids&#8217;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">&#8216;get_table_info&#8217;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">&#8216;execute_sql&#8217;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0])<\/span><\/p>\n<p>You can use the tool_filter parameter to filter the tools you\u2019d like to expose to the agent.<\/p>\n<p>A note on authentication\u2026<\/p>\n<p>You currently have three options for authenticating with BigQuery:<\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\">Use the application default credentials that are associated with the environment where the code is running.<\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\">Use service account credentials by loading them from a service account key file.<\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\">Provide an OAuth 2.0 client_id and secret. This approach is typically used when an application needs a user to grant it permission to access their BigQuery data.<\/li>\n<\/ul>\n<p>For more granular control over your interaction with BigQuery, you can of course create your own custom function tools, which are implemented as Python functions that you expose to your agent.<\/p>\n<p><span style=\"font-weight: 400;\">When tools are implemented directly within an agent, even with built-in toolsets, the agent or application is responsible for managing its authentication to BigQuery, as well as the logic and implementation for each tool. This tight coupling creates challenges: updates to a tool or changes in its BigQuery connection method will require manual modification and redeployment for every agent, which can lead to inconsistencies and maintenance overhead.<\/span><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Tuy_chon_2_Su_dung_cac_cong_cu_duoc_xay_dung_san_cua_BigQuery_trong_MCP_Toolbox_for_Databases\"><\/span><b>Option 2: Use BigQuery\u2019s pre-built tools in MCP Toolbox for Databases<\/b><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><span style=\"font-weight: 400;\"><a href=\"https:\/\/gcloudvn.com\/en\/kienthuc\/collaborate-with-gemini-in-google-drive-now-available-on-mobile\/attachment\/3_dqbgape-max-1800x1800\/\" rel=\"attachment wp-att-23913\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-23913\" src=\"https:\/\/gcloudvn.com\/wp-content\/uploads\/2025\/10\/3_DqbGaPE.max-1800x1800-1.png\" alt=\"\" width=\"1800\" height=\"900\" srcset=\"https:\/\/gcloudvn.com\/wp-content\/uploads\/2025\/10\/3_DqbGaPE.max-1800x1800-1.png 1800w, https:\/\/gcloudvn.com\/wp-content\/uploads\/2025\/10\/3_DqbGaPE.max-1800x1800-1-768x384.png 768w, https:\/\/gcloudvn.com\/wp-content\/uploads\/2025\/10\/3_DqbGaPE.max-1800x1800-1-1536x768.png 1536w, https:\/\/gcloudvn.com\/wp-content\/uploads\/2025\/10\/3_DqbGaPE.max-1800x1800-1-18x9.png 18w\" sizes=\"auto, (max-width: 1800px) 100vw, 1800px\" \/><\/a>The MCP (Model Context Protocol) Toolbox for Databases is an open-source server that centralizes the hosting and management of toolsets, decoupling agentic applications from direct BigQuery interaction. Instead of managing tool logic and authentication themselves, agents act as MCP clients, requesting tools from the Toolbox. The MCP Toolbox handles all the underlying complexities, including secure connections to BigQuery, authentication and query execution.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">This centralized approach simplifies tool reuse across multiple agents, streamlines updates (tool logic can be modified and deployed on the Toolbox without requiring changes to every agent), and provides a single point for enforcing security policies.<\/span><\/p>\n<p>The MCP Toolbox for Databases natively supports BigQuery\u2019s pre-built toolset. To access these tools, you first need to create a new mcp-toolbox folder in the same directory as your ADK application, and then install the MCP Toolbox:<\/p>\n<p><a href=\"https:\/\/gcloudvn.com\/en\/kienthuc\/collaborate-with-gemini-in-google-drive-now-available-on-mobile\/attachment\/4_uageslh\/\" rel=\"attachment wp-att-23912\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-23912\" src=\"https:\/\/gcloudvn.com\/wp-content\/uploads\/2025\/10\/4_UageSLh.gif\" alt=\"\" width=\"1623\" height=\"458\" srcset=\"https:\/\/gcloudvn.com\/wp-content\/uploads\/2025\/10\/4_UageSLh.gif 1623w, https:\/\/gcloudvn.com\/wp-content\/uploads\/2025\/10\/4_UageSLh-768x217.gif 768w, https:\/\/gcloudvn.com\/wp-content\/uploads\/2025\/10\/4_UageSLh-1536x433.gif 1536w, https:\/\/gcloudvn.com\/wp-content\/uploads\/2025\/10\/4_UageSLh-18x5.gif 18w\" sizes=\"auto, (max-width: 1623px) 100vw, 1623px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">Set the BIGQUERY_PROJECT environment variable, this represents the project where your BigQuery jobs will be created, executed and billed:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">export BIGQUERY_PROJECT=<\/span><span style=\"font-weight: 400;\">&lt;YOUR_PROJECT_NAME&gt;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Ch\u1ea1y l\u1ec7nh n\u00e0y \u0111\u1ec3 kh\u1edfi \u0111\u1ed9ng h\u1ed9p c\u00f4ng c\u1ee5 v\u00e0 bao g\u1ed3m b\u1ed9 c\u00f4ng c\u1ee5 BigQuery:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">.\/toolbox &#8211;prebuilt bigquery<\/span><\/p>\n<p>Ta c\u0169ng c\u00f3 th\u1ec3\u00a0 c\u1ea5u h\u00ecnh MCP client b\u00ean trong IDE.<\/p>\n<p><b>Want to host your own custom tools in MCP Toolbox for Databases?<\/b><\/p>\n<p>You can define your own custom tools in SQL within a tools.yaml configuration file and  provide the \u2013tools-file option when starting your server. You cannot, however, use the --prebuilt and \u2013tools-file option together. If you want to use custom tools alongside prebuilt tools, you must use the \u2013tool-file option and manually specify the prebuilt tools you want to include in the configuration file, like so.<\/p>\n<p><span style=\"font-weight: 400;\">To connect your ADK application to the MCP Toolbox for Databases, you need to install toolbox-core:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">pip install toolbox-core<\/span><\/p>\n<p><span style=\"font-weight: 400;\">With your server up and running, you can retrieve your toolset using ToolboxSyncClient and its load_toolset() function:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">lang-py<\/span><\/p>\n<p><span style=\"font-weight: 400;\">from toolbox_core import ToolboxSyncClient<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u200b<\/span><\/p>\n<p><span style=\"font-weight: 400;\">bigquery_toolbox = ToolboxSyncClient(&#8220;http:\/\/127.0.0.1:5000&#8221;)<\/span><\/p>\n<p><span style=\"font-weight: 400;\">bigquery_toolset = bigquery_toolbox.load_toolset()<\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Khoi_tao_Conversational_Analytics_Agent\"><\/span><b>Run your Conversational Analytics Agent<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Assign either the built-in ADK toolset, or the MCP toolset to your agent, and you\u2019re ready to go!<\/span><\/p>\n<p><span style=\"font-weight: 400;\">root_agent = Agent(<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0model=&#8221;gemini-2.0-flash&#8221;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0name=&#8221;bigquery_agent&#8221;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0description=(<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#8220;Agent that answers questions about BigQuery data by executing SQL queries&#8221;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0),<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0instruction=&#8221;&#8221;&#8221; You are a data analysis agent with access to several BigQuery tools. Make use of those tools to answer the user&#8217;s questions.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;&#8221;&#8221;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0tools=[bigquery_toolset]<\/span><\/p>\n<p><span style=\"font-weight: 400;\">)<\/span><\/p>\n<p><span style=\"font-weight: 400;\">You can now run your agent using the <\/span><span style=\"font-weight: 400;\">adk run<\/span><span style=\"font-weight: 400;\"> or <\/span><span style=\"font-weight: 400;\">adk web<\/span><span style=\"font-weight: 400;\"> command and start asking questions about your data!<\/span><\/p>\n<p>Your agent will leverage pre-built tools to extract dataset metadata, and then generate and execute a SQL query in BigQuery to retrieve your result:<\/p>\n<p><a href=\"https:\/\/gcloudvn.com\/en\/kienthuc\/collaborate-with-gemini-in-google-drive-now-available-on-mobile\/attachment\/6_fwsa1hu-max-1600x1600\/\" rel=\"attachment wp-att-23910\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-23910\" src=\"https:\/\/gcloudvn.com\/wp-content\/uploads\/2025\/10\/6_FwSa1HU.max-1600x1600-1.png\" alt=\"\" width=\"1534\" height=\"1442\" srcset=\"https:\/\/gcloudvn.com\/wp-content\/uploads\/2025\/10\/6_FwSa1HU.max-1600x1600-1.png 1534w, https:\/\/gcloudvn.com\/wp-content\/uploads\/2025\/10\/6_FwSa1HU.max-1600x1600-1-768x722.png 768w, https:\/\/gcloudvn.com\/wp-content\/uploads\/2025\/10\/6_FwSa1HU.max-1600x1600-1-13x12.png 13w\" sizes=\"auto, (max-width: 1534px) 100vw, 1534px\" \/><\/a><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Ket_luan_Bien_Kho_du_lieu_thanh_%E2%80%9CXuong_san_xuat%E2%80%9D_AI_Agent\"><\/span><strong><span data-markdown-start-index=\"187\">Conclusion: Turning the Data Warehouse into an AI Agent \u201cFactory\u201d<\/span><\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span data-markdown-start-index=\"248\">The integration of Google BigQuery with the Agent Development Kit (ADK) and Model Customization Platform (MCP) is more than just a feature update, it marks a strategic shift. BigQuery has now moved beyond being a passive data warehouse to becoming a true AI Agent \u201cfactory\u201d \u2013 where data, development tools, and custom models converge.<\/span><\/p>\n<p><span data-markdown-start-index=\"642\">By breaking down traditional silos, Google is democratizing the ability to create complex AI agents, empowering developers to create intelligent, deeply customized, contextually aware digital agents faster and more efficiently than ever before. The future of enterprise AI is no longer about moving data to the model, but about bringing the model and tooling to the data.<\/span><\/p>\n<p><span data-markdown-start-index=\"1088\">However, the journey to turn your data warehouse into an intelligent AI Agent \u201cfactory\u201d requires deep expertise in both data structure and AI architecture.<\/span><\/p>\n<p><strong><span data-markdown-start-index=\"1248\">Contact Gimasys \u2013 Google Cloud Premier Partner today.<\/span><\/strong><\/p>\n<p><span data-markdown-start-index=\"1323\">With extensive experience in implementing data solutions on BigQuery and AI strategy consulting capabilities, we will help you not only understand, but also maximize the power of the ADK and MCP toolkit, building a solid roadmap to turn data into competitive advantage through exclusive AI Agents.<\/span><\/p>","protected":false},"excerpt":{"rendered":"<p>Cu\u1ed9c c\u00e1ch m\u1ea1ng v\u1ec1 AI Agent (T\u00e1c t\u1eed AI) \u0111ang di\u1ec5n ra v\u1edbi t\u1ed1c \u0111\u1ed9 ch\u00f3ng m\u1eb7t, v\u00e0 m\u1ecdi doanh nghi\u1ec7p \u0111\u1ec1u mu\u1ed1n s\u1edf h\u1eefu nh\u1eefng &#8220;nh\u00e2n vi\u00ean s\u1ed1&#8221; t\u1ef1 tr\u1ecb c\u1ee7a ri\u00eang m\u00ecnh. Tuy nhi\u00ean, con \u0111\u01b0\u1eddng t\u1eeb \u00fd&hellip;<\/p>","protected":false},"author":2,"featured_media":23909,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[1,135],"tags":[],"class_list":["post-23972","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-kienthuc","category-google-cloud-platform","entry","has-media"],"_links":{"self":[{"href":"https:\/\/gcloudvn.com\/en\/wp-json\/wp\/v2\/posts\/23972","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gcloudvn.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gcloudvn.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gcloudvn.com\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/gcloudvn.com\/en\/wp-json\/wp\/v2\/comments?post=23972"}],"version-history":[{"count":0,"href":"https:\/\/gcloudvn.com\/en\/wp-json\/wp\/v2\/posts\/23972\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gcloudvn.com\/en\/wp-json\/wp\/v2\/media\/23909"}],"wp:attachment":[{"href":"https:\/\/gcloudvn.com\/en\/wp-json\/wp\/v2\/media?parent=23972"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gcloudvn.com\/en\/wp-json\/wp\/v2\/categories?post=23972"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gcloudvn.com\/en\/wp-json\/wp\/v2\/tags?post=23972"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}