Baidu Map logo

Baidu Map

Community
infometa
baidu-map

百度地图位置服务技能 —— 地点检索与详情、路线规划(驾车/骑行/步行/公交)、批量算路、地址正逆解析、实时路况、天气、行政区划、地图调起与行程地图。说明各工具的真实参数、坐标顺序约定与实测坑位。

Overview

Publisherinfometa
Repositoryworkbuddyskills
Skill namebaidu-map
Stars
376
Forks
124
Bundled files
Instructions only
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by infometa on GitHub. Read the source before you install it.

Installation

Install the Baidu Map AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/infometa/workbuddyskills/tree/main/connectors/baidu-maps/skills/baidu-map
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/infometa/workbuddyskills.git /tmp/workbuddyskills
mkdir -p .claude/skills
cp -r /tmp/workbuddyskills/connectors/baidu-maps/skills/baidu-map .claude/skills/baidu-map
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Baidu Map in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Baidu Map on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Baidu Map is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

百度地图 Skill

本 Skill 覆盖百度地图 MCP Server(mcp-server-baidu-maps)暴露的全部工具。以下参数与行为均经真实调用验证,与工具自带 schema 存在差异之处已标注。

认证前置

  • 本 Connector 使用用户自填 AK:AK 由 WorkBuddy 加密存于本机 ~/.workbuddy 并在请求时注入服务地址,AI 不需要也不应在任何参数中传 ak。
  • AK 必须是开放平台控制台创建的**「服务器端」类型**;浏览器端 AK 会因 referer 校验被拒。
  • 鉴权类错误(AK 无效、服务未开通、配额耗尽)不要重试,直接提示用户去控制台检查 AK 类型、服务开通状态与当日配额。

坐标系与参数顺序(最高频出错点)

全部坐标为百度坐标系 bd09ll。用户给的若是 GPS(wgs84)或高德/腾讯(gcj02)坐标,存在数百米偏移,必须先说明,不要直接混用。

经纬度顺序在工具之间不一致,逐个确认:

工具参数顺序
map_search_placeslocation纬度,经度
map_directionsorigin / destination纬度,经度
map_directions_matrixorigins / destinations纬度,经度,多点用 | 分隔
map_road_trafficcenter / bounds / vertexes纬度,经度
map_search_procenter纬度,经度
map_urilocation纬度,经度
map_weatherlocation经度,纬度(与上面全部相反)
map_geoconvcoords经度,纬度

map_reverse_geocode 用独立数值参数 latitude / longitude(也接受别名 lat / lng),不涉及顺序。

另一处不一致:境内外开关在多数工具叫 is_chinese_mainland,但 map_weather 叫 is_china。两者都是字符串 "true" / "false",不是布尔。

district_id 是字符串类型的 6 位行政区划码(如 "330100"),不要传数字。

工具总览

服务端共暴露 14 个工具,均已实测。其中 map_geoconv 当前服务端返回错误、官方待修复,其余 13 个正常可用。

工具用途必填参数实测
map_geocode地址文本 → 坐标address✅
map_reverse_geocode坐标 → 地址/行政区划/周边(需给出经纬度对)✅
map_search_places关键字检索 POIquery✅
map_place_details用 uid 查 POI 详情uid✅
map_directions两点路线规划origin, destination✅
map_directions_matrix多起终点批量距离/耗时origins, destinations✅
map_weather实时天气 + 未来 5 天(district_id 或 location)✅
map_ip_locationIP → 城市—✅
map_road_traffic实时路况model✅
map_search_pro自然语言多维检索query, region✅
map_district_search行政区划 → adcode/边界/下级keyword✅
map_uri生成百度地图调起链接service✅
map_mark行程文本 → 可分享地图页text_content✅
map_geoconv坐标系转换coords⚠️ 待修复

典型耗时:多数工具 200~600ms;map_directions 与 map_search_pro 约 1s;map_mark 约 7s,调用前先告知用户在生成。

工具详解

map_geocode — 地理编码

参数类型必填说明
addressstring✅最多 84 字节。支持结构化地址("北京市海淀区上地十街10号"),也支持"路与路交叉口"(仅当地址库存在该描述时才有结果)
citystring-限定城市,消解同名地址,如"北京市"
inareastring-仅 is_chinese_mainland="false" 时有效,国家/地区代码,如 "USA,HKG"
is_chinese_mainlandstring-"true"(默认)/"false"。查港澳台及海外须传 "false"

返回 location.lng/lat 及 precise(是否精确)、confidence、level(地址层级)。precise=0 时应提示用户结果可能不准。

map_reverse_geocode — 逆地理编码

参数类型必填说明
latitudenumber-纬度(bd09ll),别名 lat
longitudenumber-经度(bd09ll),别名 lng

四个参数 schema 上都标 optional,但必须给出一对完整经纬度,否则无法定位。返回结构化地址、adcode、所在道路与周边 POI。

map_search_places — 地点检索

