# updateAgent

```graphql
mutation UpdateAgent($input: UpdateProjectAgentInput!) {
  updateAgent(input: $input) {
    id
    name
    description
    model
    systemPrompt
    thinking
    temperature
    maxSteps
    allowedModels
    skillIds
    skillSelection {
      kind
      skillIds
    }
    skillResolution {
      policy
      skillIds
      sourcePaths
      unresolvedEntryIndexes
      catalogStatus
      evidenceScope
    }
    skills
    allToolsEnabled
    toolIds
    tools
    toolLoading
    toolResultContext
    knowledge
    providerToolIds
    suggestions
    avatar
    avatarUrl
    securityEnabled
    sourcePath
    source
    editMode
    sourceOnlyReasons
  }
}
```

Update agent. Requires project.agents.write.

## Arguments

| Name                            | Type                            | Required | Description                                                                                                                                       |
| ------------------------------- | ------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| `input`                         | UpdateProjectAgentInput!        | Yes      |                                                                                                                                                   |
| `input.projectReference`        | String                          |          |                                                                                                                                                   |
| `input.agentId`                 | String!                         | Yes      |                                                                                                                                                   |
| `input.sourceTargetKind`        | String                          |          |                                                                                                                                                   |
| `input.targetBranchId`          | ID                              |          |                                                                                                                                                   |
| `input.id`                      | String                          |          |                                                                                                                                                   |
| `input.name`                    | String                          |          |                                                                                                                                                   |
| `input.description`             | String                          |          |                                                                                                                                                   |
| `input.model`                   | String                          |          |                                                                                                                                                   |
| `input.systemPrompt`            | String                          |          |                                                                                                                                                   |
| `input.thinking`                | JSON                            |          |                                                                                                                                                   |
| `input.temperature`             | Float                           |          |                                                                                                                                                   |
| `input.maxSteps`                | Int                             |          |                                                                                                                                                   |
| `input.allowedModels`           | \[String!]                      |          |                                                                                                                                                   |
| `input.skillIds`                | \[String!]                      |          |                                                                                                                                                   |
| `input.skillSelection`          | ProjectAgentSkillSelectionInput |          |                                                                                                                                                   |
| `input.skills`                  | JSON                            |          |                                                                                                                                                   |
| `input.allToolsEnabled`         | Boolean                         |          |                                                                                                                                                   |
| `input.toolIds`                 | \[String!]                      |          | Project tools, platform tools, and integration catalog tools returned by get\_integration. Use exact names from the agent tool references search. |
| `input.tools`                   | JSON                            |          |                                                                                                                                                   |
| `input.toolLoading`             | String                          |          |                                                                                                                                                   |
| `input.toolResultContext`       | JSON                            |          |                                                                                                                                                   |
| `input.knowledge`               | JSON                            |          |                                                                                                                                                   |
| `input.providerToolIds`         | \[String!]                      |          | Provider-native model tools only. Never put tool references from tool\_ids here.                                                                  |
| `input.suggestions`             | JSON                            |          |                                                                                                                                                   |
| `input.avatar`                  | JSON                            |          |                                                                                                                                                   |
| `input.avatarUrl`               | String                          |          |                                                                                                                                                   |
| `input.validateGeneratedAvatar` | Boolean                         |          |                                                                                                                                                   |
| `input.securityEnabled`         | Boolean                         |          |                                                                                                                                                   |

## Variables

```json
{
  "input": {
    "agentId": "string"
  }
}
```

## Responses

| Status | Description                                    |
| ------ | ---------------------------------------------- |
| 200    | The ProjectAgentDocument! in data.updateAgent. |

## Call it

```bash
curl -X POST "https://api.veryfront.com/graphql" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "mutation UpdateAgent($input: UpdateProjectAgentInput!) {\n  updateAgent(input: $input) {\n    id\n    name\n    description\n    model\n    systemPrompt\n    thinking\n    temperature\n    maxSteps\n    allowedModels\n    skillIds\n    skillSelection {\n      kind\n      skillIds\n    }\n    skillResolution {\n      policy\n      skillIds\n      sourcePaths\n      unresolvedEntryIndexes\n      catalogStatus\n      evidenceScope\n    }\n    skills\n    allToolsEnabled\n    toolIds\n    tools\n    toolLoading\n    toolResultContext\n    knowledge\n    providerToolIds\n    suggestions\n    avatar\n    avatarUrl\n    securityEnabled\n    sourcePath\n    source\n    editMode\n    sourceOnlyReasons\n  }\n}",
  "variables": {
    "input": {
      "agentId": "string"
    }
  }
}'
```

## Example response

```json
{
  "data": {
    "updateAgent": {
      "id": "string",
      "name": "string",
      "description": "string",
      "model": "string",
      "systemPrompt": "string",
      "thinking": {},
      "temperature": 0,
      "maxSteps": 0,
      "allowedModels": [
        "string"
      ],
      "skillIds": [
        "string"
      ],
      "skillSelection": {
        "kind": "string",
        "skillIds": [
          "string"
        ]
      },
      "skillResolution": {
        "policy": {},
        "skillIds": [
          "string"
        ],
        "sourcePaths": {},
        "unresolvedEntryIndexes": [0],
        "catalogStatus": "string",
        "evidenceScope": "string"
      },
      "skills": {},
      "allToolsEnabled": false,
      "toolIds": [
        "string"
      ],
      "tools": {},
      "toolLoading": "string",
      "toolResultContext": {},
      "knowledge": {},
      "providerToolIds": [
        "string"
      ],
      "suggestions": {},
      "avatar": {},
      "avatarUrl": "https://example.com",
      "securityEnabled": false,
      "sourcePath": "string",
      "source": "string",
      "editMode": "string",
      "sourceOnlyReasons": [
        "string"
      ]
    }
  }
}
```
