UpdateAgent
Updates the configuration of an agent.
Operation description
Nameis used only to locate the agent and cannot be modified after creation.Each agent can be bound to only one knowledge base.
Toolsis updated according to the rules below. IfSkillsorKnowledgeBasesis not passed, the original value is retained. If a non-empty array is passed, it replaces the original value entirely. If an empty array is passed, the corresponding binding is removed. Other optional fields retain their original values if not passed.
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:UpdateAgent |
update |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Name |
string |
Yes |
The name of the agent to be updated. |
code-review-agent |
| ExpectedVersion |
integer |
No |
The expected current configuration revision number. This parameter is omitted by default. Pass the |
2 |
| DisplayName |
string |
No |
The new display name. If this parameter is not passed, the original value is retained. |
CR Code and Security Review Agent |
| Description |
string |
No |
The new description. If this parameter is not passed, the original value is retained. |
Analyze CR code changes and check for correctness, security, and maintainability |
| SystemPrompt |
string |
No |
The new system prompt. If this parameter is not passed, the original value is retained. |
Check for code defects, security risks, and compatibility issues in the CR, and provide actionable modification suggestions |
| Tools |
any |
No |
The list of MCP server and connector name references. The same array supports the coexistence of both types of entries. Specify only one type of reference for each entry. For MCP, omitting items indicates all public tools, and historically specified items retain their original values. |
[{"mcpServerName":"code-repository-mcp"},{"connectorName":"code-review-data"}] |
| Skills |
any |
No |
The list of skill references. If this parameter is not passed, the original value is retained. If a non-empty array is passed, it replaces the original value entirely. If |
[{"name":"code-review"}] |
| KnowledgeBases |
any |
No |
The list of knowledge base bindings, which can contain at most one element. If this parameter is not passed, the original value is retained. If a non-empty array is passed, it replaces the original value entirely. If |
[{"name":"code-review-guidelines"}] |
| Visibility |
string |
No |
The new visibility scope. Valid values: Valid values:
|
tenant |
Tools (MCP servers and connectors)
| Name | Type | Description | Example |
mcpServerName | string | The name of the registered MCP server. | code-repository-mcp |
connectorName | string | The name of the connector that is visible, not deleted, and available to the current identity. | code-review-data |
A single Tools array can contain both types of entries at the same time. For a single name entry, specify only one of mcpServerName or connectorName. If the name is empty, does not exist, is invisible, is unavailable, contains unknown fields, or is a duplicate reference, the request fails and partial configurations are not saved.
Skills
| Name | Type | Description | Example |
name | string | The name of the skill. The currently available version is used at runtime. | code-review |
KnowledgeBases
| Name | Type | Description | Example |
name | string | The name of the knowledge base that exists and is accessible to the current identity. | code-review-guidelines |
Update rules for Tools
| Input | MCP reference | Connector reference |
Tools omitted | Retained | Retained |
Tools=[ ] | Cleared | Cleared |
Tools contains only MCP | Replaced with the passed MCP | Cleared |
Tools contains only Connector | Cleared | Replaced with the passed connector |
Tools contains both types | Replaced with the passed MCP | Replaced with the passed connector |
When passing Tools, you should provide all MCP and connector references that you want to retain. Old references that are not included will be removed.
Request example
{
"Name": "code-review-agent",
"DisplayName": "CR Code and Security Review Agent",
"Description": "Analyze CR code changes and check for correctness, security, and maintainability",
"SystemPrompt": "Check for code defects, security risks, and compatibility issues in the CR, and provide actionable modification suggestions.",
"Tools": [
{
"mcpServerName": "code-repository-mcp"
},
{
"connectorName": "code-review-data"
}
],
"Skills": [
{
"name": "code-review"
}
],
"KnowledgeBases": [
{
"name": "code-review-guidelines"
}
],
"Visibility": "tenant"
}
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 |
| UpdatedAt |
integer |
The time of the most recent update. The value is a UNIX timestamp in milliseconds. |
1788332700000 |
| Success |
boolean |
Indicates whether the agent was successfully updated. A success response always returns |
true |
| RequestId |
string |
The request ID, which is used for Tracing Analysis and troubleshooting. |
0A1B2C3D-4E5F-6789-ABCD-EF0123456789 |
Success response example
{
"AgentId": "agent_00000000000000000000000000000001",
"Name": "code-review-agent",
"UpdatedAt": 1788332700000,
"Success": true,
"RequestId": "0A1B2C3D-4E5F-6789-ABCD-EF0123456789"
}
Examples
Success response
JSON format
{
"AgentId": "agent_00000000000000000000000000000001",
"Name": "code-review-agent",
"UpdatedAt": 1788332700000,
"Success": true,
"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. | |
| 403 | Agent.Forbidden | You are not authorized to operate the specified Agent. | |
| 404 | Agent.NotFound | The specified Agent does not exist. | |
| 503 | ServiceUnavailable | The service is not ready or temporarily unavailable. | |
| 504 | ServiceTimeout | A required service timed out. | |
| 504 | Agent.OperationResultUnknown | The Agent operation result is unknown. | |
| 409 | Agent.VersionConflict | The Agent was modified by another request. | |
| 409 | Agent.InvalidState | The Agent is not in a state that permits this operation. |
See Error CodesError Codes for a complete list.
Release notes
See Release NotesRelease Notes for a complete list.