通过调用本接口,开发者可以查询百宝箱支持在外部调用的插件列表,包括插件以及插件内部工具的详细数据。获取到相关数据后,开发者可以通过调用插件工具接口,使用目标插件。
请求地址
GET``https://api.tbox.cn/api/plugin/officialPlugins
请求头
| 参数名 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
| Authorization | 是 | String | 用于验证客户端身份的访问令牌,你可以在百宝箱中获取,获取方式可参见:授权管理。 | pat_2j4e******THUIVRH1 |
请求参数
| 参数名 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
| pluginType | 否 | Enum | 插件类别,不传查询全部插件,枚举值包括:- 实用工具:UTILITY_TOOL 生活服务: LIFE_SERVICE 内容搜索:CONTENT_SEARCH MCP工具:MCP_TOOL | UTILITY_TOOL |
| pageNum | 否 | Integer | 分页页码,默认为1,从第一页数据开始返回 | 1 |
| pageSize | 否 | Integer | 分页大小,默认为 20,最大为 20 | 20 |
请求示例
curl --location 'https://api.tbox.cn/api/plugin/officialPlugins?pageNum=1&pageSize=5' \
--header 'Authorization: {your_token}' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data ''
返回参数
| 参数名 | 类型 | 说明 | 示例 |
|---|---|---|---|
| errorCode | String | 错误码,为 0 表示成功。 | 0 |
| errorMsg | String | 错误信息。 | success |
| data | QueryPluginResult | 插件查询结果对象。 | - |
| traceId | String | 本次请求的唯一标识,通常用于发生错误时的排查定位。 | 0b****4d9 |
data 定义
| 参数名 | 类型 | 说明 |
|---|---|---|
| plugins | List | 插件详情 |
| currentPage | Interger | 当前页码 |
| pageSize | Interger | 分页大小 |
| total | Interger | 总数据量 |
plugins 定义
| 参数名 | 类型 | 说明 |
|---|---|---|
| pluginId | String | 插件 ID |
| name | String | 插件名称 |
| description | String | 插件描述 |
| pluginType | Enum | 官方插件类别,枚举值包含:- 实用工具:UTILITY_TOOL 生活服务:LIFE_SERVICE 内容搜索:CONTENT_SEARCH MCP工具:MCP_TOOL |
| toolType | Enum | 插件内工具所属类别,枚举值包含:- 基于已有服务创建的插件:OPENAPI 基于百宝箱 IDE 创建的插件:CLOUD_FUNCTION MCP 服务:MCP |
| avgExecTime | Double | 平均执行时间,单位:毫秒 |
| citationCount | Integer | 当前插件被智能体引用次数 |
| successRate | Double | 智能体调用成功率 |
| toolCount | Integer | 插件内部包含的工具数 |
| tools | List | 工具详情 |
tools 定义
| 参数名 | 类型 | 说明 |
|---|---|---|
| pluginToolId | String | 工具 ID |
| name | String | 工具名称 |
| description | String | 工具描述 |
| stream | Boolean | 是否支持流式返回 |
| avgExecTime | Double | 平均执行时间,单位:毫秒 |
| citationCount | Integer | 当前工具被智能体引用次数 |
| successRate | Double | 智能体调用成功率 |
| inputParams | List | 当前工具的入参定义 |
| outputParams | List | 当前工具的出参定义 |
paramsSchema 定义
| 参数名 | 类型 | 说明 |
|---|---|---|
| name | String | 参数名 |
| description | String | 参数描述 |
| required | Boolean | 是否必传 |
| in | Enum | 参数位置,仅 OPENAPI 插件有。枚举值包含:- body:请求体参数path:路径参数 query:查询参数 header:请求头参数 |
| schema | Schema | 参数结构 |
schema 定义
| 参数名 | 类型 | 说明 |
|---|---|---|
| type | String | 参数类型,包括:- string:字符串 integer:整数 number:浮点数 boolean:布尔 object:对象 array:数组 |
| enum | List | 枚举值,约束参数在一定范围内取值 |
| default | Object | 默认值 |
| properties | Map<String, Properties>- key:参数名value:Properties | 仅 object 类型有,用来表示对象中每一个属性的结构。 |
| required | List | 仅 object 类型有,参数名集合,表示必传的参数 |
| items | Items | 仅 array 类型有,用来定义数组中元素的约束。 |
properties 定义
说明: 当前内容仅针对 Object 类型的参数,用来表示 Object 对象中每一个属性的结构。
| 参数名 | 类型 | 说明 |
|---|---|---|
| type | String | 参数类型,包括:- string:字符串 integer:整数 number:浮点数 boolean:布尔值 object:对象 array:数组 |
| enum | List | 枚举值,约束参数在一定范围内取值 |
| default | Object | 默认值 |
| properties | Map<String, Properties>- key:参数名 value:Properties | 仅 object 类型有,用来表示对象中每一个属性的结构。 |
| required | List | 仅 object 类型有,参数名集合,表示必传的参数 |
| items | Items | 仅 array 类型有,用来定义数组中元素的约束。 |
items 定义
| 参数名 | 类型 | 说明 |
|---|---|---|
| type | String | 参数类型,包括:- string:字符串 integer:整数 number:浮点数 boolean:布尔值 object:对象 array:数组 |
| properties | Map<String, Properties>- key:参数名 value:Properties | 仅 object 类型有,用来表示对象中每一个属性的结构。 |
| required | List | 仅 object 类型有,参数名集合,表示必传的参数 |
返回示例
成功示例
{
"data": {
"currentPage": 1,
"pageSize": 1,
"plugins": [
{
"avgExecTime": 1609.0,
"citationCount": 13828,
"description": "利用夸克搜索引擎搜索相关内容,可以根据提示词要求来返回链接等信息。如:关于 OpenAI 有什么新闻?",
"name": "夸克搜索",
"pluginId": "20240611204300000001",
"pluginType": "CONTENT_SEARCH",
"successRate": 0.995,
"toolCount": 3,
"toolType": "OPENAPI",
"tools": [
{
"avgExecTime": 1292.0,
"citationCount": 13443,
"description": "利用夸克搜索引擎搜索相关内容,可以根据提示词要求来返回链接等信息。如:关于 OpenAI 有什么新闻?",
"inputParams": [
{
"description": "搜索内容",
"in": "body",
"name": "q",
"required": true,
"schema": {
"type": "string"
}
}
],
"name": "夸克搜索",
"outputParams": [
{
"description": "搜索结果",
"name": "data",
"schema": {
"items": {
"properties": {
"hostName": {
"description": "站点名(可空)",
"type": "string"
},
"publishTime": {
"description": "发布时间",
"type": "string"
},
"extra": {
"description": "其它信息",
"properties": {
"extraUrl": {
"description": "链接",
"type": "string"
},
"domain": {
"description": "来源",
"type": "string"
},
"sort": {
"description": "排序",
"type": "number"
},
"extraTitle": {
"description": "标题",
"type": "string"
}
},
"type": "object"
},
"channel": {
"description": "输出平台",
"type": "string"
},
"articleId": {
"description": "数据ID",
"type": "string"
},
"title": {
"description": "标题",
"type": "string"
},
"url": {
"description": "网页地址",
"type": "string"
},
"desc": {
"description": "描述信息",
"type": "string"
}
},
"type": "object"
},
"type": "array"
}
},
{
"description": "请求结果",
"name": "success",
"schema": {
"type": "boolean"
}
},
{
"description": "响应信息",
"name": "msg",
"schema": {
"type": "string"
}
},
{
"description": "响应状态码",
"name": "code",
"schema": {
"type": "number"
}
}
],
"pluginToolId": "20240611204600000001",
"stream": false,
"successRate": 0.99
},
{
"citationCount": 0,
"description": "利用夸克搜索引擎搜索相关内容,可以根据提示词要求来返回链接等信息。如:关于 OpenAI 有什么新闻?",
"inputParams": [
{
"description": "搜索内容",
"in": "body",
"name": "q",
"required": true,
"schema": {
"type": "string"
}
}
],
"name": "新版夸克搜索",
"outputParams": [
{
"description": "traceId",
"name": "traceId",
"schema": {
"type": "string"
}
},
{
"description": "响应信息",
"name": "msg",
"schema": {
"type": "string"
}
},
{
"description": "响应状态码",
"name": "code",
"schema": {
"type": "number"
}
},
{
"description": "搜索结果",
"name": "data",
"schema": {
"items": {
"properties": {
"hostName": {
"description": "站点名(可空)",
"type": "string"
},
"publishTime": {
"description": "发布时间",
"type": "string"
},
"extra": {
"description": "其它信息",
"properties": {
"extraUrl": {
"description": "链接",
"type": "string"
},
"domain": {
"description": "来源",
"type": "string"
},
"extraTitle": {
"description": "标题",
"type": "string"
},
"sort": {
"description": "排序",
"type": "number"
}
},
"type": "object"
},
"channel": {
"description": "输出平台",
"type": "string"
},
"articleId": {
"description": "数据ID",
"type": "string"
},
"title": {
"description": "标题",
"type": "string"
},
"url": {
"description": "网页地址",
"type": "string"
},
"desc": {
"description": "描述信息",
"type": "string"
}
},
"type": "object"
},
"type": "array"
}
},
{
"description": "请求结果",
"name": "success",
"schema": {
"type": "boolean"
}
}
],
"pluginToolId": "20250526JVW706618482",
"stream": false
},
{
"avgExecTime": 1925.0,
"citationCount": 385,
"description": "利用夸克搜索引擎搜索相关内容,可以根据提示词要求来返回链接等信息,搜索结果中包含文章的正文字段。如:关于 OpenAI 有什么新闻?",
"inputParams": [
{
"description": "搜索内容",
"in": "body",
"name": "q",
"required": true,
"schema": {
"type": "string"
}
}
],
"name": "夸克搜索(含正文)",
"outputParams": [
{
"description": "响应状态码",
"name": "code",
"schema": {
"type": "number"
}
},
{
"description": "搜索结果",
"name": "data",
"schema": {
"items": {
"properties": {
"publishTime": {
"description": "发布时间",
"type": "string"
},
"hostName": {
"description": "站点名(可空)",
"type": "string"
},
"extra": {
"description": "其它信息",
"properties": {
"extraUrl": {
"description": "链接",
"type": "string"
},
"domain": {
"description": "来源",
"type": "string"
},
"extraTitle": {
"description": "标题",
"type": "string"
},
"sort": {
"description": "排序",
"type": "number"
}
},
"type": "object"
},
"channel": {
"description": "输出平台",
"type": "string"
},
"articleId": {
"description": "数据id",
"type": "string"
},
"title": {
"description": "标题",
"type": "string"
},
"url": {
"description": "网页地址",
"type": "string"
},
"content": {
"description": "正文",
"type": "string"
},
"desc": {
"description": "描述信息",
"type": "string"
}
},
"type": "object"
},
"type": "array"
}
},
{
"description": "描述简介",
"name": "success",
"schema": {
"type": "boolean"
}
},
{
"description": "响应信息",
"name": "msg",
"schema": {
"type": "string"
}
}
],
"pluginToolId": "20250528mgnR06685343",
"stream": false,
"successRate": 1.0
}
]
}
],
"total": 17
},
"errorCode": "0",
"errorMsg": "success",
"traceId": "0b44******1814"
}
失败返回
{
"errorCode": "P_1_00_005",
"errorMsg": "不合法的插件类型",
"solution": "请检查入参:pluginType是否有效"
}
错误码
公共错误码
| errorCode | errorMsg | 说明 |
|---|---|---|
| S40000 | 系统异常 | - 原因:系统出现错误。 解决方案:请稍后重试,若持续报错,请点击此处与我们取得联系,并将错误码与 traceId 一同反馈,帮助我们快速定位问题。 |
| P_1_10_183 | 授权令牌无效 | - 原因:token 不正确。 解决方案:请校验是否输入了有效令牌或配置新令牌。 |
| P_1_10_184 | 授权令牌已失效 | - 原因:当前 token 已过期。 解决方案:请前往百宝箱开放平台申请新令牌并更新到调用配置中。 |
| P_1_10_185 | 未检测到授权令牌 | - 原因:未填写 token 信息。 解决方案:请参考授权管理完成授权令牌的申请和配置。 |
| P_1_13_682 | 非法访问,请联系平台 | - 原因:系统检测到异常活动。 解决方案:请稍后重试,若持续报错,请点击此处与我们取得联系,并将错误码与 traceId 一同反馈,帮助我们快速定位问题。 |
参数校验与业务错误码
| errorCode | errorMsg | 说明 |
|---|---|---|
| P_1_00_005 | 不合法的插件类型 | - 原因:查询官方插件列表插件类型参数不合法 解决方案:确认插件类型参数是否在合法枚举值内- - 实用工具:UTILITY_TOOL 生活服务:LIFE_SERVICE 内容搜索:CONTENT_SEARCH MCP工具:MCP_TOOL |
| P_1_02_111 | 工具不存在或已下架 | - 原因:调用的工具不存在或已下架 解决方案:请检查入参 pluginToolId 是否正确 |
| P_1_02_111 | 插件不存在或已下架 | - 原因:调用的工具所属插件不存在或已下架 解决方案:请检查入参 pluginToolId 是否正确 |
| P_1_02_111 | 该工具不支持通过openapi/sdk调用 | - 原因:该工具不支持通过 openapi/sdk 调用 解决方案:请检查入参 pluginToolId 是否正确 |
| P_1_03_200 | 必传参数缺少参数值 | - 原因:工具必传入参未填 解决方案:确认必传参数都已传值 |
| P_1_03_200 | 参数值超出枚举范围 | - 原因:工具参数值超出枚举范围 解决方案:确认参数值在枚举值范围内 |