Skip to main content

工具管理

工具管理接口用于创建和管理外脑工具。所有接口都需要开发者权限。

获取工具列表

/dev/tool/list
获取工具列表。

请求参数

参数名类型必选说明
pageinteger页码,默认1
sizeinteger每页数量
GET /dev/tool/list?page=1&size=10
Content-Type: application/json
Authorization: Bearer YOUR_TOKEN

获取工具详情

/dev/tool/:id
获取指定工具的详细信息。

请求参数

参数名类型必选说明
idstring工具ID
GET /dev/tool/tool_123
Content-Type: application/json
Authorization: Bearer YOUR_TOKEN

创建工具

/dev/tool
创建新的工具。

请求参数

参数名类型必选说明
namestring工具名称
descriptionstring工具描述
configobject工具配置
POST /dev/tool
Content-Type: application/json
Authorization: Bearer YOUR_TOKEN

{
  "name": "新工具",
  "description": "这是一个新工具",
  "config": {
    "type": "text",
    "api_version": "v1"
  }
}

更新工具

/dev/tool/:id
更新指定工具的信息。

请求参数

参数名类型必选说明
idstring工具ID
namestring工具名称
descriptionstring工具描述
configobject工具配置
PUT /dev/tool/tool_124
Content-Type: application/json
Authorization: Bearer YOUR_TOKEN

{
  "name": "更新后的工具",
  "description": "这是更新后的工具描述"
}

删除工具

/dev/tool/:id
删除指定的工具。

请求参数

参数名类型必选说明
idstring工具ID
DELETE /dev/tool/tool_124
Content-Type: application/json
Authorization: Bearer YOUR_TOKEN

错误码说明

错误码说明

错误码说明
400请求参数错误
401未授权或令牌无效
403权限不足(需要开发者权限)
404工具不存在
422请求参数验证失败
500服务器错误