Create Tool
Create Tool
Supports creating a Tool under a specified organization and automatically generating actions from an OpenAPI Schema.
You can use this endpoint to create a Tool under a specified organization. When api_schema is provided, actions are generated at the same time; when it is not provided, only a Tool shell is created.
Request Method
POST
Request URL
https://api.${endpoint}/v1/org/tool/create
Request Authentication
Uses account-level DevKey / DevSecret Basic authentication, and requires the calling account to have organization Tool creation permission.
Request
Request Example
curl -X POST 'https://api.${endpoint}/v1/org/tool/create' \
-H 'Authorization: Basic ${BASIC_TOKEN}' \
-H 'Content-Type: application/json' \
-d '{
"org_id": "p-xxxx",
"name": "weather",
"display_name": "Weather Lookup",
"description": "Query current weather by city name",
"logo": "https://cdn.example.com/weather.png",
"url": "https://api.example.com",
"show_request": true,
"api_schema": "{\"openapi\":\"3.0.0\",\"paths\":{}}"
}'
curl -X POST 'https://api.${endpoint}/v1/org/tool/create' \
-H 'Authorization: Basic ${BASIC_TOKEN}' \
-H 'Content-Type: application/json' \
-d '{
"org_id": "p-xxxx",
"name": "weather",
"display_name": "Weather Lookup",
"description": "Query current weather by city name",
"logo": "https://cdn.example.com/weather.png",
"url": "https://api.example.com",
"show_request": true,
"api_schema": "{\"openapi\":\"3.0.0\",\"paths\":{}}"
}'
This code block in the floating window
Request Headers
| Field | Type | Description |
|---|---|---|
| Authorization | Basic ${BASIC_TOKEN} | The Basic Token obtained by Base64-encoding DevKey:DevSecret. |
| Content-Type | application/json | Request body format. |
Request Parameters (Body Parameters)
| Parameter | Type | Description | required |
|---|---|---|---|
| org_id | String | Organization ID. | true |
| name | String | Tool name, up to 20 characters. | true |
| display_name | String | Tool display name, up to 50 characters. | false |
| description | String | Tool description, up to 100 characters. | true |
| logo | String | Tool icon URL. | true |
| url | String | Tool base URL, must be a public http/https address. |
true |
| show_request | Boolean | Whether to display the request content during the call. | true |
| api_schema | String | OpenAPI JSON Schema. When provided, actions are generated and available=true on success; when not provided, available=false. |
false |
Response
Response Example
{
"code": 0,
"message": "OK",
"data": {
"tool_id": "tool-xxxx",
"name": "weather",
"available": true
}
}
{
"code": 0,
"message": "OK",
"data": {
"tool_id": "tool-xxxx",
"name": "weather",
"available": true
}
}
This code block in the floating window
Success Response
| Field | Type | Description |
|---|---|---|
| tool_id | String | The newly created Tool ID. |
| name | String | Tool name. |
| available | Boolean | Whether the Tool is available. |
Failure Response
| Field | Type | Description |
|---|---|---|
| code | Integer | Error code. |
| message | String | Error details. |
Status Codes
| Status Code | Description |
|---|---|
| 200 | Success |
| 400 | Parameter error |
| 401 | Unauthorized |
| 403 | Insufficient permissions |
| 429 | Too many requests |
| 500 | Server error |
