Community研究與資料分析github.com

ComposioHQ/googlebigquery-automation

透過 Rube MCP (Composio) 自動化 Google BigQuery 任務:執行 SQL 查詢、探索資料集與中繼資料,並經由 Metabase 整合執行 MBQL 查詢。請務必先搜尋工具以取得最新結構描述。

googlebigquery-automation 是什麼?

這項技能專為開發者與 AI 代理器設計,使其能透過 Rube MCP(基於 Composio)與 Metabase API 的整合,以結構化方式與 Google BigQuery 互動。它提供多個預先定義的工作流程,包括執行原生 SQL 查詢、使用 Metabase Query Language (MBQL) 建構彙總與篩選查詢、擷取資料庫與資料表的中繼資料,以及將 MBQL 查詢轉換為原生 SQL。這項技能支援 Cursor、Claude Code 及 Codex 等平台,只要這些平台能透過 Rube MCP 伺服器端點 (`https://rube.app/mcp`) 進行連線即可。其核心優勢在於將 BigQuery 資料存取抽象化,透過 Metabase 的商業智慧層來運作,因此使用者無需直接處理 BigQuery API,即可進行資料探索、結構描述檢查與高效能查詢。使用者需先啟用 Rube MCP 連線,並透過 `RUBE_MANAGE_CONNECTIONS` 工具建立 Metabase 連線,之後才能呼叫各項專用工具。該技能內建常見使用模式與已知陷阱的指引,可大幅簡化 BigQuery 工作流程並提升生產力。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ComposioHQ/awesome-codex-skills/tree/main/composio-skills/googlebigquery-automation

Installed? Explore more 研究與資料分析 skills: affaan-m/uspto-database, affaan-m/scholar-evaluation, affaan-m/literature-review · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

透過 Rube MCP 自動化 Google BigQuery

執行 SQL 查詢、探索資料庫結構描述,並透過 Metabase 整合,使用 Rube MCP (Composio) 分析資料集。

工具組文件:composio.dev/toolkits/googlebigquery

先決條件

  • 必須已連線 Rube MCP(RUBE_SEARCH_TOOLS 可用)
  • 透過 RUBE_MANAGE_CONNECTIONS 使用工具組 metabase 建立活躍連線
  • 一個已連線至 BigQuery 資料來源的 Metabase 執行個體
  • 務必先呼叫 RUBE_SEARCH_TOOLS 以取得目前工具結構描述

設定

取得 Rube MCP:在用戶端設定中將 https://rube.app/mcp 新增為 MCP 伺服器。無需 API 金鑰 — 僅需新增端點即可運作。

  1. 確認 RUBE_SEARCH_TOOLS 有回應,以驗證 Rube MCP 可用
  2. 使用工具組 metabase 呼叫 RUBE_MANAGE_CONNECTIONS
  3. 若連線狀態非 ACTIVE,請依照回傳的驗證連結完成設定
  4. 在執行任何工作流程前,確認連線狀態顯示為 ACTIVE

注意:BigQuery 資料會透過 Metabase 存取。Metabase 是一種商業智慧工具,可將 BigQuery 作為資料來源進行連線。以下工具會透過 Metabase 的 API 執行查詢並擷取中繼資料。

核心工作流程

1. 執行原生 SQL 查詢

使用 METABASE_POST_API_DATASET,並將 type 設為 native,以針對您的 BigQuery 資料庫執行原始 SQL 查詢。

工具:METABASE_POST_API_DATASET
參數:
  - database(必要):Metabase 資料庫 ID(整數)
  - type(必要):使用 "native" 表示 SQL 查詢
  - native(必要):物件,包含 "query" 字串
    - query:原始 SQL 字串(例如 "SELECT * FROM users LIMIT 10")
    - template_tags:參數化查詢變數(選擇性)
  - constraints:{ "max-results": 1000 }(選擇性)

2. 執行結構化 MBQL 查詢

使用 METABASE_POST_API_DATASET,並將 type 設為 query,以執行 Metabase Query Language 查詢,支援內建彙總與篩選。

工具:METABASE_POST_API_DATASET
參數:
  - database(必要):Metabase 資料庫 ID
  - type(必要):使用 "query" 表示 MBQL
  - query(必要):物件,包含:
    - source-table:資料表 ID(整數)
    - aggregation:例如 [["count"]] 或 [["sum", ["field", 5, null]]]
    - breakout:分組欄位
    - filter:篩選條件
    - limit:最大列數
    - order-by:排序欄位

3. 取得查詢中繼資料

使用 METABASE_POST_API_DATASET_QUERY_METADATA 以擷取可供查詢的資料庫、資料表及欄位中繼資料。

工具:METABASE_POST_API_DATASET_QUERY_METADATA
參數:
  - database(必要):Metabase 資料庫 ID
  - type(必要):"query" 或 "native"
  - query(必要):查詢物件(例如 {"source-table": 1})

4. 將查詢轉換為原生 SQL

