Query agent details¶
Read an agent’s complete metadata, run targets, model configuration, resource bindings and policy references. Optionally specify the workspace to which the agent belongs; this value can only be the current workspace or the system workspace.
GET https://api.moi.matrixorigin.cn/v5/workspaces/{workspace_id}/agents/{agent_id}
Preparation before calling¶
First query the agent list to obtain the agent ID. Prepare the personal access token, target workspace ID, and agent 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 through theX-Workspace-IDHeader and asworkspace_idin the path.$AGENT_ID: The agent ID to query, asagent_idin the path.
Request example¶
curl --get "https://api.moi.matrixorigin.cn/v5/workspaces/$WORKSPACE_ID/agents/$AGENT_ID" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
--data-urlencode "agent_workspace_id=$AGENT_WORKSPACE_ID"
Path parameters¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
Yes |
Current workspace ID, must be consistent with |
|
string |
Yes |
The agent ID to be queried. |
Query parameters¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
No |
ID of the workspace to which the agent belongs. If not provided, the current workspace is used; only the current workspace or the system workspace can be specified. |
Successful response¶
Returns 200 on success. data is the complete metadata of the agent.
{
"code": 0,
"data": {
"id": "agent_01",
"workspace_id": "ws_01",
"schema_version": 1,
"name": "销售助手",
"description": "销售数据分析",
"instruction": {
"system_prompt": "分析销售数据",
"behavior_rules": []
},
"runtime": {
"provider": "matrixone",
"profile": "default"
},
"model": {
"model_config_ref": "mc_01"
},
"binding": {
"tool_refs": [],
"skill_refs": [],
"knowledge_base_refs": [],
"channel_bindings": []
},
"policy_refs": {},
"workflow_refs": {},
"status": "active",
"version": 1,
"source_type": "custom",
"created_at": "2026-01-15T10:00:00Z",
"updated_at": "2026-01-15T10:00:00Z"
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
string |
Agent ID and workspace ID. |
|
string |
Workspace where the agent definition belongs. |
|
integer |
Agent metadata structure version. |
|
string |
Agent name and description; will not be returned if no description is set. |
|
string |
Agent name and description; will not be returned if no description is set. |
|
string |
Display metadata; does not return if not set. |
|
string |
Display metadata; does not return if not set. |
|
array of string |
Display tags; does not return if not set. |
|
string |
Classification and display sorting value; not returned if not set. |
|
integer |
Classification and display sorting value; not returned if not set. |
|
object |
Command configuration, which can include |
|
object |
Run target containing |
|
object |
Model configuration, can contain |
|
object |
Resource binding, which can include tools, skills, knowledge base references and channel bindings; does not return if not set. |
|
object |
Policy and workflow reference; not returned if not set. |
|
object |
Policy and workflow reference; not returned if not set. |
|
object |
Life cycle information, which can include |
|
string |
Agent status. |
|
integer |
Current resource version of the agent definition. |
|
string |
Source type and source reference; not returned when source reference is not set. |
|
string |
Source type and source reference; not returned when source reference is not set. |
|
object |
Extended tags, comments, and metadata; not returned if not set. |
|
object |
Extended tags, comments, and metadata; not returned if not set. |
|
object |
Extended tags, comments, and metadata; not returned if not set. |
|
string |
Creator and last updater ID; not returned if not set. |
|
string |
Creator and last updater ID; not returned if not set. |
|
string |
Creation and last update times, in RFC 3339 format. |
|
string |
Creation and last update times, in RFC 3339 format. |
[] after a type denotes an array. [] in a field path denotes each item in an array.
Error response¶
{
"code": "ErrNotFound",
"msg": null,
"data": null
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
The path parameter or |
Check path and query parameters. |
|
|
Lack of valid identity credentials. |
Check API Key. |
|
|
The current identity does not have permission to read the agent. |
Use an authorized identity, or contact the administrator for authorization. |
|
|
The agent does not exist within the specified workspace. |
Check the agent ID and the workspace it belongs to. |
|
|
The agent resource service or its authorized dependencies are temporarily unavailable. |
Try again later. |
Follow-up operations¶
Use data.id to call Query the agent version, Query resource binding or Query execution strategy.