Create tool¶
Create a platform tool in the current workspace. After successful creation, the tool definition and its current bindable status are returned.
POST $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/tools
Before you call¶
Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. Prepare a personal access token and target workspace ID that can access the target workspace.
Request body¶
curl -X POST "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/tools" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"name": "查询工具",
"kind": "http_api",
"side_effect_class": "read"
}'
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Current workspace ID. |
|
string |
No |
Custom tool identifier. Generated by the server when omitted or empty string. |
|
string |
Yes |
Tool name. |
|
string |
No |
Tool description and display classification. |
|
string |
No |
Tool description and display classification. |
|
string |
Yes |
Tool type: |
|
string |
No |
Tool description and display classification. |
|
string |
No |
Tool description and display classification. |
|
array of string |
No |
Tool description and display classification. |
|
string |
No |
Tool description and display classification. |
|
object |
No |
A marketplace of tools to display and distribute metadata. |
|
object |
No |
Tool source. Can include |
|
object |
No |
Input and output JSON Schema. |
|
object |
No |
Input and output JSON Schema. |
|
string |
Yes |
Side effect classification: |
|
string |
No |
Credentials, approvals, and desensitization policy references. |
|
string |
No |
Credentials, approvals, and desensitization policy references. |
|
string |
No |
Credentials, approvals, and desensitization policy references. |
|
object |
No |
Synchronization status, which can include |
|
object |
No |
Extended tags, annotations and metadata. |
|
object |
No |
Extended tags, annotations and metadata. |
|
object |
No |
Extended tags, annotations and metadata. |
labels and annotations require a JSON object whose value can only be a string or null.
Successful response¶
{
"code": 0,
"data": {
"id": "tool_01",
"workspace_id": "ws_01",
"name": "查询工具",
"status": "draft",
"kind": "http_api",
"side_effect_class": "read",
"version": 1,
"bindable": true,
"supported_runtimes": [],
"created_at": "2026-01-02T15:04:05Z",
"updated_at": "2026-01-02T15:04:05Z",
"display_name": "示例工具",
"source_ref": {},
"sync": {}
}
}
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
object |
The result of this request. |
|
string |
Tool ID. |
|
string |
The identity of the workspace to which it belongs. |
|
string |
Name. |
|
string |
Description. Can be omitted if empty or not set. |
|
string |
Display name. |
|
string |
Show instructions. Can be omitted if empty or not set. |
|
string |
status. Preferable |
|
string |
Tool type. Preferable |
|
string |
classification. Can be omitted if empty or not set. |
|
string |
Icon reference. Can be omitted if empty or not set. |
|
array |
label. Can be omitted if empty or not set. |
|
string |
use stage. Can be omitted if empty or not set. |
|
object |
Market metadata. Can be omitted if empty or not set. |
|
object |
An empty object is returned when the source information has no subfields. |
|
string |
Source type. Can be omitted if empty or not set. |
|
string |
Source object ID, the specific type is specified by |
|
string |
Source address. Can be omitted if empty or not set. |
|
string |
Version number. Can be omitted if empty or not set. |
|
object |
Resource allocation. Can be omitted if empty or not set. |
|
object |
Tool input JSON Schema. Can be omitted if empty or not set. |
|
object |
The tool outputs JSON Schema. Can be omitted if empty or not set. |
|
string |
Classification of side effects. Preferable |
|
string |
Credentials reference. Can be omitted if empty or not set. |
|
string |
Approval policy reference. Can be omitted if empty or not set. |
|
string |
Desensitization strategies cited. Can be omitted if empty or not set. |
|
object |
An empty object is returned when the synchronization information has no subfields. |
|
string |
status. Can be omitted if empty or not set. |
|
string or null |
Last sync time. Can be omitted if empty or not set. |
|
string |
Recent sync errors. Can be omitted if empty or not set. |
|
integer |
Version number. |
|
object |
Extension tag. Can be omitted if empty or not set. |
|
object |
Extended comments. Can be omitted if empty or not set. |
|
object |
Extended metadata. Can be omitted if empty or not set. |
|
boolean |
Whether it can be bound. |
|
string |
Description of binding capabilities. Can be omitted if empty or not set. |
|
array |
Supported runtimes. Can be omitted if empty or not set. |
|
string |
Creator ID. Can be omitted if empty or not set. |
|
string |
Last updated by identifier. Can be omitted if empty or not set. |
|
string |
Creation time. Use RFC 3339 format. |
|
string |
Last updated time. Use RFC 3339 format. |
Error response¶
{
"code": 2,
"message": "<错误信息>"
}
Common HTTP errors
HTTP status code |
error code |
Description |
|---|---|---|
|
|
Common causes: The request body, tool definition, or credential reference is invalid. Recommended Action: Check the field value and associated resources. |
|
|
Common Cause: Valid identity credentials are missing. Recommended Action: Check the API Key. |
|
|
Common reasons: The current identity does not have the permission to create tools in the workspace. Recommended Action: Check the workspace authorization. |
|
|
Common Cause: The tool ID or tool definition already exists. Recommended Action: Change the tool ID or check the existing tool. |
|
|
Common reasons: Tool resource services or authorization dependencies are temporarily unavailable. Recommended Action: Try again later. |