Community编程与开发github.com

ComposioHQ/谷歌地图自动化(通过Rube MCP)

通过Rube MCP(Composio)自动执行谷歌地图任务:地理编码地址、搜索地点、获取路线、计算距离矩阵、反向地理编码、自动补全、获取地点详情。请始终先搜索工具以获取当前模式。

谷歌地图自动化(通过Rube MCP) 是什么?

此技能(SKILL)使AI代理能够通过Composio的Rube MCP集成完全自动化谷歌地图的操作。它提供了一套全面的工具,用于地理编码(地址与坐标互转)、文本和附近地点搜索、路径规划、距离矩阵计算以及获取详细的地点信息(如营业时间、联系方式、用户评价)。该技能主要面向使用Rube MCP协议的客户端,如Claude Code或Cursor,并强调在执行任何工作流之前必须通过`RUBE_SEARCH_TOOLS`获取最新的工具模式,以确保兼容性。工作流示例包括:地理编码后规划路线、搜索后获取详情、批处理距离计算等。此外,它还详细列出了关键陷阱,例如路线矩阵结果的结构差异、时长字符串格式解析、以及附近搜索中特定地点类型的限制,帮助开发者避免常见错误。

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

Installed? Explore more 编程与开发 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

谷歌地图自动化(基于Rube MCP)

使用谷歌地图通过Rube MCP(Composio)进行地理编码地址、搜索地点、获取路线、计算距离矩阵以及获取地点详情。

工具包文档:composio.dev/toolkits/google_maps

前提条件

  • 必须已连接 Rube MCP(RUBE_SEARCH_TOOLS 可用)
  • 通过工具包 google_maps 已建立活动连接(通过 RUBE_MANAGE_CONNECTIONS)
  • 始终优先调用 RUBE_SEARCH_TOOLS 以获取当前工具的模式定义

设置

获取 Rube MCP:在客户端配置中将 https://rube.app/mcp 添加为 MCP 服务器。无需 API 密钥——只需添加端点即可工作。

  1. 确认 Rube MCP 可用:检查 RUBE_SEARCH_TOOLS 是否正常响应
  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:用于地点地理编码的 Place 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 以获取此工具的完整模式。

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 获取更丰富的元数据(营业时间、联系方式、评价)。
  • 自动补全体验:使用 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 内。你必须在进行数值比较之前解析这些字符串。
  • 用于链式调用的 Place 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 的有效类型(它属于表 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 查看完整模式)
文本搜索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 查看完整模式)
自动补全GOOGLE_MAPS_AUTOCOMPLETEinput, includedRegionCodes, locationBias
地点照片GOOGLE_MAPS_PLACE_PHOTO(通过 RUBE_SEARCH_TOOLS 查看完整模式)
嵌入地图GOOGLE_MAPS_MAPS_EMBED_APImode,以及特定于模式的参数

由 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.

相关技能