Create MCP tools in batches

Batch create tools from detected or saved MCP connections as workspace tools.

HTTP
POST $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/connections/actions/batch-create-mcp-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

Shell
curl -X POST "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/connections/actions/batch-create-mcp-tools" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  -d '{
    "connection_id": "'"$CONNECTION_ID"'",
    "items": [
      {
        "tool_name": "search_docs",
        "name": "搜索文档"
      }
    ]
  }'

Field

Type

Required

Description

connection_id

string

No

Saved MCP connection ID.

name

string

No

The name of the new connection.

endpoint_uri

string

No

The MCP service address of the new connection.

transport

string

No

MCP transmission method.

auth_type

string

No

Authentication type.

api_key_header

string

No

The request header name used by API Key.

credential

object

No

MCP credentials.

visibility

string

No

The visible range of new connections.

items

array of object

Yes

List of MCP tools to create.

items[].tool_name

string

Yes

MCP service discovery tool name.

items[].name

string

No

Local tool name. When omitted, the discovered tool name is used.

items[].description

string

No

Tool description.

items[].input_schema

object

No

Tool input schema.

items[].output_schema

object

No

Tool output Schema.

items[].tags

array of string

No

Tools label.

items[].category

string

No

Tool classification.

Upstream tools are rediscovered before batch creation. The current discovery results overwrite the submitted description, input schema, and output schema. The upstream tool definition is subject to the current discovery results.

Successful response

JSON
{
  "code": 0,
  "data": {
    "connection": {
      "id": "id_example",
      "workspace_id": "workspace_example",
      "name": "",
      "status": "draft",
      "kind": "model_api",
      "endpoint_uri": "",
      "auth_type": "none",
      "visibility": "private",
      "version": 1,
      "created_at": "2026-10-14T00:00:00Z",
      "updated_at": "2026-10-14T00:00:00Z"
    },
    "connection_status": "created",
    "items": []
  }
}

Field

Type

Description

code

integer

0 when the request is processed successfully.

data

object

response data.

data.connection

object

Connection information.

data.connection.id

string

Object ID.

data.connection.workspace_id

string

The workspace ID to which it belongs.

data.connection.name

string

Name.

data.connection.description

string

Description. Can be omitted if not set.

data.connection.status

string

Current status. Values: draft, active, disabled, archived.

data.connection.kind

string

Connection type. Values: model_api, huggingface, mcp_server, http_api, external_drive, object_storage, database, webhook, channel.

data.connection.endpoint_uri

string

Service endpoint address.

data.connection.auth_type

string

Authentication method. Values: none, api_key, bearer_token, oauth2, basic, custom_headers, service_account, client_certificate.

data.connection.credential_ref

string

A reference to a saved credential, not a clear-text key. Can be omitted if not set.

data.connection.capabilities

array of string

List of available capabilities. Can be omitted if not set.

data.connection.owner_user_id

string

The user ID to which it belongs. Can be omitted if not set.

data.connection.visibility

string

Visible range. Value: private, workspace.

data.connection.config

object

Non-sensitive configuration, fields vary with connection or channel type. Can be omitted if not set.

data.connection.last_test_status

string

The most recent test status, either succeeded or failed. Can be omitted if not set. Value: succeeded, failed.

data.connection.last_tested_at

string

The most recent test time, in RFC 3339 format. Can be omitted if not set.

data.connection.last_test_error

string

Error description for recent tests. Can be omitted if not set.

data.connection.version

integer

Current version number.

data.connection.labels

object

Tag key-value pairs. Can be omitted if not set.

data.connection.annotations

object

Extended annotations. Can be omitted if not set.

data.connection.metadata

object

Extended metadata. Can be omitted if not set.

data.connection.created_by

string

Creator ID. Can be omitted if not set.

data.connection.updated_by

string

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

data.connection.created_at

string

Creation time, in RFC 3339 format.

data.connection.updated_at

string

Last updated in RFC 3339 format.

data.connection_status

object

Connection status. Values: created, existing, failed.

data.items

array of object

Create results in batches.

data.items[].tool_name

string

Tool name.

data.items[].status

object

Current status. Values: created, existing, failed.

data.items[].tool

object

Tools to create or reuse. Can be omitted if not set.

data.items[].tool.id

string

Object ID.

data.items[].tool.workspace_id

string

The workspace ID to which it belongs.

data.items[].tool.name

string

Name.

data.items[].tool.description

string

Description. Can be omitted if not set.

data.items[].tool.display_name

string

Display name.

data.items[].tool.display_description

string

Show instructions. Can be omitted if not set.

data.items[].tool.status

string

Current status. Values: draft, active, disabled, archived.

data.items[].tool.kind

string

Connection type. Values: system, mcp, http_api, operator, market, code.

data.items[].tool.category

string

Resource classification. Can be omitted if not set.

data.items[].tool.icon_ref

string

Icon reference. Can be omitted if not set.

data.items[].tool.tags

array of string

tag list. Can be omitted if not set.

data.items[].tool.phase

string

processing stage. Can be omitted if not set.

data.items[].tool.market_metadata

object

Market display metadata. Can be omitted if not set.

data.items[].tool.source_ref

object

Source cited.

data.items[].tool.source_ref.type

string

Operation type. Can be omitted if not set.

data.items[].tool.source_ref.id

string

Object ID. Can be omitted if not set.

data.items[].tool.source_ref.uri

string

Resource address. Can be omitted if not set.

data.items[].tool.source_ref.version

string

Current version number. Can be omitted if not set.

data.items[].tool.source_ref.config

object

Non-sensitive configuration, fields vary with connection or channel type. Can be omitted if not set.

data.items[].tool.input_schema

object

JSON Schema of the input parameters. Can be omitted if not set.

data.items[].tool.output_schema

object

JSON Schema of the output result. Can be omitted if not set.

data.items[].tool.side_effect_class

string

Classification of side effects. Values: read, write, external_effect.

data.items[].tool.credential_ref

string

A reference to a saved credential, not a clear-text key. Can be omitted if not set.

data.items[].tool.approval_policy_ref

string

Approval policy reference. Can be omitted if not set.

data.items[].tool.redaction_policy_ref

string

Desensitization strategies cited. Can be omitted if not set.

data.items[].tool.sync

object

Sync results.

data.items[].tool.sync.status

string

Current status. Can be omitted if not set.

data.items[].tool.sync.last_sync_at

string

Last sync time. Can be omitted if not set.

data.items[].tool.sync.last_sync_error

string

Error description for recent sync. Can be omitted if not set.

data.items[].tool.version

integer

Current version number.

data.items[].tool.labels

object

Tag key-value pairs. Can be omitted if not set.

data.items[].tool.annotations

object

Extended annotations. Can be omitted if not set.

data.items[].tool.metadata

object

Extended metadata. Can be omitted if not set.

data.items[].tool.bindable

boolean

Whether it can be bound.

data.items[].tool.bindability_reason

string

The reason why it can be bound. Can be omitted if not set.

data.items[].tool.supported_runtimes

array of string

Supported operating modes. Can be omitted if not set.

data.items[].tool.created_by

string

Creator ID. Can be omitted if not set.

data.items[].tool.updated_by

string

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

data.items[].tool.created_at

string

Creation time, in RFC 3339 format.

data.items[].tool.updated_at

string

Last updated in RFC 3339 format.

data.items[].error

object

Error details. Can be omitted if not set.

data.items[].error.code

string

error code.

data.items[].error.message

string

Operating Instructions.

Error response

JSON
{
  "code": 2,
  "message": "invalid request"
}

Field

Type

Description

code

integer

error code.

message

string

Error message for the caller.

Last updated on