Create MCP tools in batches

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

POST https://api.moi.matrixorigin.cn/v5/workspaces/{workspace_id}/connections/actions/batch-create-mcp-tools

Before you call

The examples below use $AI_STUDIO_API_KEY, $WORKSPACE_ID, and $CONNECTION_ID.

Request example

curl -X POST "https://api.moi.matrixorigin.cn/v5/workspaces/$WORKSPACE_ID/connections/actions/batch-create-mcp-tools" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  -d '{
    "connection_id": "'"$CONNECTION_ID"'",
    "items": [
      {
        "tool_name": "search_docs",
        "name": "搜索文档"
      }
    ]
  }'

Request body

Parameters

Type

Is it required

Description

connection_id

string

No

The 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 the new connection.

items

array of object

Yes

MCP tools to create.

items[].tool_name

string

Yes

The tool name for MCP service discovery.

items[].name

string

Yes

The name of the tool after creation.

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

Tool label.

items[].category

string

No

Tool classification.

[] after a type denotes an array. [] in a field path denotes each item in an array.

Successful response

Returns 200 and the creation result on success.

{"code":0,"data":{"items":[]}}

The response fields are as follows.

Field

Type

Description

data.items

array

Batch creation results.

[] after a type denotes an array. [] in a field path denotes each item in an array.

Error response

{"code":2,"message":"invalid request"}
Last updated on