didi-ride

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

DiDi Ride (滴滴出行)

DiDi Ride(滴滴出行)

Drive the user's DiDi (滴滴出行) account through the DiDi MCP server: book rides, estimate fares, track orders, cancel, and plan routes.
The
didi
BYOC connector injects one env var into the sandbox:
  • DIDI_MCP_KEY
    — the user's DiDi MCP key. Secret — never echo, print, or log it.
If
DIDI_MCP_KEY
is missing, tell the user to connect the DiDi connector at auth.acedata.cloud/user/connections (they get the key by scanning the QR in the 滴滴出行 App or via https://mcp.didichuxing.com/claw).
通过DiDi MCP服务器操作用户的**DiDi(滴滴出行)**账号:预约打车、预估车费、追踪订单、取消订单以及规划路线。
didi
BYOC连接器会向沙箱注入一个环境变量:
  • DIDI_MCP_KEY
    — 用户的DiDi MCP密钥。机密信息——切勿回显、打印或记录。
如果缺少
DIDI_MCP_KEY
,请告知用户前往auth.acedata.cloud/user/connections连接DiDi连接器(用户可通过扫描滴滴出行App中的二维码或访问https://mcp.didichuxing.com/claw获取密钥)。

CLI

CLI

The skill ships a stdlib-only helper that speaks the MCP Streamable-HTTP protocol to DiDi. Point at it once:
bash
DIDI=$SKILL_DIR/scripts/didi.py
Two commands:
bash
python3 $DIDI list                        # list tools + their JSON input schemas
python3 $DIDI call <tool> '<json-args>'   # call any tool
Always check
references/api_references.md
for the exact tool + parameter names before calling.
When unsure, run
python3 $DIDI list
— it returns the authoritative input schema for every tool straight from DiDi. Do not guess parameter names (common mistakes:
keyword
keywords
,
region
city
, four coord fields → six
from_name/from_lat/from_lng/to_name/to_lat/to_lng
).
All argument values must be strings (including coordinates and
product_category
), e.g.
{"product_category":"1"}
not
{"product_category":1}
.
该技能附带一个仅依赖标准库的辅助工具,通过MCP Streamable-HTTP协议与DiDi通信。只需指向它一次:
bash
DIDI=$SKILL_DIR/scripts/didi.py
两个命令:
bash
python3 $DIDI list                        # 列出工具及其JSON输入 schema
python3 $DIDI call <tool> '<json-args>'   # 调用任意工具
调用前务必查看
references/api_references.md
获取准确的工具及参数名称。
如有疑问,运行
python3 $DIDI list
——它会直接从DiDi返回每个工具的权威输入schema。请勿猜测参数名称(常见错误:
keyword
keywords
region
city
,四个坐标字段→六个
from_name/from_lat/from_lng/to_name/to_lat/to_lng
)。
所有参数值必须为字符串(包括坐标和
product_category
),例如
{"product_category":"1"}
而非
{"product_category":1}

Write gating (real money / real driver)

写入限制(涉及真实资金/真实司机)

taxi_create_order
and
taxi_cancel_order
are gated: without a trailing
--confirm
the helper only DRY-RUNS and changes nothing. Run once without
--confirm
to preview, then re-run with
--confirm
as the last argument after the user approves:
bash
python3 $DIDI call taxi_create_order '{"estimate_trace_id":"...","product_category":"1"}' --confirm
  • Even when the user says "打车" / "取消订单", confirm the concrete details (起终点、车型 for booking; the order for cancelling) before adding
    --confirm
    .
  • Cancel intent ≠ cancel confirmation — always ask "确认取消吗?" first.
taxi_create_order
taxi_cancel_order
限制:如果没有后缀
--confirm
,辅助工具仅执行DRY-RUN(试运行),不会做出任何更改。先不带
--confirm
运行一次预览,待用户确认后,再添加
--confirm
作为最后一个参数重新运行:
bash
python3 $DIDI call taxi_create_order '{"estimate_trace_id":"...","product_category":"1"}' --confirm
  • 即使用户说“打车”/“取消订单”,在添加
    --confirm
    前也要确认具体细节(打车的起终点、车型;取消的对应订单)。
  • 取消意向≠取消确认——务必先询问“确认取消吗?”。

Booking flow (最小可执行)

打车预约流程(最小可执行版)

  1. Resolve addresses
    maps_textsearch
    (never invent coordinates; don't reuse coordinates from earlier turns — the user may have moved).
    • If the user references an address alias (家 / 公司 / etc.) that you don't have, ask them; this skill has no stored preferences.
  2. Confirm start/end — if
    maps_textsearch
    returns ≥2 candidates, list at least the top 3 and let the user pick; a single exact match needs no confirmation.
  3. Estimate
    taxi_estimate
    ; record the returned
    traceId
    /
    estimate_trace_id
    . It expires (
    -32021
    ) — re-estimate if stale.
  4. Pick car type — user's current message wins ("叫快车"→
    product_category
    1
    , "专车"→
    8
    ); otherwise ask. Only use categories present in the
    taxi_estimate
    response; never silently substitute a different service level (快车
    1
    ≠ 特惠快车
    201
    ).
  5. Create order
    taxi_create_order
    with the latest
    estimate_trace_id
    (dry-run → confirm →
    --confirm
    ).
  6. Report — order id, start/end, car type, estimated fare. Tell the user they can send 「查询订单」 to check status.
  1. 解析地址 — 使用
    maps_textsearch
    (切勿自行编造坐标;不要复用之前对话中的坐标——用户可能已移动位置)。
    • 如果用户提及您不知道的地址别名(家/公司/等),请询问用户;本技能不存储偏好设置。
  2. 确认起终点 — 如果
    maps_textsearch
    返回≥2个候选地址,至少列出前3个让用户选择;如果只有一个精确匹配,则无需确认。
  3. 预估车费 — 调用
    taxi_estimate
    ;记录返回的
    traceId
    /
    estimate_trace_id
    。该ID会过期(错误码
    -32021
    )——如果过期需重新预估。
  4. 选择车型 — 用户当前消息优先(“叫快车”→
    product_category
    1
    ,“专车”→
    8
    );否则询问用户。仅使用
    taxi_estimate
    响应中存在的车型分类;切勿擅自替换不同服务等级(快车
    1
    ≠特惠快车
    201
    )。
  5. 创建订单 — 使用最新的
    estimate_trace_id
    调用
    taxi_create_order
    (试运行→确认→添加
    --confirm
    )。
  6. 反馈结果 — 告知用户订单ID、起终点、车型、预估车费。并提示用户可发送「查询订单」来查看状态。

Query an order

查询订单

Order id comes from (in priority): the user's message → the most recent order created this conversation → else ask.
bash
python3 $DIDI call taxi_query_order '{"order_id":"ORDER_ID"}'
Status codes (
code
):
code含义输出
0匹配中⏳ 正在为您匹配司机
1司机已接单展示司机姓名、车型、车牌、电话、距离与预计到达时间
2司机已到达🔔 司机已到达上车点
4行程进行中🚗 行程已开始
5订单完成✅ 行程结束(展示费用,如有)
6系统取消❌ 订单已被系统取消
7已取消❌ 订单已取消
3 / 8-12其他终态显示对应状态描述
订单ID的获取优先级:用户消息中提供的→本次对话中最近创建的订单→否则询问用户。
bash
python3 $DIDI call taxi_query_order '{"order_id":"ORDER_ID"}'
状态码(
code
):
code含义输出
0匹配中⏳ 正在为您匹配司机
1司机已接单展示司机姓名、车型、车牌、电话、距离与预计到达时间
2司机已到达🔔 司机已到达上车点
4行程进行中🚗 行程已开始
5订单完成✅ 行程结束(展示费用,如有)
6系统取消❌ 订单已被系统取消
7已取消❌ 订单已取消
3 / 8-12其他终态显示对应状态描述

Routes & places (no order needed)

路线与地点查询(无需创建订单)

bash
python3 $DIDI call maps_direction_driving  '{"from_name":"...","from_lat":"...","from_lng":"...","to_name":"...","to_lat":"...","to_lng":"..."}'
python3 $DIDI call maps_direction_transit  '{...}'   # 公交
python3 $DIDI call maps_direction_walking  '{...}'   # 步行
python3 $DIDI call maps_direction_bicycling '{...}'  # 骑行
python3 $DIDI call maps_place_around '{"keywords":"咖啡","lat":"...","lng":"..."}'
python3 $DIDI call maps_regeocode '{"lat":"...","lng":"..."}'
bash
python3 $DIDI call maps_direction_driving  '{"from_name":"...","from_lat":"...","from_lng":"...","to_name":"...","to_lat":"...","to_lng":"..."}'
python3 $DIDI call maps_direction_transit  '{...}'   # 公交
python3 $DIDI call maps_direction_walking  '{...}'   # 步行
python3 $DIDI call maps_direction_bicycling '{...}'  # 骑行
python3 $DIDI call maps_place_around '{"keywords":"咖啡","lat":"...","lng":"..."}'
python3 $DIDI call maps_regeocode '{"lat":"...","lng":"..."}'

Gotchas

注意事项

  • Never print the key or the raw endpoint URL — the helper handles the transport and keeps the key internal.
  • taxi_create_order
    takes only
    estimate_trace_id
    ,
    product_category
    , and optional
    caller_car_phone
    . Don't pass the estimate's coordinate/name fields.
  • No stored preferences: this skill doesn't remember home/work/car type — ask the user, or wire richer memory in a higher layer.
  • Auth failure surfaces as
    -32002
    (or HTTP 401/403): the key is missing/expired → have the user reconnect the connector.
Setup: See authentication. This skill uses the
didi
connector's injected
DIDI_MCP_KEY
, not
ACEDATACLOUD_API_TOKEN
.
  • 切勿打印密钥或原始端点URL——辅助工具会处理传输并确保密钥内部存储。
  • taxi_create_order
    仅接受
    estimate_trace_id
    product_category
    和可选的
    caller_car_phone
    参数。请勿传入预估结果中的坐标/名称字段。
  • 无存储偏好:本技能不会记住家庭/工作地址/车型偏好——请询问用户,或在更高层级中集成更丰富的记忆功能。
  • 认证失败会显示错误码
    -32002
    (或HTTP 401/403):密钥缺失/过期→请用户重新连接连接器。
设置说明: 请查看认证。本技能使用
didi
连接器注入的
DIDI_MCP_KEY
,而非
ACEDATACLOUD_API_TOKEN