Update tool¶
Partially update a platform tool in the current workspace. This action does not create a tool when the target tool does not exist.
PATCH https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/tools/{tool_id}
Before you call¶
First Query tool details confirm the tool to be updated. Prepare the personal access token, target workspace ID, and tool ID that have access to the target workspace.
The example below uses:
$AI_STUDIO_API_KEY: The actual personal access token, passed through theX-API-KeyHeader.$WORKSPACE_ID: Target workspace ID, passed throughX-Workspace-IDHeader.$TOOL_ID: ID of the tool to update.
Request example¶
curl -X PATCH "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/tools/$TOOL_ID" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"description": "更新后的说明",
"status": "active"
}'
Path parameters¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
Yes |
The current workspace ID. |
|
string |
Yes |
The tool ID to update. |
Query parameters¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
No |
The workspace the tool belongs to; can only be the current workspace or |
Request body¶
The fields in the request body are optional; fields not provided retain their original values.
Field |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
No |
Tool name, description, status, category and display information. The status can be |
|
string |
No |
Tool name, description, status, category and display information. The status can be |
|
string |
No |
Tool name, description, status, category and display information. The status can be |
|
string |
No |
Tool name, description, status, category and display information. The status can be |
|
string |
No |
Tool name, description, status, category and display information. The status can be |
|
string |
No |
Tool name, description, status, category and display information. The status can be |
|
string |
No |
Tool name, description, status, category and display information. The status can be |
|
string[] |
No |
Tool label; providing this field will replace the original label. Only updating |
|
object |
No |
Source; can contain |
|
object |
No |
Input and output JSON Schema. |
|
object |
No |
Input and output JSON Schema. |
|
string |
No |
Side effect classification: |
|
string |
No |
Credentials, approvals, and masking policy references. |
|
string |
No |
Credentials, approvals, and masking policy references. |
|
string |
No |
Credentials, approvals, and masking policy references. |
|
object |
No |
Synchronization status, can include |
|
object |
No |
Market metadata, tags, annotations, and extended metadata. |
|
object |
No |
Market metadata, tags, annotations, and extended metadata. |
|
object |
No |
Market metadata, tags, annotations, and extended metadata. |
|
object |
No |
Market metadata, tags, annotations, and extended metadata. |
[] after a type denotes an array. [] in a field path denotes each item in an array.
MCP tools cannot modify kind, source_ref, or credential_ref through this interface; nor can ordinary tools be updated to MCP tools.
Successful response¶
Returns 200 and the updated tool on success. In addition to updating only tags, the resource version is incremented.
{
"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"
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
string |
Tool ID and workspace. |
|
string |
Tool ID and workspace. |
|
string |
Updated basic definition. |
|
string |
Updated basic definition. |
|
string |
Updated basic definition. |
|
string |
Updated basic definition. |
|
string |
Side effect classification and current resource version. |
|
integer |
Side effect classification and current resource version. |
|
boolean |
Current binding capabilities, reasons for unbinding, and supported operating environments. |
|
string |
Current binding capabilities, reasons for unbinding, and supported operating environments. |
|
string[] |
Current binding capabilities, reasons for unbinding, and supported operating environments. |
|
string |
Last updated time, using RFC 3339 format. |
[] after a type denotes an array. [] in a field path denotes each item in an array.
Error response¶
{
"code": 2,
"message": "<错误信息>"
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
Invalid path, request field, or MCP tool update scope. |
Check tool IDs, field values, and tool category restrictions. |
|
|
Lack of valid identity credentials. |
Check API Key. |
|
|
The current identity does not have permission to update the tool. |
Check workspace authorization. |
|
|
The specified system tool is read-only. |
Do not modify system tools; create or update your own tools in the current workspace. |
|
|
The tool does not exist in the specified workspace. |
Check tool ID and |
|
|
Tool resource services or authorization dependencies are temporarily unavailable. |
Try again later. |
Follow-up operations¶
Use the same resource identifier Query tool details to confirm the update result.