rocket_launch ASAPilot
开始使用

MCP 工具参考

这是 ASAPilot MCP server 当前提供的 5 个工具的完整参考,用于 Apple Search Ads 管理。

面向开发者

如果你只使用 dashboard,其实不用关心这些工具。它们主要服务于 AI coding tools 和支持 MCP 的 agent 运行环境。

ASAPilot 通过 MCP server 暴露 5 个工具。你可以用它们读取广告数据、触发自动化,并把自然语言工作流接进自己的 client。

Chat 工具

chat.send

向 ASAPilot 发送消息,并继续一个已有的外部会话。

参数

名称 类型 是否必填 说明
message string 必填 要发送给 ASAPilot 的用户消息。
thread_id string 可选 稳定的外部会话 ID。多轮追问时复用它。
mode string 可选 可选的 ASAPilot 模式覆盖,例如 free_talk 或 account_health。
connection_id string 可选 可选的已连接 ASA 账号 ID。
time_range string 可选 可选的报表时间范围。

示例

{
  "name": "chat.send",
  "arguments": {
    "message": "Show me campaigns with CPI above $5",
    "thread_id": "analysis-session-1",
    "mode": "account_health",
    "time_range": "last_7_days"
  }
}

账户工具

accounts.list

列出当前 ASAPilot workspace 下可访问的已连接 Apple Search Ads 账号。

示例

{
  "name": "accounts.list",
  "arguments": {}
}

自动化工具

automations.list

列出当前 workspace 中已经配置好的自动化。

示例

{
  "name": "automations.list",
  "arguments": {}
}

自动化工具

automations.create

创建一条新的 ASAPilot 自动化。

参数

名称 类型 是否必填 说明
name string 必填 自动化名称。
type string 必填 自动化类型,例如 daily_account_health 或 daily_budget_guard。
connectionId string 必填 已连接 ASA 账号的 ID。
agentName string 可选 可选的 agent 名称覆盖。
configJson string 可选 可选的 JSON 配置字符串。
scheduleType string 可选 调度类型:hourly、daily 或 weekly。
cronExpr string 可选 调度值,例如 daily 用 09:00,hourly 用 6h,weekly 用 MON@09:00。
timezone string 可选 IANA 时区,例如 UTC 或 America/Los_Angeles。

示例

{
  "name": "automations.create",
  "arguments": {
    "name": "Daily Budget Alert",
    "type": "daily_budget_guard",
    "connectionId": "conn_abc123",
    "scheduleType": "daily",
    "cronExpr": "09:00",
    "timezone": "America/Los_Angeles"
  }
}

自动化工具

automations.run

立即排队执行一条自动化。

参数

名称 类型 是否必填 说明
automationId string 必填 要执行的自动化 ID。

示例

{
  "name": "automations.run",
  "arguments": {
    "automationId": "auto_xyz789"
  }
}

协议细节

鉴权

所有请求都需要 API key。你可以在 Authorization: Bearer YOUR_API_KEY 或 X-API-Key 里传递。

Session 管理

初始化后,server 会返回 Mcp-Session-Id header。后续请求带上它,可以保持 session continuity。

线程连续性

对 chat.send 来说,多次调用时复用同一个 thread_id,就能保留外部线程与 ASAPilot 内部会话的映射关系。

常见问题

ASAPilot 当前暴露了几个 MCP 工具?

当前 MCP 服务器一共暴露五个工具,覆盖 chat、accounts 和 automations。

怎么保持 MCP 会话连续性?

后续请求里持续复用返回的 Mcp-Session-Id 头。

怎么让外部对话持续映射到同一条 ASAPilot 线程?

在 chat.send 里持续复用同一个 thread_id。