Delete a tool¶
Delete workspace tool metadata. Check references before deleting; unbinding and disabling are separate operations.
DELETE https://api.moi.matrixorigin.cn/v5/workspaces/{workspace_id}/tools/{tool_id}
Before you call this API¶
Obtain a personal access token and workspace ID for the current environment as described in AI Studio. The current effective role must permit the action. Get the exact ID from the current workspace resource list and first check agents referencing it.
Request parameters¶
curl -X DELETE "https://api.moi.matrixorigin.cn/v5/workspaces/$WORKSPACE_ID/tools/$TOOL_ID" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Target workspace ID in the current environment, matching the header. |
|
string |
Yes |
Workspace ID in the current environment. |
|
string |
Yes |
Personal access token in the current environment. |
|
string |
Yes |
Tool ID in the current workspace to delete. |
|
string |
No |
Query parameter, defaulting to the current workspace. system sources are read-only; this cannot delete another workspace’s objects. |
This action accepts no expected-version or force-cascade fields. If referenced, inspect the relevant resource reference list and unbind according to the intended change; do not automatically unbind other agents. When localization succeeds, 422 includes details.reason=TOOL_IN_USE and domain. See shared error information.
Successful response¶
{
"code": 0,
"data": {
"deleted": true
}
}
Field |
Type |
Description |
|---|---|---|
|
integer |
0 on success. |
|
boolean |
true on successful deletion. |
Error responses¶
HTTP / code |
Conditions and handling |
|---|---|
400 / 2 |
Invalid object or workspace identifier. |
403 / 5 |
System source target or current authorization denied. |
404 / 3 |
Target not found; repeated deletion does not guarantee success again. |
422 / 2 |
Active binding references remain in agent definitions or workspace overrides. Resolve references first. |
503 / 15 |
Resource or authorization dependencies unavailable. |
500 / 1 |
Localization failed while references prevented deletion. |
The authentication stage may also return string code/msg. See errors and environments.