---
sidebar_position: 12
title: update_dive
description: Update an existing Dive's title, description, or content
feature_stage: preview
---

Update an existing [Dive's](/docs/key-tasks/ai-and-motherduck/dives) title, description, or content. Returns a URL to the Dive in MotherDuck as a link the user can click to view the updated Dive.

## Description

The `update_dive` tool modifies an existing Dive in your MotherDuck workspace. You can update the title, description, content (React component code), or any combination. At least one field must be provided.

When updating content, the tool validates the new code before saving, just like [`save_dive`](../save-dive). It also analyzes which databases the Dive queries and reports any unshared databases.

Use [`list_dives`](../list-dives) to find the Dive ID, and [`read_dive`](../read-dive) to inspect the current code before modifying it.

## Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `id` | string | Yes | The unique identifier (UUID) of the Dive to update |
| `title` | string | No | New title for the Dive |
| `description` | string | No | New description for the Dive |
| `content` | string | No | New JSX/React component code |

At least one of `title`, `description`, or `content` must be provided.

## Output Schema

```json
{
  "success": boolean,
  "dive": {                        // Updated dive info (on success)
    "id": string                   // Dive identifier
  },
  "dive_url": string,              // URL to view the Dive (on success)
  "warnings": string[],            // Validation warnings (if any)
  "database_warnings": string[],   // Warnings from database analysis (if any)
  "unshared_databases": string[],  // Database names not yet shared with the org (if any)
  "next_steps": string[],          // Ordered instructions for the AI to follow after updating
  "error": string,                 // Error message (on failure)
  "validationErrors": [            // Validation errors (on failure)
    {
      "type": string,
      "message": string,
      "details": string
    }
  ]
}
```

## Example Usage

**Update a Dive's content:**

```text
Add a region filter to my revenue trends Dive
```

The AI assistant will call `read_dive` to get the current code, modify it, then call `update_dive`:

```json
{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "content": "import { useSQLQuery } from \"@motherduck/react-sql-query\";\n// ... updated component with region filter\n"
}
```

**Update just the title and description:**

```text
Rename my revenue Dive to "Q1 Revenue Dashboard"
```

```json
{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "title": "Q1 Revenue Dashboard",
  "description": "Revenue trends filtered to Q1 2025"
}
```

## Success Response Example

```json
{
  "success": true,
  "dive": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  },
  "dive_url": "https://app.motherduck.com/dives/a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "next_steps": [
    "Regenerate the dive preview artifact with the updated banner...",
    "Show the dive to the user in chat as a markdown hyperlink using the dive title: [dive title](https://app.motherduck.com/dives/a1b2c3d4-...)"
  ]
}
```

## Error Response Example

```json
{
  "success": false,
  "error": "At least one of title, description, or content must be provided"
}
```
