# Guides

> Create, read, update, and manage Guides — markdown documents that capture your organization's metric definitions, join conventions, and domain context so AI agents write accurate SQL — through the MotherDuck MCP server.

## Included pages

- [get_query_guide](https://motherduck.com/docs/sql-reference/mcp/guides/get-query-guide): Load your organization's query guidance and an overview of available Guides before writing SQL
- [list_guides](https://motherduck.com/docs/sql-reference/mcp/guides/list-guides): Browse your organization's Guides level by level, grouped by topic
- [get_guide](https://motherduck.com/docs/sql-reference/mcp/guides/get-guide): Load a Guide's full content by UUID, optionally pinning a historical version
- [create_guide](https://motherduck.com/docs/sql-reference/mcp/guides/create-guide): Create a new Guide — a markdown document that AI agents use to answer your organization's data questions correctly
- [update_guide](https://motherduck.com/docs/sql-reference/mcp/guides/update-guide): Append a version to an existing Guide with updated content or references
- [edit_guide_content](https://motherduck.com/docs/sql-reference/mcp/guides/edit-guide-content): Apply targeted string replacements to a Guide and save the result as a versioned update
- [update_guide_metadata](https://motherduck.com/docs/sql-reference/mcp/guides/update-guide-metadata): Change a Guide's title, description, or topic without creating a content version
- [set_guide_access](https://motherduck.com/docs/sql-reference/mcp/guides/set-guide-access): Change a Guide's visibility between private and org-wide
- [delete_guide](https://motherduck.com/docs/sql-reference/mcp/guides/delete-guide): Soft-delete a Guide while preserving its version history

Source: https://motherduck.com/docs/category/guides

---

## get_query_guide

Source: https://motherduck.com/docs/sql-reference/mcp/guides/get-query-guide

> Load your organization's query guidance and an overview of available Guides before writing SQL

Loads your organization's query guidance: what [Guides](/key-tasks/guides/) exist, how to navigate them, and an overview of the available guide topics. Call this before writing SQL to answer a data question.

## Description

The `get_query_guide` tool is the entry point into the guide layer for querying. It returns orientation on how to use and navigate guides plus an unfolded overview of your organization's topics and root-level guides — every topic with its guide count, then the guides without a topic with title, description, access level, and UUID.

The reserved `dives` and `flights` topics are omitted here; they have their own entry points ([`get_dive_guide`](/sql-reference/mcp/dives/get-dive-guide) and [`get_flight_guide`](/sql-reference/mcp/flights/get-flight-guide)).

## Input parameters

This tool takes no arguments.

## Output

The tool returns the guide as a plain-text document: navigation instructions followed by the topic overview. The response is mirrored into structured content as:

```json
{
  "text": string  // Navigation instructions plus the topic overview
}
```

The overview lists every topic with its guide count first, then the root-level guides:

```text
- data-quality/ (1 guide)
- revenue-billing/ (2 guides)
- revenue-billing/forecasting/ (1 guide)
- "Data platform overview" — what lives where in our warehouse (organization, uuid: a1b2c3d4-...)
```

## Example usage

When the user asks a data question, the assistant should call this tool before exploring the schema or writing SQL:

```text
What was our net revenue retention last quarter?
```

The assistant calls `get_query_guide`, sees that a `revenue-billing` topic exists, opens it with [`list_guides`](../list-guides), and reads the relevant guide with [`get_guide`](../get-guide) before writing the query.

## Related

- [`list_guides`](../list-guides) — Browse the guide catalog level by level.
- [`get_guide`](../get-guide) — Load a guide's full content by UUID.
- [`get_dive_guide`](/sql-reference/mcp/dives/get-dive-guide) — Entry point for Dive conventions.
- [`get_flight_guide`](/sql-reference/mcp/flights/get-flight-guide) — Entry point for Flight conventions.
- [Guides how-to](/key-tasks/guides/) — Step-by-step instructions for creating and managing Guides.

---

## list_guides

Source: https://motherduck.com/docs/sql-reference/mcp/guides/list-guides

> Browse your organization's Guides level by level, grouped by topic

Browse your organization's [Guides](/key-tasks/guides/) — markdown documents that capture metric definitions, join conventions, and domain context that AI agents need to query your data accurately.

## Description

The `list_guides` tool browses the guide catalog with progressive disclosure. Called with no arguments, it lists the root level: guides with no topic plus every topic with its guide count. Pass `topic` to open one — you get the guides stored exactly at that topic and the nested topics below it.

Guides are identified by UUID. Use [`get_guide`](../get-guide) with a `uuid` from the listing to read a guide in full.

For query guidance and a full topic overview in one call, start with [`get_query_guide`](../get-query-guide) instead.

## Input parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `topic` | string | No | Open this topic — for example `"revenue-billing"` or `"core/metrics"` (no leading or trailing slash). Omit for the root level. |

## Output schema

```json
{
  "success": boolean,
  "topic": string,           // The level being listed ("" for root)
  "topics": [
    {
      "topic": string,       // Nested topic path
      "guide_count": number  // Number of guides in that subtree
    }
  ],
  "guides": [
    {
      "uuid": string,        // Guide UUID — use with get_guide
      "topic": string,       // The guide's topic ("" for guides without a topic)
      "title": string,       // Guide title
      "access": string,      // "user" or "organization"
      "description": string  // One-line summary
    }
  ],
  "error": string            // Error message (on failure)
}
```

## Example usage

**Browse the root level:**

```text
What guides does my organization have?
```

The AI assistant calls the tool with no arguments and receives the guides without a topic plus the top-level topics.

**Open a topic:**

```text
Show me the guides about revenue and billing
```

```json
{
  "topic": "revenue-billing"
}
```

**Open a nested topic:**

```json
{
  "topic": "core/metrics"
}
```

## Success response example

```json
{
  "success": true,
  "topic": "revenue-billing",
  "topics": [
    {
      "topic": "revenue-billing/forecasting",
      "guide_count": 2
    }
  ],
  "guides": [
    {
      "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "topic": "revenue-billing",
      "title": "MRR and ARR Definitions",
      "access": "organization",
      "description": "How monthly and annual recurring revenue are calculated"
    },
    {
      "uuid": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "topic": "revenue-billing",
      "title": "Billing Edge Cases",
      "access": "organization",
      "description": "Pitfalls when querying the billing tables"
    }
  ]
}
```

## Related

- [`get_query_guide`](../get-query-guide) — Entry point: query guidance plus a full topic overview.
- [`get_guide`](../get-guide) — Load a guide's full content by UUID.
- [`create_guide`](../create-guide) — Create a new guide.
- [Guides how-to](/key-tasks/guides/) — Step-by-step instructions for creating and managing Guides.

---

## get_guide

Source: https://motherduck.com/docs/sql-reference/mcp/guides/get-guide

> Load a Guide's full content by UUID, optionally pinning a historical version

Load a [Guide](/key-tasks/guides/) by UUID. Find a guide's UUID with [`list_guides`](../list-guides) or through the entry points [`get_query_guide`](../get-query-guide), [`get_dive_guide`](/sql-reference/mcp/dives/get-dive-guide), and [`get_flight_guide`](/sql-reference/mcp/flights/get-flight-guide).

## Description

The `get_guide` tool returns a guide's full markdown content plus its metadata and references. Guides are identified by UUID, consistent with Dives and Flights. Pass `version` to read a specific historical version; by default the current version is returned.

## Input parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `uuid` | string | Yes | The guide's UUID, as returned by `list_guides` or a previous mutation. |
| `version` | integer | No | Version number to read. Defaults to the current version. |

## Output

On success, the tool returns the guide as a plain-text document rather than a JSON object: the title, a metadata line (UUID, topic, version, access level), the description, the full markdown content, and a references footer. The response is mirrored into structured content as:

```json
{
  "text": string  // The rendered guide document
}
```

On failure, the tool returns a structured error:

```json
{
  "success": false,
  "error": string
}
```

## Example usage

**Read a guide found through the topic overview:**

```text
How should I calculate MRR for our billing data?
```

The assistant calls [`get_query_guide`](../get-query-guide) or [`list_guides`](../list-guides) to find the relevant guide's UUID, then loads it:

```json
{
  "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
```

**Read a specific historical version:**

```json
{
  "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "version": 2
}
```

## Success response example

```text
MRR and ARR Definitions
uuid: a1b2c3d4-e5f6-7890-abcd-ef1234567890 · topic: revenue-billing · v3 · organization

How monthly and annual recurring revenue are calculated

# MRR and ARR Definitions

MRR is calculated as...

## References
- catalog md:billing main.subscriptions
```

## Related

- [`get_query_guide`](../get-query-guide) — Entry point: query guidance plus a topic overview.
- [`list_guides`](../list-guides) — Browse the guide catalog to find a UUID.
- [`update_guide`](../update-guide) — Append a version to a guide.
- [`edit_guide_content`](../edit-guide-content) — Make targeted in-place edits.
- [Guides how-to](/key-tasks/guides/) — Step-by-step instructions for creating and managing Guides.

---

## create_guide

Source: https://motherduck.com/docs/sql-reference/mcp/guides/create-guide

> Create a new Guide — a markdown document that AI agents use to answer your organization's data questions correctly

Create a new [Guide](/key-tasks/guides/) — a markdown document that captures metric definitions, join conventions, and domain context for your organization's data.

## Description

The `create_guide` tool creates a guide identified by a generated UUID. Group related guides with an optional lowercase kebab-case `topic` (for example `"revenue-billing"` or `"core/metrics"`); omit it to keep the guide at the root level without a topic. Topics are grouping labels only — they carry no uniqueness, so multiple guides can share the same topic.

Visibility is controlled by `access`: `"user"` (private, default) or `"organization"` (org-wide, admin-permission gated). Personal Dive and Flight style guides belong under topic `"dives"` or `"flights"` with access `"user"` — they're surfaced by [`get_dive_guide`](/sql-reference/mcp/dives/get-dive-guide) and [`get_flight_guide`](/sql-reference/mcp/flights/get-flight-guide).

Attach `references` to link the guide to the 1–5 catalog objects, Dives, Flights, or other Guides it is authoritative about. References let [`list_tables`](/sql-reference/mcp/core/list-tables) and [`search_catalog`](/sql-reference/mcp/core/search-catalog) surface related guides automatically.

## Input parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `title` | string | Yes | Human-readable title. Must not be empty. |
| `content` | string | Yes | Full markdown body of the guide. Maximum 1 MB. |
| `topic` | string | No | Slash-separated grouping label — for example `"revenue-billing"` or `"core/metrics"` (no leading or trailing slash). Omit for no topic. |
| `description` | string | No | Short one-line summary shown in the guide index. |
| `access` | string | No | `"user"` (private, default) or `"organization"` (org-wide, admin-permission gated). |
| `change_comment` | string | No | Optional note describing this initial version. |
| `external_id` | string | No | Optional caller-provided ID for this version (for example a git SHA). |
| `references` | array | No | Structured references to the 1–5 objects this guide explains. See [reference object shape](#reference-object-shape). |

### Reference object shape

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `type` | string | Yes | One of `"catalog"`, `"dive"`, `"flight"`, or `"guide"` |
| `url` | string | Conditional | MotherDuck URL — required for `catalog` type (for example `"md:my_database"` or a `"md:_share/..."` URL) |
| `schema` | string | Conditional | Schema name — required when `table`, `view`, or `macro` is set |
| `table` | string | No | Table name (catalog only) |
| `column` | string | No | Column name (catalog only, requires `table`) |
| `view` | string | No | View name (catalog only, mutually exclusive with `table`/`macro`) |
| `macro` | string | No | Macro name (catalog only, mutually exclusive with `table`/`view`) |
| `uuid` | string | Conditional | UUID of the referenced Dive, Flight, or Guide |
| `description` | string | No | Why this reference exists |

## Output schema

```json
{
  "success": boolean,
  "guide": {
    "id": string,                   // Generated UUID of the guide
    "topic": string,                // Grouping label (null if omitted)
    "title": string,                // Guide title
    "description": string,          // One-line summary
    "access": string,               // "user" or "organization"
    "current_version": number,      // Version number (1 for new guides)
    "created_at": string,           // ISO 8601 creation timestamp
    "updated_at": string,           // ISO 8601 last update timestamp
    "version_change_comment": string,
    "version_external_id": string,
    "version_created_at": string,
    "references": array             // Resolved references
  },
  "error": string                   // Error message (on failure)
}
```

## Example usage

**Create an org-wide metric definition guide:**

```text
Create a guide explaining how we calculate MRR for the billing team
```

```json
{
  "title": "MRR and ARR Definitions",
  "topic": "revenue-billing",
  "description": "How monthly and annual recurring revenue are calculated",
  "access": "organization",
  "content": "# MRR and ARR Definitions\n\nMRR (Monthly Recurring Revenue) is the sum of all active subscription amounts normalized to a monthly value.\n\n## Key rules\n\n- Use the `subscriptions` table, not `invoices`\n- Filter to `status = 'active'`\n- Exclude trial subscriptions (`trial_end IS NULL`)",
  "references": [
    {
      "type": "catalog",
      "url": "md:billing",
      "schema": "main",
      "table": "subscriptions",
      "description": "Primary source for subscription revenue data"
    }
  ]
}
```

**Save personal Dive style preferences:**

```text
Remember that I prefer dark-themed Dives with the watermelon accent color
```

```json
{
  "title": "My Dive style preferences",
  "topic": "dives",
  "access": "user",
  "content": "## Style preferences\n\n- Dark theme by default\n- Watermelon accent color\n- Number formats: compact notation (1.2M, not 1,200,000)"
}
```

## Success response example

```json
{
  "success": true,
  "guide": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "topic": "revenue-billing",
    "title": "MRR and ARR Definitions",
    "description": "How monthly and annual recurring revenue are calculated",
    "access": "organization",
    "current_version": 1,
    "created_at": "2025-06-01T10:00:00Z",
    "updated_at": "2025-06-01T10:00:00Z",
    "version_change_comment": null,
    "version_external_id": null,
    "version_created_at": "2025-06-01T10:00:00Z",
    "references": [
      {
        "type": "catalog",
        "url": "md:billing",
        "schema": "main",
        "table": "subscriptions",
        "description": "Primary source for subscription revenue data"
      }
    ]
  }
}
```

## Related

- [`list_guides`](../list-guides) — Browse existing guides before creating one.
- [`get_guide`](../get-guide) — Read a guide's content.
- [`update_guide`](../update-guide) — Append a version to an existing guide.
- [`edit_guide_content`](../edit-guide-content) — Make targeted in-place edits.
- [Guides how-to](/key-tasks/guides/) — Step-by-step instructions for creating and managing Guides.

---

## update_guide

Source: https://motherduck.com/docs/sql-reference/mcp/guides/update-guide

> Append a version to an existing Guide with updated content or references

Append a version to an existing [Guide](/key-tasks/guides/), identified by UUID. Use this to replace a guide's full content. For smaller targeted edits, use [`edit_guide_content`](../edit-guide-content) instead.

## Description

The `update_guide` tool saves an updated version of an existing guide. Omit `content` to carry the current text forward and only update metadata such as references. A supplied `references` list replaces the existing one — pass an empty array (`[]`) to clear all references, or omit `references` entirely to carry them forward.

To retitle or re-topic a guide, use [`update_guide_metadata`](../update-guide-metadata). To change visibility, use [`set_guide_access`](../set-guide-access).

## Input parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `uuid` | string | Yes | The guide's UUID, as returned by `list_guides` or a previous mutation. |
| `content` | string | No | New full markdown body. Omit to carry the current version's content forward. |
| `change_comment` | string | No | Optional note describing this version's change. |
| `external_id` | string | No | Optional caller-provided ID for this version (for example a git SHA). |
| `references` | array | No | Replaces the guide's references. Pass `[]` to clear; omit to carry forward. See [reference object shape](/sql-reference/mcp/guides/create-guide#reference-object-shape). |

## Output schema

```json
{
  "success": boolean,
  "guide": {
    "id": string,
    "topic": string,
    "title": string,
    "description": string,
    "access": string,
    "current_version": number,
    "created_at": string,
    "updated_at": string,
    "version_change_comment": string,
    "version_external_id": string,
    "version_created_at": string,
    "references": array
  },
  "error": string
}
```

## Example usage

**Update the full content of a guide:**

```text
Update the MRR guide to clarify that trial subscriptions are excluded
```

```json
{
  "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "content": "# MRR and ARR Definitions\n\n...(updated content)...",
  "change_comment": "Clarify trial subscription exclusion logic"
}
```

**Add references without changing content:**

```json
{
  "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "references": [
    {
      "type": "catalog",
      "url": "md:billing",
      "schema": "main",
      "table": "subscriptions"
    },
    {
      "type": "catalog",
      "url": "md:billing",
      "schema": "main",
      "table": "invoices"
    }
  ]
}
```

**Clear all references:**

```json
{
  "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "references": []
}
```

## Related

- [`edit_guide_content`](../edit-guide-content) — Make targeted in-place edits without replacing the full content.
- [`update_guide_metadata`](../update-guide-metadata) — Retitle, re-topic, or update the description.
- [`get_guide`](../get-guide) — Read the current guide content before updating.
- [Guides how-to](/key-tasks/guides/) — Step-by-step instructions for creating and managing Guides.

---

## edit_guide_content

Source: https://motherduck.com/docs/sql-reference/mcp/guides/edit-guide-content

> Apply targeted string replacements to a Guide and save the result as a versioned update

Apply one or more string replacements to a [Guide](/key-tasks/guides/), identified by UUID, and save the result as an updated version. No prior [`get_guide`](../get-guide) call is needed.

## Description

The `edit_guide_content` tool reads the stored guide, applies the supplied edits in sequence, and persists the result as a version update. This is the right choice for small, targeted changes such as fixing a typo, updating a table name, or adding a section. For replacing the entire content, use [`update_guide`](../update-guide).

Each edit must supply an `old_string` that is unique in the current content (unless `replace_all` is set), and a different `new_string`. Edits apply in order — the output of one edit is the input for the next.

## Input parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `uuid` | string | Yes | The guide's UUID, as returned by `list_guides` or a previous mutation. |
| `edits` | array | Yes | List of edits to apply in sequence. At least one edit is required. |
| `change_comment` | string | No | Optional note describing this version's change. |
| `external_id` | string | No | Optional caller-provided ID for this version (for example a git SHA). |

### Edit object shape

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `old_string` | string | Yes | The exact text to find. Must be unique in the content unless `replace_all` is true. |
| `new_string` | string | Yes | The replacement text. Must differ from `old_string`. |
| `replace_all` | boolean | No | Replace all occurrences of `old_string`. Defaults to `false`. |

## Output schema

```json
{
  "success": boolean,
  "guide": {
    "id": string,
    "topic": string,
    "title": string,
    "description": string,
    "access": string,
    "current_version": number,
    "created_at": string,
    "updated_at": string,
    "version_change_comment": string,
    "version_external_id": string,
    "version_created_at": string,
    "references": array
  },
  "edits_applied": number,       // Number of edits applied
  "total_replacements": number,  // Total string replacements made
  "error": string,               // Error message (on failure)
  "hint": string                 // Hint when old_string was not found (on failure)
}
```

## Example usage

**Fix a table name across a guide:**

```text
Rename the orders table to customer_orders in the billing guide
```

```json
{
  "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "edits": [
    {
      "old_string": "billing.main.orders",
      "new_string": "billing.main.customer_orders",
      "replace_all": true
    }
  ],
  "change_comment": "Rename orders to customer_orders after table migration"
}
```

**Apply multiple edits in one call:**

```json
{
  "uuid": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
  "edits": [
    {
      "old_string": "updated_at < CURRENT_TIMESTAMP - INTERVAL '24 hours'",
      "new_string": "updated_at < CURRENT_TIMESTAMP - INTERVAL '12 hours'"
    },
    {
      "old_string": "daily freshness threshold",
      "new_string": "12-hour freshness threshold"
    }
  ],
  "change_comment": "Tighten freshness SLA from 24h to 12h"
}
```

## Success response example

```json
{
  "success": true,
  "guide": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "topic": "revenue-billing",
    "title": "MRR and ARR Definitions",
    "description": "How monthly and annual recurring revenue are calculated",
    "access": "organization",
    "current_version": 4,
    "created_at": "2025-06-01T10:00:00Z",
    "updated_at": "2025-07-01T14:22:00Z",
    "version_change_comment": "Rename orders to customer_orders after table migration",
    "version_external_id": null,
    "version_created_at": "2025-07-01T14:22:00Z",
    "references": []
  },
  "edits_applied": 1,
  "total_replacements": 3
}
```

## Error response example

```json
{
  "success": false,
  "error": "old_string not found in guide content",
  "edits_applied": 0,
  "hint": "The string 'billing.main.orders' was not found. Check that the text matches exactly, including whitespace."
}
```

## Related

- [`update_guide`](../update-guide) — Replace the full content in one call.
- [`get_guide`](../get-guide) — Read the current content to identify the text to replace.
- [Guides how-to](/key-tasks/guides/) — Step-by-step instructions for creating and managing Guides.

---

## update_guide_metadata

Source: https://motherduck.com/docs/sql-reference/mcp/guides/update-guide-metadata

> Change a Guide's title, description, or topic without creating a content version

Change a [Guide](/key-tasks/guides/)'s title, description, or topic without appending a content version. The guide keeps its UUID and full version history.

## Description

The `update_guide_metadata` tool lets you retitle or re-topic a guide without touching its content. Use it when a guide's title or grouping is outdated — for example after a team reorganization or a product rename.

Provide at least one of `title`, `description`, or `topic`.

To update content, use [`update_guide`](../update-guide) or [`edit_guide_content`](../edit-guide-content) instead.

## Input parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `uuid` | string | Yes | The guide's UUID, as returned by `list_guides` or a previous mutation. |
| `title` | string | No | New human-readable title. Must not be empty when supplied. |
| `description` | string | No | New one-line summary. Pass an empty string (`""`) to clear it. |
| `topic` | string | No | New grouping label — for example `"revenue-billing"` or `"core/metrics"` (no leading or trailing slash). Pass an empty string (`""`) to remove the topic. |

## Output schema

```json
{
  "success": boolean,
  "guide": {
    "id": string,
    "topic": string,           // Updated topic (null when cleared)
    "title": string,           // Updated title
    "description": string,     // Updated description
    "access": string,
    "current_version": number,
    "created_at": string,
    "updated_at": string
  },
  "error": string
}
```

## Example usage

**Move a guide to a different topic:**

```text
Move the order filters guide from order-management to customer-orders
```

```json
{
  "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "topic": "customer-orders",
  "title": "Customer Order Filters"
}
```

**Update only the description:**

```json
{
  "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "description": "MRR and ARR definitions, including expansion and churn adjustments"
}
```

**Remove the topic (move the guide to the root level):**

```json
{
  "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "topic": ""
}
```

## Related

- [`update_guide`](../update-guide) — Append a content version.
- [`edit_guide_content`](../edit-guide-content) — Make targeted in-place content edits.
- [`set_guide_access`](../set-guide-access) — Change a guide's visibility.
- [Guides how-to](/key-tasks/guides/) — Step-by-step instructions for creating and managing Guides.

---

## set_guide_access

Source: https://motherduck.com/docs/sql-reference/mcp/guides/set-guide-access

> Change a Guide's visibility between private and org-wide

Change a [Guide](/key-tasks/guides/)'s visibility to `"user"` (private) or `"organization"` (visible to your whole org). Setting org-wide access is admin-permission gated.

## Description

The `set_guide_access` tool controls who can see and read a guide:

- **`"user"`** — private to the guide's owner. Only you can read or modify it.
- **`"organization"`** — visible to everyone in your MotherDuck organization. Setting this level requires admin permission.

Use this tool to promote a personal guide to org-wide after review, or to make a guide private again. Access is the only visibility mechanism — a guide's topic has no effect on who can see it.

## Input parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `uuid` | string | Yes | The guide's UUID, as returned by `list_guides` or a previous mutation. |
| `access` | string | Yes | `"user"` (private) or `"organization"` (org-wide, admin-permission gated). |

## Output schema

```json
{
  "success": boolean,
  "guide": {
    "id": string,
    "topic": string,
    "title": string,
    "description": string,
    "access": string,       // Updated access level
    "current_version": number,
    "created_at": string,
    "updated_at": string
  },
  "error": string
}
```

## Example usage

**Publish a guide to the whole org:**

```text
Make the MRR definitions guide available to the whole organization
```

```json
{
  "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "access": "organization"
}
```

**Make a guide private again:**

```json
{
  "uuid": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
  "access": "user"
}
```

## Related

- [`create_guide`](../create-guide) — Set access at creation time.
- [`update_guide_metadata`](../update-guide-metadata) — Change title, description, or topic.
- [Guides how-to](/key-tasks/guides/) — Step-by-step instructions for creating and managing Guides.

---

## delete_guide

Source: https://motherduck.com/docs/sql-reference/mcp/guides/delete-guide

> Soft-delete a Guide while preserving its version history

Soft-delete a [Guide](/key-tasks/guides/), identified by UUID. The version history is preserved for audit purposes.

## Description

The `delete_guide` tool removes a guide from the active catalog. The guide's version history is retained internally but is not exposed through normal tools after deletion. Only the guide's owner can delete it.

References from other guides to a deleted guide are left dangling and resolve to not-found — clean them up in the referencing guides if needed.

There is no undo through the MCP tools — if you delete a guide by mistake, contact MotherDuck support.

:::warning
Deleting an org-wide guide removes it from all users' guide catalogs immediately. Verify you have the right guide (read it with [`get_guide`](../get-guide)) before confirming deletion.
:::

## Input parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `uuid` | string | Yes | The guide's UUID, as returned by `list_guides` or a previous mutation. |

## Output schema

```json
{
  "success": boolean,
  "deleted": boolean,  // true when the guide was successfully deleted
  "error": string      // Error message (on failure)
}
```

## Example usage

**Delete a guide:**

```text
Delete the outdated order-management guide
```

The assistant finds the guide's UUID with [`list_guides`](../list-guides), verifies it's the right one, and calls:

```json
{
  "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
```

## Success response example

```json
{
  "success": true,
  "deleted": true
}
```

## Related

- [`list_guides`](../list-guides) — Find the guide's UUID before deleting.
- [`get_guide`](../get-guide) — Verify the guide content before deleting.
- [Guides how-to](/key-tasks/guides/) — Step-by-step instructions for creating and managing Guides.

---
