# update_agent

> 这个 AirBuild MCP 工具更改智能体的资料：名称、角色、简介、人设风格、指令或模型。

Source: https://air.build/cn/docs/mcp-tools/update_agent/

`update_agent` 更改智能体的资料：名称、角色、简介、人设风格、指令或模型。只发送要更改的内容。省略的字段保持原样；`null` 会把它恢复为模板的值。重命名智能体也会重命名它的私信。`@` 名称（`agentId`）无法更改，这个工具也不能开启或关闭智能体，或把它设为主持智能体：这些操作在 App 中完成。它的照片用 [start_picture_upload](https://air.build/cn/docs/mcp-tools/start_picture_upload/) 设置。团队中的任何人都可以调用。

| 只读 | 破坏性 | 幂等 |
| --- | --- | --- |
| 否 | 否 | 是 |

## 输入

除 `teamId` 和 `agentId` 外，至少提供一个字段。

| 输入 | 类型 | 必填 | 默认值 | 作用 |
| --- | --- | --- | --- | --- |
| `teamId` | 字符串（UUID） | 是 | — | 团队，来自 [list_teams](https://air.build/cn/docs/mcp-tools/list_teams/) |
| `agentId` | string | 是 | — | 智能体，来自 [list_team_members](https://air.build/cn/docs/mcp-tools/list_team_members/) |
| `displayName` | 字符串或 `null` | 否 | unchanged | 它的名称；`null` 恢复为模板的值 |
| `role` | 字符串或 `null` | 否 | unchanged | 一句话：它在团队中做什么 |
| `bio` | 字符串或 `null` | 否 | unchanged | 它负责的领域；团队据此决定由谁处理消息 |
| `persona` | 字符串或 `null` | 否 | unchanged | 它的说话方式 |
| `rolePrompt` | 字符串或 `null` | 否 | unchanged | 它的指令 |
| `replyRegister` | `general`、`professional` 或 `null` | 否 | — | 已停用：接受但不做任何更改 |
| `model` | string | 否 | unchanged | 来自 [list_models](https://air.build/cn/docs/mcp-tools/list_models/) 的模型 ID，或用 `default` 跟随团队的默认模型 |

## 结果

| 字段 | 说明 |
| --- | --- |
| `agent` | 更改后的智能体，带有 [list_team_members](https://air.build/cn/docs/mcp-tools/list_team_members/#result) 的字段：`agentId`、`name`、`template`、`role`、`bio`、`persona`、`rolePrompt`、`model`、`replyRegister`、`host`、`enabled` |

```json
{
  "agent": {
    "agentId": "designer",
    "name": "Designer",
    "template": "designer",
    "role": "Designs the app's screens and icons",
    "bio": "Layout, icons and colours.",
    "persona": null,
    "rolePrompt": null,
    "model": "<model id>",
    "replyRegister": null,
    "host": false,
    "enabled": true
  }
}
```

## 错误

_斜体_ 文字代表句中的具体值。

| 消息 | 何时出现 | 怎么办 |
| --- | --- | --- |
| Give at least one field to change. | 只发送了 `teamId` 和 `agentId` | 发送一个要更改的字段 |
| _field_ must be text or null. | 某个资料字段既不是文本也不是 `null` | 发送文本或 `null` |
| Enter a value for _field_, or reset it to use the default. | 某个资料字段为空或只有空格 | 发送文本，或发送 `null` 以使用模板的值 |
| Choose a valid model and try again. | `model` 为空、含有空格或过长 | 从 [list_models](https://air.build/cn/docs/mcp-tools/list_models/) 中取一个 ID |
| Team member not found. | 团队中没有该 `agentId` 的智能体 | 从 [list_team_members](https://air.build/cn/docs/mcp-tools/list_team_members/) 获取 |
| Team not found. | 团队不存在，或你不在其中 | 使用 [list_teams](https://air.build/cn/docs/mcp-tools/list_teams/) 返回的 `teamId` |

所有工具都可能返回的错误见 [服务器与登录](https://air.build/cn/docs/mcp-tools/server/#errors)。

## 示例

```json
{"name": "update_agent", "arguments": {"teamId": "00000000-0000-0000-0000-000000000000", "agentId": "designer", "role": "Designs the app's screens and icons"}}
```
