内容

# WAI - Web Agent Interface
WAI (Web Agent Interface) 是一个标准化的 JSON 架构,旨在公开公司信息,以供各种代理(例如,自动化机器人、数字助手和 AI 代理)使用。WAI 的目的是为代理提供一个一致的、机器可读的接口,以收集有关组织的全面信息。此 JSON 文件必须通过 GET 请求在以下端点公开提供:
- `http://exampledomain.com/wai`
- `https://exampledomain.com/wai`
这些端点确保代理能够轻松发现、检索和使用公司的信息,并通过 MCP (Model Context Protocol) 上下文了解其他功能。
---
## 目录
- [概述](#overview)
- [架构结构](#schema-structure)
- [业务对象](#business-object)
- [基本信息](#basic-information)
- [社交媒体](#social-media)
- [位置](#locations)
- [拥有的企业](#owned-businesses)
- [附加信息](#additional-information)
- [公共 API 端点](#public-api-endpoints)
- [MCP 上下文](#mcp-contexts)
- [示例 JSON](#example-json)
- [发布您的 WAI JSON](#publishing-your-wai-json)
- [使用指南](#usage-guidelines)
- [可扩展性](#extensibility)
---
## 概述
**WAI (Web Agent Interface)** 定义了一种 JSON 结构,以“增强版名片”的格式呈现全面的公司信息。该设计既适合人类阅读,也适合机器读取,使代理能够快速获取有关组织的见解。
对于拥有多个实体位置的公司(例如,像麦当劳这样的全球连锁店),直接在主 JSON 文件中嵌入完整的位置信息可能不切实际。相反,应提供一个指向外部 API 端点的引用(或重定向),该端点提供完整的位置信息列表。这些端点在 **publicAPI** 数组中包含适当的标识符(例如,“Locations”)。
此外,WAI 还充当可用的 MCP (Model Context Protocol) 上下文文件的注册表。这些 MCP JSON 文件提供有关如何执行特定操作(例如,预订会议、处理订单等)的详细说明,使代理能够无缝扩展其功能。
---
## 架构结构
WAI JSON 文档分为三个主要部分:
1. **business**: 包含核心公司详细信息,包括身份、位置(或摘要)和拥有的企业。
2. **publicAPI**: 一个对象数组,定义公共端点。这些端点允许代理检索扩展的业务相关数据(例如,完整的位置信息、产品信息、订阅)。
3. **mcpContexts**: 一个对象数组,列出可用的 MCP (Model Context Protocol) 上下文。每个对象提供一个标识符、描述和一个固定的 URL,以便获取详细的 MCP JSON。
---
## 业务对象
`business` 对象保存公司的主要资料,并组织成几个嵌套部分。
### 基本信息
- **name** (string): 官方公司名称。
- **description** (string): 公司运营的简要概述。
- **tagline** (string): 简洁的口号或使命声明。
- **industry** (string): 公司所处的行业。
- **keywords** (array of strings): 用于对业务进行分类的标签。
- **legalName** (string): 注册的法律名称(如果不同)。
- **founded** (string): 成立日期(最好采用 ISO 格式)。
- **website** (string): 主要网站 URL。
- **logo** (string): 公司 logo 图像的 URL。
### 社交媒体
- **social** (object): 包含公司社交资料的 URL。推荐的键包括:
- **facebook**
- **twitter**
- **linkedin**
- *可以根据需要添加其他平台。*
### 位置
公司可能在多个实体位置运营。在主 JSON 文件中,`locations` 字段可以包含摘要或几个关键位置。对于拥有大量分支的公司,建议提供指向专用 API 端点的引用,以提供完整的详细信息。
每个内联位置对象包含:
- **name** (string): 位置的名称(例如,“主总部”、“市中心分店”)。
- **type** (string): 位置的类别(例如,`Production`、`Office`、`retail`、`head quarter`、`warehouse`、`laboratory`)。
- **address** (object): 包含:
- **street**
- **city**
- **state**
- **postalCode**
- **country**
- **geo** (object):
- **lat** (string or number): 纬度。
- **lon** (string or number): 经度。
- **contact** (object, optional): 位置特定的联系信息:
- **phone** (string)
- **email** (string)
- **hours** (object): 每周每天的营业时间。
*注意:对于拥有多个位置的公司,考虑从主 JSON 中省略详细的位置信息,而是在 **publicAPI** 部分提供一个“Locations” API 端点。*
### 拥有的企业
拥有或控制其他商业实体的公司在 `ownedBusinesses` 数组中列出它们。对于每个子公司:
- **name** (string): 子公司的名称。
- **description** (string): 子公司的简要概述。
- **website** (string): 子公司的网站 URL。
- **logo** (string): 子公司的 logo 图像的 URL。
- **social** (object): 子公司的社交媒体链接。
- **locations** (array, optional): 结构与主 `locations` 数组相同。
- *可以根据需要添加其他字段。*
### 附加信息
- **additional** (object): 用于补充细节:
- **employees** (number): 员工的近似数量。
- **other** (object): 杂项信息(例如,认证、奖项)。
---
## 公共 API 端点
**publicAPI** 字段是一个对象数组,定义用于检索扩展业务相关数据的公共端点。每个对象包括:
- **name** (string, optional): 端点的简短标识符(例如,“Locations”、“Products”、“Subscribe”)。
- **description** (string): 端点目的的简要说明。
- **type** (string): 使用的 HTTP 方法(GET、POST 等)。
- **endpoint** (string): API 端点的 URL。
- **parameters** (array, optional): 可能与此端点一起使用的参数列表(例如,分页参数、过滤器或数据字段)。
例如,当主 JSON 中包含的业务位置过多时,可以提供“Locations”端点以返回完整的业务位置列表。
---
## MCP 上下文
**mcpContexts** 字段是一个数组,列出可用的 MCP (Model Context Protocol) 上下文文件。这些 MCP JSON 文件为代理提供执行特定操作(例如,预订会议或处理订单)的详细说明。
每个 MCP 上下文对象包括:
- **name** (string): MCP 上下文的简短标识符(例如,“Calendar Booking”)。
- **description** (string): 此上下文提供的功能的摘要。
- **mcpUrl** (string): MCP JSON 文件所在的固定 URL(例如,`https://exampledomain.com/mcp/calendar-booking.json`)。
此注册表允许代理快速识别并获取他们需要的上下文,以执行特定操作。
---
## 示例 JSON
以下是一个 WAI 的示例 JSON 文档,整合了所有部分,包括 MCP 上下文:
```json
{
"business": {
"name": "Example Business Inc.",
"description": "A cutting-edge provider of innovative solutions tailored for digital transformation.",
"tagline": "Empowering your digital journey",
"industry": "Technology",
"keywords": ["innovation", "digital", "transformation"],
"legalName": "Example Business Incorporated",
"founded": "2010-05-12",
"website": "https://www.examplebusiness.com",
"logo": "https://www.examplebusiness.com/assets/logo.png",
"social": {
"facebook": "https://facebook.com/examplebusiness",
"twitter": "https://twitter.com/examplebiz",
"linkedin": "https://linkedin.com/company/examplebusiness"
},
"locations": [
{
"name": "Main Headquarters",
"type": "head quarter",
"address": {
"street": "123 Innovation Drive",
"city": "Techville",
"state": "CA",
"postalCode": "90001",
"country": "USA",
"geo": {
"lat": "34.0522",
"lon": "-118.2437"
}
},
"contact": {
"phone": "+1-800-555-1234",
"email": "hq@examplebusiness.com"
},
"hours": {
"monday": "09:00-17:00",
"tuesday": "09:00-17:00",
"wednesday": "09:00-17:00",
"thursday": "09:00-17:00",
"friday": "09:00-17:00",
"saturday": "Closed",
"sunday": "Closed"
}
}
],
"ownedBusinesses": [
{
"name": "Subsidiary One LLC",
"description": "A specialized subsidiary focusing on advanced research and innovative product development.",
"website": "https://subsidiary1.examplebusiness.com",
"logo": "https://subsidiary1.examplebusiness.com/assets/logo.png",
"social": {
"facebook": "https://facebook.com/subsidiary1",
"twitter": "https://twitter.com/subsidiary1"
},
"locations": [
{
"name": "Subsidiary One Office",
"type": "office",
"address": {
"street": "789 Research Ave",
"city": "Innovation City",
"state": "TX",
"postalCode": "75001",
"country": "USA",
"geo": {
"lat": "32.7767",
"lon": "-96.7970"
}
},
"contact": {
"phone": "+1-800-555-6789",
"email": "office@subsidiary1.com"
},
"hours": {
"monday": "08:00-16:00",
"tuesday": "08:00-16:00",
"wednesday": "08:00-16:00",
"thursday": "08:00-16:00",
"friday": "08:00-16:00",
"saturday": "Closed",
"sunday": "Closed"
}
}
]
}
],
"additional": {
"employees": 150,
"other": {
"certifications": ["ISO9001", "Tech Innovator Award 2023"]
}
}
},
"publicAPI": [
{
"name": "Products",
"description": "List of Products",
"type": "GET",
"endpoint": "https://example.com/api/products",
"parameters": ["perPage", "page"]
},
{
"name": "Subscribe",
"description": "Receive email news from our products",
"type": "POST",
"endpoint": "https://example.com/api/subscribeemail",
"parameters": ["email", "phone"]
},
{
"name": "Locations",
"description": "Retrieve full or partial list of all business locations",
"type": "GET",
"endpoint": "https://example.com/api/locations",
"parameters": ["perPage", "page", "latitude", "longitude", "distance"]
}
],
"mcpContexts": [
{
"name": "Calendar Booking",
"description": "Allows agents to check availability and book meetings via our calendar API.",
"mcpUrl": "https://exampledomain.com/mcp/calendar-booking.json"
},
{
"name": "Order Management",
"description": "Enables agents to place and manage orders via our public ordering system.",
"mcpUrl": "https://exampledomain.com/mcp/order-management.json"
}
]
}
```
连接信息
猜你喜欢
暂无推荐服务器