使用 METABASE_POST_API_DATASET_NATIVE 將 MBQL 查詢轉換為其原生 SQL 表示。

工具:METABASE_POST_API_DATASET_NATIVE
參數:
  - database(必要):Metabase 資料庫 ID
  - type(必要):"native"
  - native(必要):物件,包含 "query" 與選擇性的 "template_tags"
  - parameters:查詢參數值(選擇性)

5. 列出可用資料庫

使用 METABASE_GET_API_DATABASE 以探索 Metabase 中設定的所有資料庫連線。

工具:METABASE_GET_API_DATABASE
說明:擷取 Metabase 中設定的所有 Database 執行個體清單。
注意:請呼叫 RUBE_SEARCH_TOOLS 以取得此工具的完整結構描述。

6. 取得資料庫結構描述中繼資料

使用 METABASE_GET_API_DATABASE_ID_METADATA 以擷取特定資料庫的完整資料表與欄位資訊。

工具:METABASE_GET_API_DATABASE_ID_METADATA
說明:擷取特定資料庫的完整中繼資料,包含所有資料表與欄位。
注意:請呼叫 RUBE_SEARCH_TOOLS 以取得此工具的完整結構描述。

常見模式

  • 先探索再查詢:使用 METABASE_GET_API_DATABASE 尋找資料庫 ID,再使用 METABASE_GET_API_DATABASE_ID_METADATA 探索資料表與欄位,最後使用 METABASE_POST_API_DATASET 執行查詢。
  • SQL 優先方法:使用 METABASE_POST_API_DATASET 並將 type 設為 native,撰寫標準 SQL 查詢以獲得最大靈活性。
  • 參數化查詢:在原生查詢中使用 template_tags 以安全地參數化(例如 SELECT * FROM users WHERE id = {{user_id}})。
  • 結構描述探索:使用 METABASE_POST_API_DATASET_QUERY_METADATA 在建構複雜查詢前了解資料表結構。
  • 取得參數值:使用 METABASE_POST_API_DATASET_PARAMETER_VALUES 以取得篩選下拉選單的可能值。

已知陷阱

  • database 參數是 Metabase 內部的整數 ID,而非 BigQuery 專案或資料集名稱。請先使用 METABASE_GET_API_DATABASE 尋找有效的資料庫 ID。
  • MBQL 查詢中的 source-table 同樣是 Metabase 內部的整數,而非 BigQuery 資料表名稱。請透過中繼資料工具發現資料表 ID。
  • 原生 SQL 查詢使用 BigQuery SQL 方言(標準 SQL)。請確保您的語法與 BigQuery 相容。
  • constraints 中的 max-results 預設值可能會限制回傳的列數。對於大型結果集,請明確設定。
  • METABASE_POST_API_DATASET 的回應中,結果會巢狀在 data 之下 — 請仔細解析,因為結構可能較為深層。
  • 用於 MBQL 中 aggregation、breakout 與 filter 陣列的 Metabase 欄位 ID 必須是從中繼資料回應中取得的整數。

快速參考

動作工具關鍵參數
執行 SQL 查詢METABASE_POST_API_DATASETdatabase, type: "native", native.query
執行 MBQL 查詢METABASE_POST_API_DATASETdatabase, type: "query", query
取得查詢中繼資料METABASE_POST_API_DATASET_QUERY_METADATAdatabase, type, query
轉換為 SQLMETABASE_POST_API_DATASET_NATIVEdatabase, type, native
取得參數值METABASE_POST_API_DATASET_PARAMETER_VALUESparameter, field_ids
列出資料庫METABASE_GET_API_DATABASE(請透過 RUBE_SEARCH_TOOLS 查看完整結構描述)
取得資料庫中繼資料METABASE_GET_API_DATABASE_ID_METADATA(請透過 RUBE_SEARCH_TOOLS 查看完整結構描述)

由 Composio 提供

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

ComposioHQ/-21risk-automation

Automate 21risk tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/-2chat-automation

Automate 2chat tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/ably-automation

Automate Ably tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/abstract-automation

Automate Abstract tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/abuselpdb-automation

Automate Abuselpdb tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/abyssale-automation

Automate Abyssale tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/accelo-automation

Automate Accelo tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/accredible-certificates-automation

Automate Accredible Certificates tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/acculynx-automation

Automate Acculynx tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/active-campaign-automation

Automate ActiveCampaign tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/addresszen-automation

Automate Addresszen tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/adobe-automation

Automate Adobe tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/adrapid-automation

Automate Adrapid tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/adyntel-automation

Automate Adyntel tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/aeroleads-automation

Automate Aeroleads tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/aero-workflow-automation

Automate Aero Workflow tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/affinda-automation

Automate Affinda tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/affinity-automation

Automate Affinity tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/agencyzoom-automation

Automate Agencyzoom tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/agent-deep-links

Build, validate, and troubleshoot deep links for Codex, Cursor, VS Code, Visual Studio, and similar tools. Use when users ask for clickable links (especially in Slack) that open threads, files, folders, or app settings.

相關技能