Community编程与开发github.com

Google Maps 自动化

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

Google Maps 自动化 是什么?

该技能通过 Rube MCP (Composio) 提供了 Google Maps 的核心功能接口,允许 AI 代理以编程方式执行地理编码、地点搜索、路线规划、距离矩阵计算、反向地理编码、自动补全和地点详情获取等操作。它对于需要处理位置数据、优化物流、构建基于地图的搜索功能或自动化路线规划的开发者非常有用。该技能支持在支持 MCP 的客户端(如 Claude Code、Cursor 等)上运行,并利用了 Composio 的 google_maps 工具集。其工作流程强调先通过 `RUBE_SEARCH_TOOLS` 获取最新的工具模式,再调用具体的 Google Maps 工具,如 `GOOGLE_MAPS_GEOCODING_API`、`GOOGLE_MAPS_TEXT_SEARCH` 和 `GOOGLE_MAPS_GET_ROUTE`。此外,它还提供常见模式(如先地理编码再规划路线)和已知陷阱(如路线矩阵结果结构、时长格式处理等)的指导,帮助用户避免常见错误。

兼容平台~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 自动化

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

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

前置条件

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

设置

获取 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:要进行地理编码的街道地址或加码
  - 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(必需):搜索文本(例如 "伦敦的餐馆")
  - 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 在 data.response_data.routes 内部将持续时间返回为类似 "937s" 的字符串。在进行数值比较之前,您必须解析这些字符串。
  • 用于链式调用的地点 ID:在调用 GOOGLE_MAPS_GET_PLACE_DETAILS 时,使用从 GOOGLE_MAPS_TEXT_SEARCH 返回的地点标识符以获取更丰富的字段。
  • 反向地理编码输入:GOOGLE_MAPS_GEOCODE_LOCATION 是基于坐标的。确保传递纬度/经度(而不是地址字符串),以避免查找不匹配。
  • 路线偏好限制:当 travelMode 为 WALK、BICYCLE 或 TRANSIT 时,不能设置 routingPreference——对于这些模式必须省略。
  • 附近搜索类型有效性:"food" 对于 GOOGLE_MAPS_NEARBY_SEARCH 不是有效类型(它是表 B 类型)。请改用具体类型,如 restaurant、cafe、bakery、fast_food_restaurant。
  • Embed 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.

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.

相关技能