一、统一调用协议
所有工具走标准 MCP JSON-RPC 风格(轻量化实现),无会话、无握手。
1.1 健康检查
GET http://47.253.159.62:5002/api/v2/mcp/pdooh/health
→ {"service":"pDOOH A2A MCP Server","status":"ok","tools_count":19,
"mcp_endpoint":"/api/v2/mcp/pdooh/tools/call"}
1.2 工具发现
GET /api/v2/mcp/pdooh/tools/list
→ { "tools": [ {name, description, inputSchema}, ... ] } // 19 项
1.3 工具调用
POST /api/v2/mcp/pdooh/tools/call
Headers: X-API-Key: pdooh-agent-key-2026
Content-Type: application/json
Body:
{
"name": "pdooh_query_screens",
"arguments": { "city": "广州", "min_house_price": 8, "limit": 10 }
}
Response (MCP content[] 包装):
{
"content": [
{ "type": "text",
"text": "[{\"id\":1,\"name\":\"天河城社区门禁屏\",...}]" }
]
}
⚠️
content[0].text 永远是字符串化的 JSON,调用方需要 JSON.parse(text) 才能取数据。1.4 错误码(实测)
| 场景 | HTTP | 触发 | 现象 |
|---|---|---|---|
| 工具名拼错 | 400 | name 错误 | tool_not_found |
| 必填参数缺失 | 422 | required 未传 | Pydantic ValidationError |
| 数据表未迁移 | 500 | 空参查询某些表 | Internal Server Error(pdooh_query_elevator_frames / pdooh_get_screen_audience) |
| 服务未启动 | — | 5002 端口 down | connection refused |
二、19 工具速查
| # | 工具名 | 分类 | 一句话功能 | 必填参 |
|---|---|---|---|---|
| 1 | pdooh_query_screens | 媒体 | 智能屏查询(地理/标签/房价) | — |
| 2 | pdooh_get_screen_audience | 媒体 | 单屏人群画像 | screen_id |
| 3 | pdooh_create_campaign | 投放 | 创建投放计划 | name,screen_ids,start_date,end_date,budget |
| 4 | pdooh_query_campaigns | 投放 | 计划列表(按状态) | — |
| 5 | pdooh_submit_creative | 投放 | 提交创意 | campaign_id,creative_type |
| 6 | pdooh_query_report | 投放 | 效果报告 | — |
| 7 | pdooh_compliance_check | 投放 | 合规预审 | content |
| 8 | pdooh_audience_insight | 投放 | AI 人群洞察 | product_desc |
| 9 | pdooh_query_daocha_points | 媒体 | 广州道闸点位 | — |
| 10 | pdooh_query_smart_frames | 媒体 | 单元门智能框架 | — |
| 11 | pdooh_query_led_points | 媒体 | 商场 LED | — |
| 12 | pdooh_query_elevator_frames | 媒体 | 电梯框架 | — |
| 13 | pdooh_query_shadow_points | 媒体 | 梯影点位 | — |
| 14 | pdooh_query_access_points | 媒体 | 门禁点位 | — |
| 15 | pdooh_query_city_resources | 媒体 | 城市资源索引 | — |
| 16 | pdooh_query_city_summary | 媒体 | 城市资源汇总 | — |
| 17 | pdooh_query_customers | 客户 | 客户通讯录 | — |
| 18 | pdooh_query_l9_screens | 媒体 | 智能屏 L9 | — |
| 19 | pdooh_query_gtmc_media | 媒体 | 广汽丰田媒体库 | — |
三、完整 inputSchema
3.1 智能屏 / 道闸 / 单元门
pdooh_query_screens媒体
查询符合条件的智能屏(地理位置 / 人群标签 / 社区属性)。返回屏ID、地址、经纬度、覆盖人群画像。
| 字段 | 类型 | 说明 |
|---|---|---|
city | string | 城市,如 广州 |
district | string | 区县,如 天河区 |
lat/lng/radius | number | 经纬度 + 米(默认 3000) |
tags | string[] | 人群标签,如 ["高端白酒","母婴"] |
min_house_price | number | 最低房价(万) |
limit | int | 默认 20 |
pdooh_query_daocha_points媒体
查询广州道闸广告点位,支持区域、商圈、车流量筛选。返回点位ID、社区名、地址、日均车流量等。
district | string | 行政区,如 天河区 |
|---|---|---|
business_zone | string | 商圈,如 珠江新城商圈 |
min_car_traffic | int | 最低日均车流量 |
limit | int | 默认 20 |
pdooh_query_smart_frames媒体
查询单元门智能框架点位,支持城市、区域、价格筛选。返回楼盘名、地址、均价、媒体面数。
city | string | 如 广州市、深圳市、成都市 |
|---|---|---|
district | string | 如 天河区 |
min_price | int | 最低楼盘价格(元/㎡) |
limit | int | 默认 20 |
3.2 LED / 电梯 / 梯影 / 门禁
pdooh_query_led_points媒体
查询商场LED点位,支持城市、区域、场景筛选。
city | string | 如 北京、上海 |
|---|---|---|
district | string | 行政区 |
scene | string | 购物中心 / 写字楼 |
limit | int | 默认 20 |
pdooh_query_elevator_frames媒体⚠️ 空参会 500
查询电梯框架点位,支持城市、区域、租价筛选。返回楼宇名、地址、楼层、租价。
city | string | 如 广州市 |
|---|---|---|
district | string | 行政区 |
min_price | number | 最低租价(元/周) |
limit | int | 默认 20 |
⚠️ 实测:空参调用返回 500 Internal Server Error(疑似后端表未迁移),上线前需补
qinlin_elevator_frame 表或修复路由。pdooh_query_shadow_points媒体
查询梯影点位,支持城市、资源类型筛选。
city | string | 如 北京、上海 |
|---|---|---|
resource_type | string | 电梯投影 / 楼宇投影 |
limit | int | 默认 20 |
pdooh_query_access_points媒体
查询门禁点位,支持城市、区域、价格筛选。返回楼盘名、地址、均价。
city | string | 如 广州市 |
|---|---|---|
district | string | 如 天河区 |
min_price | number | 最低楼盘均价(元/㎡) |
limit | int | 默认 20 |
3.3 城市索引 / 汇总 / L9 / 丰田
pdooh_query_city_resources媒体
查询城市资源索引,查看各城市支持的媒体类型。
city | string | 如 广州市 |
|---|---|---|
media_type | string | 道闸 / 门禁 / LED |
limit | int | 默认 50 |
pdooh_query_city_summary媒体
查询城市资源汇总,各城市媒体资源总量统计。返回
{city,total,details:{媒体类型:数量}}。无参。返回样例:
{"city":"广州市","total":2883,"details":{"门禁":2172,"单元门":711}}pdooh_query_l9_screens媒体
智能屏 L9(27 省 / 100+ 城市),支持城市、省份、价格、楼盘名筛选。
city | string | 如 广州市 |
|---|---|---|
province | string | 如 广东省 |
min_price | number | 最低楼盘价格(元/㎡) |
site_name | string | 楼盘名关键词 |
limit | int | 默认 50 |
pdooh_query_gtmc_media媒体
广汽丰田媒体库(专用),支持城市、媒体类型、价格筛选。
city | string | 如 广州 |
|---|---|---|
media_type | string | 电梯海报 / 地铁 / 户外LED / 候车亭 / 高铁 |
min_price | number | 最低净价(元) |
limit | int | 默认 50 |
3.4 客户数据
pdooh_query_customers客户
查询客户通讯录(26,895 条),支持品牌、城市、行业、手机号筛选。
brand | string | 品牌名称关键词 |
|---|---|---|
city | string | 决策城市,如 广州市 |
industry | string | 汽车 / 食品 / 饮料 |
phone | string | 手机号(精确匹配) |
limit | int | 默认 50 |
⚠️ 返回结构中
data 字段是数据库原始行,存在字段语义错位(如"职务"列里实际是手机号),调用方需做清洗。3.5 投放管理(8 工具)
pdooh_get_screen_audience媒体⚠️ 空参会 500
获取指定屏的人群画像(人口属性 / 消费偏好 / 社区属性),用于评估投放匹配度。
screen_id | int | 必填 |
|---|
⚠️ 实测空参 500;调用方必须传
screen_id。pdooh_create_campaign投放
创建 pDOOH 投放计划。AI Agent 可自主调用此工具完成投放下单。
| 字段 | 必填 | 说明 |
|---|---|---|
name | ✅ | 投放计划名称 |
screen_ids | ✅ | int[] 屏 ID 列表 |
start_date / end_date | ✅ | YYYY-MM-DD |
budget | ✅ | 总预算(元) |
creative_text | 广告文案(自动送合规审核) | |
ai_generated | bool,是否 AI 生成创意 |
pdooh_query_campaigns投放
查询投放计划列表,支持按状态筛选。
status | enum | draft / reviewing / approved / running / finished |
|---|---|---|
limit | int | 默认 20 |
pdooh_submit_creative投放
提交广告创意(AIGC 或人工上传),自动触发合规审核。
| 字段 | 必填 | 说明 |
|---|---|---|
campaign_id | ✅ | 投放计划 ID |
creative_type | ✅ | enum: image / video / text / aigc |
creative_url | 素材 URL(非 aigc 时必填) | |
ai_prompt | AIGC 生成提示词(aigc 时必填) |
pdooh_query_report投放
查询投放报告(曝光量 / 开门转化率 / ROI 模拟),支持按屏/按计划维度。
campaign_id | int | 计划 ID |
|---|---|---|
screen_id | int | 单独查询某屏 |
start_date / end_date | string | YYYY-MM-DD |
pdooh_compliance_check投放
广告内容合规预审(AI 自动审核),检查医疗/金融/药品等受限品类。
content | string | ✅ 文案或图片描述 |
|---|---|---|
industry | string | 如 医疗 / 金融 / 白酒 |
pdooh_audience_insight投放
AI 人群洞察:输入产品/品牌描述,自动匹配人群标签和推荐屏列表。
product_desc | string | ✅ 如 高端白酒,目标高净值人群 |
|---|---|---|
target_city | string | 目标城市 |
budget_hint | number | 预算提示(元) |
四、实拉返回样例
4.1 pdooh_query_screens
[
{"id":1,"name":"天河城社区门禁屏","city":"广州","district":"天河区",
"lat":23.1291,"lng":113.3642,"house_price":8,
"tags":["高端白酒","母婴","美妆"],"impressions_per_day":3200}
]
4.2 pdooh_query_customers
[
{"id":7553,"data":{"备注":"","座机":"","手机":"","状态":"公海",
"职务":"13805771602","行业":"家居建材","部门":"","联系人":"营销总监",
"决策城市":"","品牌名称":" ","客户简称":" ","组织机构":""},
"phone":"","brand":"","city":"","industry":"家居建材",
"created_at":"2026-06-07T23:08:17.143160"}
]
4.3 pdooh_compliance_check
{"passed":true,"issues":[],"suggestion":"可以投放","reviewer":"AI-Compliance-v1.0"}
4.4 pdooh_audience_insight
{"product_desc":"","target_city":"广州","matched_tags":[],
"recommended_screens":[{"id":1,"name":"天河城社区门禁屏",...}]}
4.5 pdooh_query_city_summary
[
{"city":"重庆市市辖区","total":3245,"details":{"门禁":2435,"单元门":810}},
{"city":"上海市市辖区","total":3088,"details":{"门禁":2575,"单元门":513}},
{"city":"广州市","total":2883,"details":{"门禁":2172,"单元门":711}}
]
五、典型 Agent 调用链
链 A:高端白酒 → AI 选点 → 建计划
1
人群洞察
→
2
标签/房价筛屏
→
3
合规预审
→
4
建计划
curl -X POST http://47.253.159.62:5002/api/v2/mcp/pdooh/tools/call \
-H "X-API-Key: pdooh-agent-key-2026" -H "Content-Type: application/json" \
-d '{"name":"pdooh_audience_insight","arguments":{
"product_desc":"高端白酒,目标高净值人群",
"target_city":"广州","budget_hint":30000}}'
curl -X POST .../tools/call -d '{"name":"pdooh_query_screens","arguments":{
"city":"广州","tags":["高端白酒"],"min_house_price":8,"limit":10}}'
curl -X POST .../tools/call -d '{"name":"pdooh_compliance_check","arguments":{
"content":"品味传世,高端白酒限时品鉴","industry":"白酒"}}'
curl -X POST .../tools/call -d '{"name":"pdooh_create_campaign","arguments":{
"name":"高端白酒-广州-周投","screen_ids":[1,2],
"start_date":"2026-06-15","end_date":"2026-06-21",
"budget":30000,"creative_text":"品味传世,高端白酒限时品鉴"}}'
链 B:客户筛选 → 商务跟进
curl -X POST .../tools/call -d '{"name":"pdooh_query_customers","arguments":{
"city":"广州市","industry":"汽车","limit":20}}'
链 C:投放后查报告
curl -X POST .../tools/call -d '{"name":"pdooh_query_report","arguments":{
"campaign_id":42,"start_date":"2026-06-01","end_date":"2026-06-30"}}'
六、部署 & 接入
6.1 服务端口
| 端口 | 服务 | 地址 |
|---|---|---|
| 5002 | Backend API(MCP) | http://47.253.159.62:5002 |
| 3000 | Frontend | http://47.253.159.62:3000 |
| 80 | Nginx | http://47.253.159.62 |
6.2 MCP 端点
| 端点 | 方法 | 说明 |
|---|---|---|
/api/v2/mcp/pdooh/health | GET | 健康检查 |
/api/v2/mcp/pdooh/tools/list | GET | 工具列表 + Schema |
/api/v2/mcp/pdooh/tools/call | POST | 工具调用 |
/api/v2/mcp/pdooh/skill.yaml | GET | MCP skill 声明 |
6.3 接入 WorkBuddy / Claude / Cursor
WorkBuddy 通过 WorkBuddy专家-管理员 技能导入 skill.yaml,即可让 5 角色 AI 团(析客/瑞思/数析/竞析/首席)直接调用上述 19 个工具。
✅ 本文档对应
tools.json + skill.yaml + README.md + 本 HTML,全部自包含、零外部依赖。