两种模式:给 region 做城市内检索(最细到 city 级);给 location + radius 做圆形周边检索。

参数类型必填说明
querystring✅关键字,至多 10 个,英文逗号分隔
tagstring-中文分类过滤,如 "美食,购物"
regionstring-城市名或 citycode,不传默认全国;is_chinese_mainland="false" 时必传且只能是文本(如"东京")
locationstring-圆形检索中心点,纬度,经度
radiusinteger-圆形检索半径(米),与 location 配对使用
languagestring-返回语言,如 "en"、"jp"、"cht"
is_chinese_mainlandstring-同上

返回 results[],每项含 uid —— 交给 map_place_details 取详情。

map_place_details — 地点详情

参数类型必填说明
uidstring✅POI 唯一标识,来自 map_search_places
is_chinese_mainlandstring-同上

返回评分、营业时间、品牌、价格等,字段随 POI 类型变化,不要假定某字段一定存在。

map_directions — 路线规划

参数类型必填说明
originstring✅起点,位置名称或 纬度,经度
destinationstring✅终点,同上
modelstring-driving(默认)/riding/walking/transit
is_chinese_mainlandstring-起终点任一在内地则传 "true"

参数名是 model,不是 mode。 该工具直接接受地名(实测 origin="北京西站", destination="故宫" 可成功),无需先跑 map_geocode;仅当地名有歧义、需要用户确认选哪个时,才先用 map_search_places 列候选。

map_directions_matrix — 批量算路

参数类型必填说明
originsstring✅多起点 纬度,经度,用 | 分隔
destinationsstring✅多终点,同上
modelstring-driving / riding / walking

只接受坐标,不接受地名(与 map_directions 不同),地名需先 map_geocode。限额:驾车起终点个数之积 ≤ 100;步行任意起终点间距 ≤ 200KM,超限返回参数错误。

map_weather — 天气查询

district_id 与 location 二选一,返回实时天气 + 未来 5 天预报。

参数类型必填说明
district_idstring-字符串形式的 6 位行政区划码,如 "330100"
locationstring-经度,纬度(注意与其他工具相反)
is_chinastring-字段名是 is_china,不是 is_chinese_mainland;含港澳台算 "true"

不知道 adcode 时,先 map_district_search(keyword="杭州市") 拿 code,再传 district_id。

map_ip_location — IP 定位

参数类型必填说明
ipstring-留空或不传则定位当前出口 IP,支持 IPv4/IPv6

实测普通服务端 AK 即可调用。注意留空时返回的是服务器出口 IP 的位置,不是用户真实位置 —— 不要拿它当"用户当前位置"直接用于推荐,除非用户确认。

map_road_traffic — 实时路况

model 必填,再给对应范围参数:

model必须同时给说明
roadroad_name + city按道路名查
boundbounds矩形,纬度,经度;纬度,经度(左下;右上)
polygonvertexes多边形顶点,; 分隔
aroundcenter + radius圆形,radius 取值 [1,1000] 米

⚠️ 两个实测坑,schema 里的说明是错的:

  1. road_name 不能带方向后缀。 schema 举例 "朝阳路南向北",实测直接报 road_name错误;传 "朝阳路" 才成功。一律只传纯道路名。另外道路名必须是具体街道 —— "三环" 这类泛称会失败。
  2. bounds 有面积上限。 约 0.03°×0.03° 就报 bounds范围过大;0.01°×0.01°(约 1km²)正常。范围大时改用 model="around"。

map_search_pro — 多维检索

参数类型必填说明
querystring✅自然语言检索词,如"宠物友好餐厅"
regionstring✅必填,城市或区域名
typestring-对召回结果二次筛选,如"火锅""民宿"
centerstring-中心点 纬度,经度,用于按距离排序

仅在需求模糊时优先用它(如"可以带狗的餐厅""适合自驾的景点")。语义检索可能返回 total:0(实测"可以带狗的餐厅"/杭州市 即为 0 条);此时应回退到 map_search_places 用具体关键字 + tag 再试,而不是直接告诉用户"没有"。

map_district_search — 行政区划检索

参数类型必填说明
keywordstring✅行政区名("中国""河北省""深圳市",省/市/区/镇)或 adcode
boundarystring-"1" 返回边界坐标,"0"(默认)不返回

返回 code(adcode)、name、下级子区划列表。这是拿 adcode 的标准入口,给 map_weather 用。边界数据量大,非必要不要传 boundary="1"。

map_uri — 地图调起链接

生成可直接在百度地图 App / 网页打开的链接,返回的是一个 URL 字符串,不是 JSON。

参数类型必填说明
servicestring✅"direction"(路线)或 "search"(检索)
origin / destinationstring-direction 用。格式 name:天安门|latlng:39.98871,116.43234,名称仅用于展示
modestring-direction 用:driving(默认)/transit/walking
regionstring-起终点同城时给一次即可
origin_region / destination_regionstring-分别指定起终点城市
querystring-search 用,如"海底捞"
locationstring-search 用,中心点 纬度,经度
radiusstring-search 用,半径(米),字符串类型

