GetAgent
Queries agents visible to the current identity by name.
Operation description
You can retrieve agents created by yourself, agents visible within the current tenant, and official agents provided by the platform.
Try it now
Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ada:GetAgent |
get |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Name |
string |
Yes |
The name of the agent. |
code-review-agent |
Request example
{
"Name": "code-review-agent"
}
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response result. |
||
| AgentId |
string |
The agent ID. |
agent_00000000000000000000000000000001 |
| Name |
string |
The name of the agent. |
code-review-agent |
| DisplayName |
string |
The display name of the agent. This field may not be returned if it is not configured. |
CR code review agent |
| Description |
string |
The description of the agent. This field may not be returned if it is not configured. |
Analyzes code changes and generates CR review comments |
| Model |
any |
The saved model configuration. This information is returned only for official agents. Object arrays are supported, and historical single objects and strings are compatible. An empty array returns [ ]. Object arrays retain the original order, duplicate names, and object fields. |
[{"name":"base","default":true},{"name":"base"},{"name":"base","settings":{"thinking":false,"topK":5}}] |
| SystemPrompt |
string |
The system prompt. This field may not be returned if it is not configured. |
Please check the correctness, security, and maintainability of the code changes in the CR, and provide review comments based on severity |
| Tools |
any |
The list of MCP server and connector name references. For element fields, see the following sections. |
[{"mcpServerName":"code-repository-mcp"},{"connectorName":"code-review-data"}] |
| Skills |
any |
The list of skill references. For specific fields, see the supplementary description of response parameters. |
[{"name":"code-review"}] |
| KnowledgeBases |
any |
The list of knowledge base references. The list contains at most one element. |
[{"name":"code-review-guidelines"}] |
| Metadata |
any |
The display metadata of the agent. For specific fields, see the supplementary description of response parameters. |
{"iconUrl":"https://example.com/icons/code-review-agent.png"} |
| Visibility |
string |
The visibility scope of the agent. Valid values: Valid values:
|
user |
| Status |
string |
The status of the agent. The default status of a newly created agent is |
draft |
| AgentVersion |
integer |
The current configuration revision number. |
2 |
| CreatedAt |
integer |
The creation time. The value is a UNIX timestamp in milliseconds. |
1788332400000 |
| UpdatedAt |
integer |
The last update time. The value is a UNIX timestamp in milliseconds. |
1788332700000 |
| CanModify |
boolean |
Specifies whether the current identity can modify the agent. |
true |
| CanDelete |
boolean |
Specifies whether the current identity can delete the agent. |
true |
| Official |
boolean |
Specifies whether the agent is an official agent provided by the platform. |
false |
| RequestId |
string |
The request ID. It is used for Tracing Analysis and troubleshooting. |
0A1B2C3D-4E5F-6789-ABCD-EF0123456789 |
Model
| Name | Type | Description | Example |
name | string | The model name in the configuration. The original value is returned. | base |
default | boolean | The default model flag. In the same model array, only one element can have default set to true. | true |
settings | object | The model configuration parameters. The original values are returned. | {"thinking":false,"topK":5} |
Tools (MCP server and connector)
MCP server
| Name | Type | Description | Example |
mcpServerName | string | The name of the MCP server. When a name reference omits items, all public tools are used. Historical explicit kind/items whitelists retain their original values. | code-repository-mcp |
Connector
| Name | Type | Description | Example |
connectorName | string | The name of the connector. | code-review-data |
Skills
| Name | Type | Description | Example |
name | string | The name of the skill. | code-review |
KnowledgeBases
| Name | Type | Description | Example |
name | string | The name of the knowledge base. | code-review-guidelines |
Metadata
| Name | Type | Description | Example |
iconUrl | string | The HTTP or HTTPS URL of the agent icon. | https://example.com/icons/code-review-agent.png |
Sample success response
{
"AgentId": "agent_00000000000000000000000000000001",
"Name": "code-review-agent",
"DisplayName": "CR code review agent",
"Description": "Analyzes code changes and generates CR review comments",
"Model": [
{
"name": "base",
"default": true
},
{
"name": "base"
},
{
"name": "base",
"settings": {
"thinking": false,
"topK": 5
}
}
],
"SystemPrompt": "Please check the correctness, security, and maintainability of the code changes in the CR, and provide review comments based on severity.",
"Tools": [
{
"mcpServerName": "code-repository-mcp"
},
{
"connectorName": "code-review-data"
}
],
"Skills": [
{
"name": "code-review"
}
],
"KnowledgeBases": [
{
"name": "code-review-guidelines"
}
],
"Metadata": {
"iconUrl": "https://example.com/icons/code-review-agent.png"
},
"Visibility": "user",
"Status": "draft",
"AgentVersion": 2,
"CreatedAt": 1788332400000,
"UpdatedAt": 1788332700000,
"CanModify": true,
"CanDelete": true,
"Official": false,
"RequestId": "0A1B2C3D-4E5F-6789-ABCD-EF0123456789"
}
Examples
Success response
JSON format
{
"AgentId": "agent_00000000000000000000000000000001",
"Name": "code-review-agent",
"DisplayName": "Code review agent",
"Description": "Analyze code changes and generate code review comments",
"Model": "[{\"name\":\"base\",\"default\":true},{\"name\":\"base\"},{\"name\":\"base\",\"settings\":{\"thinking\":false,\"topK\":5}}]",
"SystemPrompt": "Check the correctness, security, and maintainability of code changes in the code review, and provide review comments based on severity",
"Tools": "[{\"mcpServerName\":\"code-repository-mcp\"},{\"connectorName\":\"code-review-data\"}]",
"Skills": "[{\"name\":\"code-review\"}]",
"KnowledgeBases": "[{\"name\":\"code-review-guidelines\"}]",
"Metadata": "{\"iconUrl\":\"https://example.com/icons/code-review-agent.png\"}",
"Visibility": "user",
"Status": "draft",
"AgentVersion": 2,
"CreatedAt": 1788332400000,
"UpdatedAt": 1788332700000,
"CanModify": true,
"CanDelete": true,
"Official": false,
"RequestId": "0A1B2C3D-4E5F-6789-ABCD-EF0123456789"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParameter | The specified parameter is invalid. | |
| 401 | Unauthenticated | Authentication required. | |
| 500 | InternalError | Internal server error. | |
| 404 | Agent.NotFound | The specified Agent does not exist. | |
| 404 | Agent.VersionNotFound | The specified Agent version does not exist. | |
| 503 | ServiceUnavailable | The service is not ready or temporarily unavailable. | |
| 504 | ServiceTimeout | A required service timed out. |
See Error CodesError Codes for a complete list.
Release notes
See Release NotesRelease Notes for a complete list.