# updateTool

```graphql
mutation UpdateTool($projectReference: String!, $id: String!, $input: UpdateToolInput!) {
  updateTool(projectReference: $projectReference, id: $id, input: $input) {
    id
    name
    description
    sourcePath
    source
    editMode
    sourceOnlyReasons
  }
}
```

Replace the description of a structured project tool, where REST and GraphQL clear an omitted description and the MCP tool keeps it; returns the updated tool source document. Requires project.agents.write.

## Arguments

| Name                     | Type             | Required | Description                                                               |
| ------------------------ | ---------------- | -------- | ------------------------------------------------------------------------- |
| `projectReference`       | String!          | Yes      |                                                                           |
| `id`                     | String!          | Yes      | The id of the definition, from its list.                                  |
| `input`                  | UpdateToolInput! | Yes      |                                                                           |
| `input.description`      | String           |          | Replaces the description; omit it or send null to clear it.               |
| `input.sourceTargetKind` | WriteTargetKind  |          | The source to write; default project. One of `project`, `preview_branch`. |
| `input.targetBranchId`   | ID               |          | Required with the kind preview\_branch.                                   |

## Variables

```json
{
  "projectReference": "string",
  "id": "string",
  "input": {}
}
```

## Responses

| Status | Description                         |
| ------ | ----------------------------------- |
| 200    | The ToolSource! in data.updateTool. |

## 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 UpdateTool($projectReference: String!, $id: String!, $input: UpdateToolInput!) {\n  updateTool(projectReference: $projectReference, id: $id, input: $input) {\n    id\n    name\n    description\n    sourcePath\n    source\n    editMode\n    sourceOnlyReasons\n  }\n}",
  "variables": {
    "projectReference": "string",
    "id": "string",
    "input": {}
  }
}'
```

## Example response

```json
{
  "data": {
    "updateTool": {
      "id": "string",
      "name": "string",
      "description": "string",
      "sourcePath": "string",
      "source": "string",
      "editMode": "structured",
      "sourceOnlyReasons": [
        "string"
      ]
    }
  }
}
```
