Create MCP tools in batches¶
Batch create tools from probed or saved MCP connections as workspace tools.
POST https://moi.matrixorigin.cn/newmoi/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://moi.matrixorigin.cn/newmoi/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 |
|---|---|---|---|
|
string |
No |
The saved MCP connection ID. |
|
string |
No |
The name of the new connection. |
|
string |
No |
The MCP service address of the new connection. |
|
string |
No |
MCP transmission method. |
|
string |
No |
Authentication type. |
|
string |
No |
The request header name used by API Key. |
|
object |
No |
MCP credentials. |
|
string |
No |
The visible range of the new connection. |
|
object[] |
Yes |
MCP tools to create. |
|
string |
Yes |
The tool name for MCP service discovery. |
|
string |
Yes |
The name of the tool after creation. |
|
string |
No |
Tool description. |
|
object |
No |
Tool input Schema. |
|
object |
No |
Tool output Schema. |
|
string[] |
No |
Tool label. |
|
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 |
|---|---|---|
|
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"}