Update tool

Partially update the platform tools in the current workspace. Tools will not create new tools if the current workspace does not exist.

HTTP
PATCH $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/tools/{tool_id}

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. First Query tool details confirm the tool to be updated. Prepare the personal access token, target workspace ID, and tool ID that can access the target workspace.

Request body

Shell
curl -X PATCH "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/tools/$TOOL_ID" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  -d '{
    "description": "更新后的说明",
    "status": "active"
  }'

Parameter

Type

Required

Description

workspace_id

string

Yes

Current workspace ID.

tool_id

string

Yes

Tool ID to update.

tool_workspace_id

string

No

The workspace the tool belongs to. It can only be the current workspace or system. System tools are read-only when system is specified, and updates will be rejected.

name

string

No

Tool name, description, status, category and display information. The status can be draft, active, disabled or archived.

description

string

No

Tool name, description, status, category and display information. The status can be draft, active, disabled or archived.

status

string

No

Tool name, description, status, category and display information. The status can be draft, active, disabled or archived.

kind

string

No

Tool name, description, status, category and display information. The status can be draft, active, disabled or archived.

category

string

No

Tool name, description, status, category and display information. The status can be draft, active, disabled or archived.

icon_ref

string

No

Tool name, description, status, category and display information. The status can be draft, active, disabled or archived.

phase

string

No

Tool name, description, status, category and display information. The status can be draft, active, disabled or archived.

tags

array of string

No

Tools label. Providing this field replaces the original label. The resource version will not be incremented when updating only tags.

source_ref

object

No

Source. Can include type, id, uri, version and config.

input_schema

object

No

Input and output JSON Schema.

output_schema

object

No

Input and output JSON Schema.

side_effect_class

string

No

Side effect classification: read, write or external_effect.

credential_ref

string

No

Credentials, approvals, and desensitization policy references.

approval_policy_ref

string

No

Credentials, approvals, and desensitization policy references.

redaction_policy_ref

string

No

Credentials, approvals, and desensitization policy references.

sync

object

No

Synchronization status, which can include status, last_sync_at and last_sync_error.

market_metadata

object

No

Market metadata, tags, annotations and extended metadata.

labels

object

No

Market metadata, tags, annotations and extended metadata.

annotations

object

No

Market metadata, tags, annotations and extended metadata.

metadata

object

No

Market metadata, tags, annotations and extended metadata.

labels and annotations require a JSON object whose value can only be a string or null. When updating, omit or the entire value is null to retain the original value, and the empty object {} clears the original object.

The fields in the request body are optional. Fields not provided retain their original values.

MCP tools cannot modify kind, source_ref or credential_ref through this interface. Nor can you update a normal tool to an MCP tool.

Successful response

JSON
{
  "code": 0,
  "data": {
    "id": "tool_01",
    "workspace_id": "ws_01",
    "name": "查询工具",
    "description": "更新后的说明",
    "status": "active",
    "kind": "http_api",
    "side_effect_class": "read",
    "version": 2,
    "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

code

integer

0 on success.

data

object

The result of this request.

data.id

string

Tool ID.

data.workspace_id

string

The identity of the workspace to which it belongs.

data.name

string

Name.

data.description

string

Description. Can be omitted if empty or not set.

data.display_name

string

Display name.

data.display_description

string

Show instructions. Can be omitted if empty or not set.

data.status

string

status. Preferable draft, active, disabled, archived

data.kind

string

Tool type. Preferable system, mcp, http_api, operator, market, code

data.category

string

classification. Can be omitted if empty or not set.

data.icon_ref

string

Icon reference. Can be omitted if empty or not set.

data.tags

array

label. Can be omitted if empty or not set.

data.phase

string

use stage. Can be omitted if empty or not set.

data.market_metadata

object

Market metadata. Can be omitted if empty or not set.

data.source_ref

object

An empty object is returned when the source information has no subfields.

data.source_ref.type

string

Source type. Can be omitted if empty or not set.

data.source_ref.id

string

Source object ID, the specific type is specified by source_ref.type. Can be omitted if empty or not set.

data.source_ref.uri

string

Source address. Can be omitted if empty or not set.

data.source_ref.version

string

Version number. Can be omitted if empty or not set.

data.source_ref.config

object

Resource allocation. Can be omitted if empty or not set.

data.input_schema

object

Tool input JSON Schema. Can be omitted if empty or not set.

data.output_schema

object

The tool outputs JSON Schema. Can be omitted if empty or not set.

data.side_effect_class

string

Classification of side effects. Preferable read, write, external_effect

data.credential_ref

string

Credentials reference. Can be omitted if empty or not set.

data.approval_policy_ref

string

Approval policy reference. Can be omitted if empty or not set.

data.redaction_policy_ref

string

Desensitization strategies cited. Can be omitted if empty or not set.

data.sync

object

An empty object is returned when the synchronization information has no subfields.

data.sync.status

string

status. Can be omitted if empty or not set.

data.sync.last_sync_at

string or null

Last sync time. Can be omitted if empty or not set.

data.sync.last_sync_error

string

Recent sync errors. Can be omitted if empty or not set.

data.version

integer

Version number.

data.labels

object

Extension tag. Can be omitted if empty or not set.

data.annotations

object

Extended comments. Can be omitted if empty or not set.

data.metadata

object

Extended metadata. Can be omitted if empty or not set.

data.bindable

boolean

Whether it can be bound.

data.bindability_reason

string

Description of binding capabilities. Can be omitted if empty or not set.

data.supported_runtimes

array

Supported runtimes. Can be omitted if empty or not set.

data.created_by

string

Creator ID. Can be omitted if empty or not set.

data.updated_by

string

Last updated by identifier. Can be omitted if empty or not set.

data.created_at

string

Creation time. Use RFC 3339 format.

data.updated_at

string

Last updated time. Use RFC 3339 format.

Error response

JSON
{
  "code": 2,
  "message": "<错误信息>"
}

Common HTTP errors

HTTP status code

error code

Description

400

2(INVALID_ARGUMENT)

Common Cause: The path, request field, or MCP tool update scope is invalid. Recommended Action: Check the tool ID, field values, and tool category limits.

401

6(UNAUTHENTICATED)

Common Cause: Valid identity credentials are missing. Recommended Action: Check the API Key.

403

5(PERMISSION_DENIED)

Common reasons: The current identity does not have permission to update the tool. Recommended Action: Check the workspace authorization.

403

7(FORBIDDEN)

Common Cause: The specified system tool is read-only. Recommended Action: Do not modify system tools. Create or update your own tools in the current workspace.

404

3(NOT_FOUND)

Common reasons: The tool does not exist in the specified workspace. Recommended Action: Check the tool ID and tool_workspace_id.

503

15(UNAVAILABLE)

Common reasons: Tool resource services or authorization dependencies are temporarily unavailable. Recommended Action: Try again later.

Last updated on