Community程式設計與開發github.com

google-maps-automation

透過 Rube MCP (Composio) 自動化 Google Maps 任務:地址地理編碼、地點搜尋、路線規劃、距離矩陣計算、反向地理編碼、自動完成及取得地點詳細資訊。請務必先使用工具搜尋取得最新 Schema。

google-maps-automation 是什麼?

此技能可讓您在 AI Agent 中直接呼叫 Google Maps API,用於自動化地理資訊查詢與路線規劃。它透過 Rube MCP (Composio) 中介,因此不需管理複雜的 API 金鑰與 OAuth 流程,只需建立一次連線即可開始使用。支援的平台包括任何能安裝 MCP 客戶端的環境,例如 Claude Desktop、Cursor 或自訂應用程式。核心功能涵蓋地址轉座標、文字搜尋店家、計算兩點或多點之間的路線與距離、反向地理編碼、取得地點詳細資料(營業時間、聯絡資訊、評論等)以及地圖嵌入。使用時必須先呼叫 `RUBE_SEARCH_TOOLS` 取得當下的工具 Schema,再透過 `GOOGLE_MAPS_*` 系列工具執行任務。文件中也列出常見的組合模式與已知陷阱,例如路線矩陣的回應結構、時長格式的解析以及某些 `travelMode` 不能搭配 `routingPreference` 的限制,協助開發者避免常見錯誤。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ComposioHQ/awesome-claude-skills/tree/master/composio-skills/google-maps-automation

Installed? Explore more 程式設計與開發 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜歡的 AI 中提問

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

說明文件

透過 Rube MCP 自動化 Google Maps

使用 Rube MCP (Composio) 對 Google Maps 進行地址地理編碼、地點搜尋、路線規劃、距離矩陣計算及取得地點詳細資訊。

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

先決條件

  • 必須已連線 Rube MCP(可使用 RUBE_SEARCH_TOOLS)
  • 透過 RUBE_MANAGE_CONNECTIONS 使用工具組 google_maps 建立有效連線
  • 永遠先呼叫 RUBE_SEARCH_TOOLS 以取得目前工具 Schema

設定

取得 Rube MCP:在客戶端設定中將 https://rube.app/mcp 加入為 MCP 伺服器。不需要 API 金鑰 — 只需加入端點即可運作。

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

核心工作流程

1. 地址地理編碼

使用 GOOGLE_MAPS_GEOCODING_API 將街道地址轉換為地理座標(緯度/經度)。

工具:GOOGLE_MAPS_GEOCODING_API
參數:
  - address:要進行地理編碼的街道地址或 plus code
  - latlng:用於反向地理編碼的緯度/經度(例如 "40.714224,-73.961452")
  - place_id:用於地點地理編碼的地點 ID
  - language:結果的語言
  - region:區域偏差(ccTLD 代碼)
  - bounds:用於視窗偏差的邊界框
  - components:元件篩選(例如 "postal_code:94043|country:US")

2. 搜尋地點

使用 GOOGLE_MAPS_TEXT_SEARCH 透過自由文字查詢尋找地點。

工具:GOOGLE_MAPS_TEXT_SEARCH
參數:
  - textQuery(必填):搜尋文字(例如 "restaurants in London")
  - fieldMask:要回傳的欄位(例如 "displayName,formattedAddress,rating")
  - maxResultCount:最大結果數(1-20,預設 10)

3. 取得兩地點間的路線

使用 GOOGLE_MAPS_GET_ROUTE 計算包含距離與時間的路線。

工具:GOOGLE_MAPS_GET_ROUTE
參數:
  - origin_address(必填):起點(地址或 "lat,lng")
  - destination_address(必填):終點(地址或 "lat,lng")
  - travelMode:DRIVE、BICYCLE、WALK、TWO_WHEELER 或 TRANSIT
  - routingPreference:TRAFFIC_UNAWARE、TRAFFIC_AWARE、TRAFFIC_AWARE_OPTIMAL
  - computeAlternativeRoutes:是否回傳替代路線(布林值)
  - units:METRIC 或 IMPERIAL
  - languageCode:BCP-47 語言代碼
  - routeModifiers_avoidTolls / avoidHighways / avoidFerries:路線偏好設定

4. 計算距離矩陣

使用 GOOGLE_MAPS_COMPUTE_ROUTE_MATRIX 計算多個起點與終點之間的距離與時間。

工具:GOOGLE_MAPS_COMPUTE_ROUTE_MATRIX
參數:
  - origins(必填):起點位置陣列(地址字串或 lat/lng 物件)
  - destinations(必填):終點位置陣列
  - travelMode:DRIVE、BICYCLE、WALK、TWO_WHEELER 或 TRANSIT
  - routingPreference:TRAFFIC_UNAWARE、TRAFFIC_AWARE、TRAFFIC_AWARE_OPTIMAL
  - fieldMask:要包含的回應欄位
  - units:METRIC 或 IMPERIAL

5. 取得地點詳細資訊

使用 GOOGLE_MAPS_GET_PLACE_DETAILS 取得特定地點的完整資訊。

工具:GOOGLE_MAPS_GET_PLACE_DETAILS
說明:使用地點的資源名稱(places/{place_id} 格式)取得詳細資料。
  回傳營業時間、聯絡資訊、評論等。
