百宝箱开放平台 ✖️ 查询插件列表

16 阅读8分钟

通过调用本接口,开发者可以查询百宝箱支持在外部调用的插件列表,包括插件以及插件内部工具的详细数据。获取到相关数据后,开发者可以通过调用插件工具接口,使用目标插件。

请求地址

GET``https://api.tbox.cn/api/plugin/officialPlugins

请求头

参数名必填类型说明示例
AuthorizationString用于验证客户端身份的访问令牌,你可以在百宝箱中获取,获取方式可参见:授权管理pat_2j4e******THUIVRH1

请求参数

参数名必填类型说明示例
pluginTypeEnum插件类别,不传查询全部插件,枚举值包括:- 实用工具:UTILITY_TOOL 生活服务: LIFE_SERVICE 内容搜索:CONTENT_SEARCH MCP工具:MCP_TOOLUTILITY_TOOL
pageNumInteger分页页码,默认为1,从第一页数据开始返回1
pageSizeInteger分页大小,默认为 20,最大为 2020

请求示例

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 ''

返回参数

参数名类型说明示例
errorCodeString错误码,为 0 表示成功。0
errorMsgString错误信息。success
dataQueryPluginResult插件查询结果对象。-
traceIdString本次请求的唯一标识,通常用于发生错误时的排查定位。0b****4d9

data 定义

参数名类型说明
pluginsList插件详情
currentPageInterger当前页码
pageSizeInterger分页大小
totalInterger总数据量

plugins 定义

参数名类型说明
pluginIdString插件 ID
nameString插件名称
descriptionString插件描述
pluginTypeEnum官方插件类别,枚举值包含:- 实用工具:UTILITY_TOOL 生活服务:LIFE_SERVICE 内容搜索:CONTENT_SEARCH MCP工具:MCP_TOOL
toolTypeEnum插件内工具所属类别,枚举值包含:- 基于已有服务创建的插件:OPENAPI 基于百宝箱 IDE 创建的插件:CLOUD_FUNCTION MCP 服务:MCP
avgExecTimeDouble平均执行时间,单位:毫秒
citationCountInteger当前插件被智能体引用次数
successRateDouble智能体调用成功率
toolCountInteger插件内部包含的工具数
toolsList工具详情

tools 定义

参数名类型说明
pluginToolIdString工具 ID
nameString工具名称
descriptionString工具描述
streamBoolean是否支持流式返回
avgExecTimeDouble平均执行时间,单位:毫秒
citationCountInteger当前工具被智能体引用次数
successRateDouble智能体调用成功率
inputParamsList当前工具的入参定义
outputParamsList当前工具的出参定义

paramsSchema 定义

参数名类型说明
nameString参数名
descriptionString参数描述
requiredBoolean是否必传
inEnum参数位置,仅 OPENAPI 插件有。枚举值包含:- body:请求体参数path:路径参数 query:查询参数 header:请求头参数
schemaSchema参数结构

schema 定义

参数名类型说明
typeString参数类型,包括:- string:字符串 integer:整数 number:浮点数 boolean:布尔 object:对象 array:数组
enumList枚举值,约束参数在一定范围内取值
defaultObject默认值
propertiesMap<String, Properties>- key:参数名value:Properties仅 object 类型有,用来表示对象中每一个属性的结构。
requiredList仅 object 类型有,参数名集合,表示必传的参数
itemsItems仅 array 类型有,用来定义数组中元素的约束。

properties 定义

说明: 当前内容仅针对 Object 类型的参数,用来表示 Object 对象中每一个属性的结构。

参数名类型说明
typeString参数类型,包括:- string:字符串 integer:整数 number:浮点数 boolean:布尔值 object:对象 array:数组
enumList枚举值,约束参数在一定范围内取值
defaultObject默认值
propertiesMap<String, Properties>- key:参数名 value:Properties仅 object 类型有,用来表示对象中每一个属性的结构。
requiredList仅 object 类型有,参数名集合,表示必传的参数
itemsItems仅 array 类型有,用来定义数组中元素的约束。

items 定义

参数名类型说明
typeString参数类型,包括:- string:字符串 integer:整数 number:浮点数 boolean:布尔值 object:对象 array:数组
propertiesMap<String, Properties>- key:参数名 value:Properties仅 object 类型有,用来表示对象中每一个属性的结构。
requiredList仅 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是否有效"
}

错误码

公共错误码

errorCodeerrorMsg说明
S40000系统异常- 原因:系统出现错误。 解决方案:请稍后重试,若持续报错,请点击此处与我们取得联系,并将错误码与 traceId 一同反馈,帮助我们快速定位问题。
P_1_10_183授权令牌无效- 原因:token 不正确。 解决方案:请校验是否输入了有效令牌或配置新令牌。
P_1_10_184授权令牌已失效- 原因:当前 token 已过期。 解决方案:请前往百宝箱开放平台申请新令牌并更新到调用配置中。
P_1_10_185未检测到授权令牌- 原因:未填写 token 信息。 解决方案:请参考授权管理完成授权令牌的申请和配置。
P_1_13_682非法访问,请联系平台- 原因:系统检测到异常活动。 解决方案:请稍后重试,若持续报错,请点击此处与我们取得联系,并将错误码与 traceId 一同反馈,帮助我们快速定位问题。

参数校验与业务错误码

errorCodeerrorMsg说明
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参数值超出枚举范围- 原因:工具参数值超出枚举范围 解决方案:确认参数值在枚举值范围内