> ## Documentation Index
> Fetch the complete documentation index at: https://developers.clay.com/llms.txt
> Use this file to discover all available pages before exploring further.

# routines update

> Update a routine — name, description, entity type, or integrations.

Update an existing routine. At least one update flag is required. Returns the updated routine in the same shape as [`clay routines get`](/cli/reference/routines-get).

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
clay routines update <routineId> [flags]
```

## Arguments

| Argument    | Description                                     |
| ----------- | ----------------------------------------------- |
| `routineId` | Routine id, e.g. `function:t_abc123`. Required. |

## Flags

| Flag                          | Description                                                                                                                                                       |
| ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--name <name>`               | Set the routine name (max 100 characters).                                                                                                                        |
| `--description <description>` | Set the description. Pass an empty string to clear it.                                                                                                            |
| `--entity-type <type>`        | Set the MCP entity type. One of `contact` or `company`.                                                                                                           |
| `--integrations <csv>`        | Replace the full integration set. Comma-separated list of `api`, `mcp`, `claygent`, or the literal `none` to clear all integrations. An empty string is rejected. |

## Output

Same shape as [`clay routines get`](/cli/reference/routines-get) — the updated routine, including `access.integrations`.

## Errors

| Code               | Exit | Notes                                                                    |
| ------------------ | ---- | ------------------------------------------------------------------------ |
| `validation_error` | 2    | Missing update flags, invalid entity type, or invalid integration value. |
| `not_found`        | 6    | No routine with that id in this workspace.                               |
| `auth_forbidden`   | 3    | The API key lacks the `cli:all` scope (or `all`).                        |

## Examples

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
clay routines update function:t_abc123 --name "Renamed routine"
clay routines update function:t_abc123 --description "" --entity-type company
clay routines update function:t_abc123 --integrations api,mcp
clay routines update function:t_abc123 --integrations none
```