注意:呼叫 RUBE_SEARCH_TOOLS 以取得此工具的完整 Schema。

6. 搜尋附近地點

使用 GOOGLE_MAPS_NEARBY_SEARCH 尋找指定點周圍圓形區域內的地點。

工具:GOOGLE_MAPS_NEARBY_SEARCH
參數:
  - latitude(必填):中心緯度(-90 至 90)
  - longitude(必填):中心經度(-180 至 180)
  - radius(必填):搜尋半徑(公尺,最大 50000)
  - includedTypes:要包含的地點類型(例如 ["restaurant", "cafe"])
  - excludedTypes:要排除的地點類型
  - fieldMask:要回傳的欄位
  - maxResultCount:最大結果數(1-20)

常見組合模式

  • 地理編碼後規劃路線:使用 GOOGLE_MAPS_GEOCODING_API 將地址轉為座標,再用 GOOGLE_MAPS_GET_ROUTE 取得兩點間的路線。
  • 搜尋後取得詳細資料:使用 GOOGLE_MAPS_TEXT_SEARCH 尋找地點,再用 GOOGLE_MAPS_GET_PLACE_DETAILS 取得更豐富的元資料(營業時間、聯絡資訊、評論)。
  • 自動完成 UX:使用 GOOGLE_MAPS_AUTOCOMPLETE 在使用者輸入地址或地名時提供即時搜尋建議。
  • 反向地理編碼:使用 GOOGLE_MAPS_GEOCODE_LOCATION 將座標轉換為人類可讀的地址。
  • 批次距離計算:使用 GOOGLE_MAPS_COMPUTE_ROUTE_MATRIX 進行多對多距離計算,而不是重複呼叫 GOOGLE_MAPS_GET_ROUTE。
  • 嵌入地圖:使用 GOOGLE_MAPS_MAPS_EMBED_API 產生可嵌入的地圖 URL,用於地點、路線或搜尋結果。

已知陷阱

  • 路線矩陣結果結構:GOOGLE_MAPS_COMPUTE_ROUTE_MATRIX 的回應位於 data.elements 下,包含 originIndex、destinationIndex 以及 distanceMeters 和 duration,而非 routes[] 結構。
  • 時間格式:GOOGLE_MAPS_GET_ROUTE 回傳的時間為字串如 "937s",位於 data.response_data.routes 內。進行數值比較前必須先解析。
  • 鏈式查詢的地點 ID:在呼叫 GOOGLE_MAPS_GET_PLACE_DETAILS 以取得更豐富欄位時,使用 GOOGLE_MAPS_TEXT_SEARCH 回傳的地點識別碼。
  • 反向地理編碼輸入:GOOGLE_MAPS_GEOCODE_LOCATION 是基於座標的。請確保傳入 lat/lng(而非地址字串),以避免查詢錯配。
  • 路線偏好限制:當 travelMode 為 WALK、BICYCLE 或 TRANSIT 時,不能設定 routingPreference——這些模式下必須省略該參數。
  • 附近搜尋類型有效性:"food" 對 GOOGLE_MAPS_NEARBY_SEARCH 而言不是有效的類型(它屬於 Table B)。請改用具體類型如 restaurant、cafe、bakery、fast_food_restaurant。
  • 嵌入 API 僅使用 API 金鑰:GOOGLE_MAPS_MAPS_EMBED_API 需要 API 金鑰,且不支援 OAuth2。

快速參考

動作工具主要參數
地址地理編碼GOOGLE_MAPS_GEOCODING_APIaddress 或 latlng 或 place_id
反向地理編碼GOOGLE_MAPS_GEOCODE_LOCATION(請見 RUBE_SEARCH_TOOLS 的完整 Schema)
文字搜尋GOOGLE_MAPS_TEXT_SEARCHtextQuery、fieldMask、maxResultCount
附近搜尋GOOGLE_MAPS_NEARBY_SEARCHlatitude、longitude、radius、includedTypes
取得路線GOOGLE_MAPS_GET_ROUTEorigin_address、destination_address、travelMode
距離矩陣GOOGLE_MAPS_COMPUTE_ROUTE_MATRIXorigins、destinations、travelMode
地點詳細資料GOOGLE_MAPS_GET_PLACE_DETAILS(請見 RUBE_SEARCH_TOOLS 的完整 Schema)
自動完成GOOGLE_MAPS_AUTOCOMPLETEinput、includedRegionCodes、locationBias
地點照片GOOGLE_MAPS_PLACE_PHOTO(請見 RUBE_SEARCH_TOOLS 的完整 Schema)
嵌入地圖GOOGLE_MAPS_MAPS_EMBED_APImode 及各模式專屬參數

由 Composio 提供技術支援

Individual skills in this repo

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

ably-automation

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

abstract-automation

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

abuselpdb-automation

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

abyssale-automation

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

accelo-automation

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

accredible-certificates-automation

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

acculynx-automation

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

active-campaign-automation

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

addresszen-automation

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

adobe-automation

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

adrapid-automation

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

adyntel-automation

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

aeroleads-automation

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

aero-workflow-automation

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

affinda-automation

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

affinity-automation

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

agencyzoom-automation

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

agent-mail-automation

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

agentql-automation

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

agenty-automation

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

相關技能