用户想"用手机导航过去"时用这个,把链接给他。

map_mark — 行程地图

参数类型必填说明
text_contentstring✅行程规划文本,避免特殊字符(如 \)

返回一个可分享的地图页 URL 及二维码。做完多天行程规划后,除了文字讲解,应同时调它生成可视化地图。实测约 7 秒,调用前先跟用户说一句在生成。

map_geoconv — 坐标转换

在不同坐标系之间转换坐标(wgs84 / gcj02 / bd09ll / bd09mc)。

参数类型必填说明
coordsstring✅待转换坐标,经度,纬度,多组用 ; 分隔
modelstring-字符串形式的转换类型(如 "1"~"6");传整数会被 schema 拒绝(2 is not of type 'string')

⚠️ 服务端当前状态:实测各参数组合(model 取 "1"~"6"、省略 model、以及 schema 自带的示例坐标)均返回 param error:from illegal, not support such coord type。这是服务端问题、不是调用姿势问题,官方正在修复;修复后按上表参数正常调用。

遇到该报错时不必反复调参重试,如实告知用户该能力正在修复,并给出替代路径:想定位某个 GPS 坐标附近可用 map_reverse_geocode(它按 bd09ll 解读,存在数百米偏移需说明),或让用户提供地名走 map_geocode 拿到准确的 bd09ll 坐标。

常见组合调用

地名 → 路线:直接 map_directions(origin="北京西站", destination="故宫", model="driving")。不要先跑 map_geocode —— 该工具原生接受地名。仅当地名歧义时才用 map_search_places 让用户在候选里选。

周边推荐 → 详情:

  1. map_geocode 或 map_search_places 定位中心点
  2. map_search_places(query="咖啡", location="纬度,经度", radius=2000)
  3. 对用户感兴趣的那家 map_place_details(uid=...) 取评分、营业时间

查天气:map_district_search(keyword="杭州市") 取 code → map_weather(district_id="330100")。手上已有坐标时可直接 map_weather(location="经度,纬度"),注意经度在前。

多地点比通勤:用 map_directions_matrix 一次算完,不要循环调 map_directions。记得它只吃坐标。

多天行程规划:文字方案讲解 + map_mark(text_content=...) 生成可分享地图;用户要手机导航再补 map_uri。

模糊需求:先 map_search_pro;返回 0 条则回退 map_search_places + tag。

结果呈现建议

  • 距离换算成米/公里,耗时换算成分钟/小时,不要直抛原始秒数和米数。
  • 路线多方案时说明差异(距离、耗时、是否走高速),让用户选。
  • POI 超过 5 条先给前几条并说明还有更多,不要铺开长列表。
  • map_geocode 返回 precise=0 或置信度低时,主动提示结果可能不准。
  • 出行结论(如"来得及")要注明依据的是实时路况还是静态里程。

异常处理

现象处理
AK 无效 / 服务未开通 / 配额耗尽不重试,提示用户去控制台检查 AK 类型(须服务器端)、服务开通与配额
road_name错误去掉方向后缀,只传纯道路名;泛称改用具体街道名
bounds范围过大缩小矩形,或改 model="around"
参数校验错误(如 is not of type 'string')该服务多数"数值型"参数实为字符串(district_id、radius in map_uri、model in map_geoconv),按表格类型传
map_search_pro 返回 total:0回退 map_search_places + 具体关键字/tag,不要直接回"没有"
map_geoconv 报 from illegal服务端待修复,调参重试无效;如实告知并改走 map_reverse_geocode / map_geocode
请求超时单次应在 30s 内返回;map_mark 本身约 7s 属正常。超时先确认网络与配额,再缩小检索范围

注意事项

  • 本 Skill 全部工具均为只读查询,不修改用户数据,无需二次确认。
  • 工具名以 map_ 前缀统一;注意 map_directions_matrix(不是 map_distance_matrix)、路线类参数名为 model(不是 mode)。
  • 本文基于服务端 mcp-server-baidu-maps v1.28.0、协议 2025-06-18 实测。若服务端升级后行为不符,以运行时 schema 与实际响应为准。

Frequently asked questions

What does the Baidu Map AI skill do?

百度地图位置服务技能 —— 地点检索与详情、路线规划(驾车/骑行/步行/公交)、批量算路、地址正逆解析、实时路况、天气、行政区划、地图调起与行程地图。说明各工具的真实参数、坐标顺序约定与实测坑位。

Why use Baidu Map on TypingMind?

Because you install it once and use it with any model. Baidu Map is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Baidu Map in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/infometa/workbuddyskills/tree/main/connectors/baidu-maps/skills/baidu-map. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Baidu Map?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Baidu Map?

As many as you like. As long as a model supports skills, you can use Baidu Map with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Baidu Map AI skill free?

It is published on GitHub by infometa. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