Query the agent that references this skill¶
Lists the agents in the current workspace that are effectively bound to the specified skill. The response only contains a summary of the agent display and does not return the full definition of the agent.
GET https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/skills/{skill_id}/referencing-agents
Before you call¶
First query the skill list to obtain the skill ID. Prepare the personal access token, target workspace ID, and skill 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: Query the current workspace ID of the reference relationship, passed through theX-Workspace-IDHeader.$SKILL_ID: The referenced skill ID.
Request example¶
curl "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/skills/$SKILL_ID/referencing-agents?limit=20" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Path parameters¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
Yes |
Query the current workspace ID of the reference relationship. |
|
string |
Yes |
The skill ID being referenced. |
Query parameters¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
No |
The workspace to which the skill belongs; can only be the current workspace or |
|
integer |
No |
Quantity per page. Default |
|
string |
No |
|
Successful response¶
Returns 200 on success. If there is still data later, use next_cursor to query the next page.
{
"code": 0,
"data": {
"items": [
{
"id": "agent_01",
"workspace_id": "ws_01",
"name": "数据助手",
"status": "active"
}
],
"limit": 20,
"next_cursor": "cursor_01"
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
array |
A summary of the agent display that references this skill. |
|
string |
Agent ID and workspace. |
|
string |
Agent ID and workspace. |
|
string |
Agent name and status. |
|
string |
Agent name and status. |
|
integer |
The actual page size used by this page. |
|
string |
Next page cursor; does not return when there is no more data. |
[] 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 |
|---|---|---|---|
|
|
The skill ID, |
Use the cursor returned as is, and check the path and query parameters. |
|
|
Lack of valid identity credentials. |
Check API Key. |
|
|
The current identity does not have permission to read skills or candidate agents. |
Check workspace authorization. |
|
|
This skill does not exist in the current or rollback system directories. |
Check skill ID and |
|
|
The skill or agent reference service is temporarily unavailable. |
Try again later. |
Follow-up operations¶
This list is used to evaluate which agents the skill is referenced by. Before adjusting skills, confirm the citation source, and then Query skill details or Update skills.