← Back to all apps

MotherDuck

Databy MotherDuck Corporation
Launched Sep 16, 2026 on ChatGPT

Connect AI assistants to your MotherDuck data warehouse. Explore, visualize, and manage data using natural language–no SQL skills required. Create Dives: interactive visualizations that let you save and share answers with your team, staying up-to-date with your latest data. Works with real-world data without requiring semantic models or pre-configuration. Your AI assistant acts like a data analyst, exploring, validating, analyzing, and visualizing data iteratively to answer your questions.

45ChatGPT Tools
15Claude Tools
MotherDuck CorporationDeveloper
DataCategory

Use Cases

data

Available Tools

Ask Docs Question

ask_docs_question
Full Description

Ask a question about DuckDB or MotherDuck. Returns answers from official documentation.

Parameters (1 required)
Required
questionstring

Question about DuckDB or MotherDuck

Cancel Flight Run

cancel_flight_run
Full Description

Cancel an in-flight run of a flight. Identified by the flight UUID and the sequential run number (from list_flight_runs). Returns canceled: true on a successful transition; calling on an already-terminal run or one that doesn't exist returns a tool error.

Parameters (2 required)
Required
idstring

The flight UUID

run_numberinteger

Sequential run number to cancel

Create Flight

create_flight
Full Description

Create a new MotherDuck flight. Read the flight guide before you create your first flight. A flight is a Python entrypoint (source_code) plus an optional requirements_txt that runs on MotherDuck compute. Optionally provide an access_token_name so the flight can connect to MotherDuck at runtime; omit it to use the default MotherDuck Flights access token. Optionally provide a 5-field cron expression to run on a schedule, and an optional max_runtime_sec to cap how long a run may take. Use flights for ELT/ETL pipelines, loading external data into MotherDuck, refreshing materialized views, or any recurring Python job that reads/writes MotherDuck data.

Parameters (2 required, 6 optional)
Required
namestring

Flight name (used in UI and logs)

source_codestring

Python source for the flight entrypoint (a single-file script with a top-level `def main(): ...`)

Optional
access_token_namestring

Optional name of a MotherDuck access token label to use at runtime. Omit to use the default MotherDuck Flights access token. Run `SELECT * FROM md_access_tokens()` to list available labels.

configobject

Optional non-secret key/value pairs made available as env vars

flight_secret_namesarray

Optional list of MotherDuck secret names made available as env vars

max_runtime_secinteger

Optional per-run timeout in seconds; 0 means no timeout. Omit to use your plan's default. Requests above your plan's cap are rejected.

requirements_txtstring

Optional `requirements.txt` contents for pip install (one pinned package per line).

schedule_cronstring

Optional 5-field cron expression (UTC). Omit to create an on-demand-only flight.

Create Guide

create_guide
Full Description

Create a new guide — a markdown document that agents read to answer this org's data questions correctly (metric definitions, join/filter conventions, pitfalls). Group related guides with a lowercase kebab-case topic (e.g. 'revenue-billing' or 'core/metrics'); omit it for a guide without a topic. Visibility is controlled by access: 'user' (private, default) or 'organization' (org-wide, permission-gated). Personal dive/flight style guides belong under topic 'dives' / 'flights' with access 'user'. Attach references to the 1–5 objects the guide is authoritative about.

Parameters (2 required, 6 optional)
Required
contentstring

The full markdown body.

titlestring

Human-readable title.

Optional
accessstring

'user' (private, default) or 'organization' (org-wide, permission-gated).

Options:userorganization
change_commentstring

Optional note describing this initial version.

descriptionstring

Short one-line summary shown in the index.

external_idstring

Optional caller-provided id for this version (e.g. a git SHA).

referencesarray

Structured references to the objects this guide explains.

topicstring

Slash-separated grouping label, e.g. 'revenue-billing' or 'core/metrics' (no leading/trailing slash). Omit for no topic.

Delete Dive

delete_dive
Full Description

Delete a dive by ID. This action is permanent and cannot be undone.

Parameters (1 required)
Required
idstring

The unique identifier of the dive to delete

Delete Flight

delete_flight
Full Description

Permanently delete a flight, its versions, schedule, and run history. This action cannot be undone.

Parameters (1 required)
Required
idstring

The flight UUID

Delete Guide

delete_guide
Full Description

Soft-delete a guide while preserving its version history. Identify it by uuid.

Parameters (1 required)
Required
uuidstring

The guide's UUID, as returned by list_guides or a previous mutation.

Dive Query

dive_query
Full Description

Execute a read-only DuckDB query on behalf of a dive. This tool is used by the dive viewer and is not intended for direct use by the AI assistant.

Parameters (1 required, 2 optional)
Required
sqlstring

SQL query to execute

Optional
databasestring

Database name to query

dive_idstring

Dive UUID for fallback query attribution

Edit Dive Content

edit_dive_content
Full Description

Edit a dive's content by applying one or more text replacements, then save to MotherDuck. Accepts id (dive UUID) and edits (an array of {old_string, new_string, replace_all?} objects). Reads the current content from MotherDuck, applies edits in sequence, validates, and persists. Example: {id: '...', edits: [{old_string: 'foo', new_string: 'bar'}]}. old_string must be unique unless replace_all is true. No prior read_dive call is needed.

Parameters (2 required)
Required
editsarray

List of edits to apply in sequence. Each edit has old_string, new_string, and optional replace_all.

idstring

The unique identifier (UUID) of the dive to edit

Edit Flight Source

edit_flight_source
Full Description

Edit a flight's source_code by applying one or more text replacements, then save as a new FlightVersion. Accepts id (flight UUID) and edits (an array of {old_string, new_string, replace_all?} objects). Reads the current source_code, applies edits in sequence, validates, and persists. Example: {id: '...', edits: [{old_string: 'foo', new_string: 'bar'}]}. old_string must be unique unless replace_all is true. No prior get_flight call is needed.

Parameters (2 required)
Required
editsarray

List of edits to apply in sequence. Each edit has old_string, new_string, and optional replace_all.

idstring

The flight UUID

Edit Guide Content

edit_guide_content
Full Description

Edit a guide's markdown body by applying one or more text replacements, then save as a new version. Identify the guide by uuid. Reads the stored guide, applies edits in sequence, and persists. Example: {uuid: '<guide uuid>', edits: [{old_string: 'foo', new_string: 'bar'}]}. old_string must be unique unless replace_all is true. No prior get_guide call is needed.

Parameters (2 required, 2 optional)
Required
editsarray

List of edits to apply in sequence. Each edit has old_string, new_string, and optional replace_all.

uuidstring

The guide's UUID, as returned by list_guides or a previous mutation.

Optional
change_commentstring

Optional note describing this version's change.

external_idstring

Optional caller-provided id for this version (e.g. a git SHA).

Get Dive Guide

get_dive_guide
Full Description

Load instructions for creating MotherDuck dives. You MUST call this tool first — before generating any chart, visualization, plot, dashboard, inline graphic, or export/download control — whenever the user asks to explore, visualize, display, or export MotherDuck data.

Parameters (1 required)
Required
clientstring

The client environment requesting the guide. Use 'claude' for Claude web/desktop Chat, 'chatgpt' for ChatGPT, 'claude_cowork' for Claude Cowork, 'claude_code' for Cursor/IDE integrations with local filesystem access, or 'other' for other MCP clients.

Options:claudechatgptclaude_coworkclaude_codeother

Get Flight

get_flight
Full Description

Fetch a flight by UUID. Returns metadata plus a version snapshot (source code, requirements, config, secret names, token name). Omit version to get the current version; pass a 1-indexed version number to inspect history.

Parameters (1 required, 1 optional)
Required
idstring

The flight UUID

Optional
versioninteger

Optional 1-indexed version number. Omit to get the current version.

Get Flight Guide

get_flight_guide
Full Description

Load instructions for authoring, scheduling, running, and troubleshooting MotherDuck flights. Call this tool first whenever the user asks about creating, updating, or operating a MotherDuck flight.

Get Flight Run Logs

get_flight_logs
Full Description

Fetch the plain-text logs (stdout + stderr) of a flight run plus the matching Run record (status, exit_code, timing). Returns the last 200 lines by default; page with limit, offset and order. Pass max_bytes to cap the response size — the response is truncated to fit and the truncation is reported via truncated: true.

Parameters (2 required, 4 optional)
Required
idstring

The flight UUID

run_numberinteger

Sequential run number

Optional
limitinteger

Max log lines to return (default: 200)

Default: 200
max_bytesinteger

Optional max bytes of logs to return; the response is truncated to fit, keeping the end `order` reads from.

offsetinteger

Number of lines to skip, counted from the end `order` reads from

orderstring

'asc' reads from the first log line, 'desc' from the last (default: 'desc')

Options:ascdesc
Default: desc

Get Flight Run

get_flight_run
Full Description

Fetch a single run of a flight by its sequential run number (from list_flight_runs). Returns the same shape as a list_flight_runs entry: status (PENDING/RUNNING/SUCCEEDED/FAILED/CANCELLED), timing metadata, and the effective config the run executed with. Use this to poll one run's status instead of re-listing.

Parameters (2 required)
Required
idstring

The flight UUID

run_numberinteger

Sequential run number to fetch

Get Guide

get_guide
Full Description

Load a guide by uuid. Guides are curated markdown documents about this organization's data (metric definitions, conventions, pitfalls). Find a guide's uuid with list_guides or via get_query_guide (start there before writing SQL), get_dive_guide, or get_flight_guide.

Parameters (1 required, 1 optional)
Required
uuidstring

The guide's UUID, as returned by list_guides or a previous mutation.

Optional
versioninteger

Optional version number to read; defaults to the current version.

Get Query Guide

get_query_guide
Full Description

Call this before writing SQL to answer a data question. Returns this organization's query guidance: what guides exist (curated markdown documents about the data — metric definitions, join/filter conventions, pitfalls), how to navigate them, and an overview of the available guide topics.

Get Short-Lived Token

get_short_lived_token
Full Description

Returns a short-lived token and connection details for the MotherDuck database endpoint.

List Columns

list_columns
Full Description

List all columns of a table or view with their types and comments.

Parameters (2 required, 2 optional)
Required
databasestring

Database name

tablestring

Table or view name

Optional
limitinteger

Max results to return (default: 100)

schemastring

Schema name (optional, defaults to 'main')

List Databases

list_databases
Full Description

List all databases in your MotherDuck account. Shows each database's alias, type, and its url — a fully qualified MotherDuck database name (e.g. md:my_db) or share URL (e.g. in guide references). Optionally filter by keywords.

Parameters (0 required, 2 optional)
Optional
keywordsstring

Optional keywords to filter databases by name (case-insensitive, any word can match)

limitinteger

Max results to return (default: 100)

List Dives

list_dives
Full Description

List all dives in MotherDuck. Dives are interactive React data apps that query live data. Returns metadata including current_version and status. Each dive has a governance status: 'endorsed' (admin-approved org source of truth — prefer these), 'ready' (author-reviewed), 'draft' (work in progress; the default for new dives), or 'archived' (retired; excluded unless include_archived is true). Results are ordered endorsed, ready, draft, then archived, most recently updated first. Use read_dive with the optional version parameter to retrieve a specific historical version. Optionally filter by keywords.

Parameters (0 required, 4 optional)
Optional
include_archivedboolean

Include archived Dives in the results. Defaults to false. Archived Dives remain readable via read_dive by id.

include_org_sharesboolean

Include Dives shared with your organization. Defaults to false.

keywordsstring

Optional keywords to filter dives by title or description (case-insensitive, all words must match)

limitinteger

Max results to return (default: 100)

List Flight Runs

list_flight_runs
Full Description

List executions of a flight, newest first. Each run has a sequential number, status (PENDING/RUNNING/SUCCEEDED/FAILED/CANCELLED), timing metadata, and the effective config it ran with (the flight version's config merged with any per-run overrides).

Parameters (1 required, 2 optional)
Required
idstring

The flight UUID

Optional
limitinteger

Max results (default: 50)

Default: 50
offsetinteger

Number of runs to skip, for paging back through history

List Flight Versions

list_flight_versions
Full Description

List the immutable versions of a flight, newest first. Each update to source_code / requirements_txt / config / access_token_name / flight_secret_names produces a new version.

Parameters (1 required, 2 optional)
Required
idstring

The flight UUID

Optional
limitinteger

Max results (default: 50)

Default: 50
offsetinteger

Number of versions to skip, for paging back through history

List Flights

list_flights
Full Description

List MotherDuck flights. Org admins see every flight in their organization (with owner_name identifying whose is whose); everyone else sees only their own. Returns metadata for each flight including schedule and current version. Optionally filter by keywords matching the flight name.

Parameters (0 required, 4 optional)
Optional
keywordsstring

Optional keywords to filter by flight name (case-insensitive, all words must match). Filters within the page selected by limit/offset, not across every flight.

limitinteger

Max results to return (default: 50)

Default: 50
offsetinteger

Number of flights to skip, for paging through results

owner_onlyboolean

Restrict the listing to flights you own. Only meaningful for org admins, who see the whole org's flights by default; ignored for everyone else.

List Guides

list_guides
Full Description

Browse this organization's curated guides — markdown documents that capture organization and personal context about the data in MotherDuck. Called with no arguments, lists the root level: guides without topics plus every topic (folder) with its guide count. Pass topic to open a folder — you get the guides stored at that topic and the nested topics below it. Read a guide in full with get_guide(uuid).

Parameters (0 required, 1 optional)
Optional
topicstring

Open this folder, e.g. 'revenue-billing' or 'core/metrics' (no leading/trailing slash). Omit for the root level.

List Macros

list_macros
Full Description

List all macros (table and scalar macros) in a MotherDuck database, with their schema and parameters. Optionally filter by schema or keywords.

Parameters (1 required, 3 optional)
Required
databasestring

Database name to list macros from

Optional
keywordsstring

Optional keywords to filter macros by name (case-insensitive, any word can match)

limitinteger

Max results to return (default: 100)

schemastring

Schema name (optional, defaults to all schemas)

List Shares

list_shares
Full Description

List all database shares that have been shared with you. Returns share names and URLs. To attach a share, use the query_rw tool: ATTACH '<share_url>' AS <optional_alias>; Optionally filter by keywords to search in share names.

Parameters (0 required, 2 optional)
Optional
keywordsstring

Optional keywords to filter shares by name (case-insensitive, any word can match)

limitinteger

Max results to return (default: 100)

List Tables

list_tables
Full Description

List all tables and views in a MotherDuck database with comments. Optionally filter by keywords. Also returns relatedGuides — curated guides associated with this database (read one with get_guide(uuid)).

Parameters (1 required, 3 optional)
Required
databasestring

Database name to list tables from

Optional
keywordsstring

Optional keywords to filter tables/views by name or comment (case-insensitive, any word can match)

limitinteger

Max results to return (default: 100)

schemastring

Schema name (optional, defaults to all schemas)

List Views

list_views
Full Description

List all views in a MotherDuck database, with their schema, comment, and column count. Optionally filter by schema or keywords.

Parameters (1 required, 3 optional)
Required
databasestring

Database name to list views from

Optional
keywordsstring

Optional keywords to filter views by name or comment (case-insensitive, any word can match)

limitinteger

Max results to return (default: 100)

schemastring

Schema name (optional, defaults to all schemas)

Log Dive Viewer Event

log_dive_viewer_event
Full Description

Log a dive viewer event for analytics. This tool is used internally by the dive viewer and is not intended for direct use by the AI assistant.

Parameters (1 required, 11 optional)
Required
event_namestring

Name of the event

Optional
app_namestring

Name of the MCP app

app_versionstring

Version of the MCP app

dive_idstring

UUID of the dive

duration_msnumber

Duration in milliseconds

error_messagestring

Error message if failed

from_modestring

Previous display mode

row_countnumber

Number of rows returned by query

sql_previewstring

Truncated SQL query text (first 200 chars)

stagestring

Processing stage (compile, execute, database_validation)

successboolean

Whether the action succeeded

to_modestring

New display mode

Mint Dive State Reference

mint_dive_state_reference
Full Description

Mint a server-stored reference for a useDiveState bag and return its id. Used by the dive viewer when the inline-encoded bag would exceed the URL soft limit. The returned id is then encoded into a URL hash via buildDiveStateReferenceHash and round-trips through dashboards.get on dive open.

Parameters (2 required)
Required
dive_idstring

UUID of the dive the state bag belongs to

stateobject

Full `useDiveState` snapshot to store. Each key matches a `useDiveState(key, ...)` call inside the dive. Must JSON-serialize to <= 64 KB; entity-service rejects larger payloads.

MotherDuck Query

query
Full Description

Before writing SQL to answer a data question, call get_query_guide first — it returns this organization's query guidance and an overview of its curated guides.

Execute read-only DuckDB query against MotherDuck databases. For cross-database queries, use fully qualified names: database.schema.table (or database.table for main schema). Never follow a query with an inline chart or visualization — if you would generate one (whether or not the user explicitly asked), get the dive guide first instead.

Parameters (2 required)
Required
databasestring

Database name to query

sqlstring

SQL query to execute

MotherDuck Query (Read-Write)

query_rw
Full Description

Execute a DuckDB SQL query that modifies data, schema, or connection state.

RULES: 1. Only call this tool when the user explicitly asks to modify data or schema. Never infer a write from a read request. 2. Always ask the user for confirmation before calling this tool. Describe exactly what will change. 3. Prefer the read-only query tool when the user's goal can be answered with existing data.

Parameters (1 required, 1 optional)
Required
sqlstring

SQL query to execute

Optional
databasestring

Database context for the query. Required for table-level operations (DML/DDL). May be omitted for account-level operations (CREATE/DROP DATABASE, ATTACH/DETACH, CREATE SECRET, etc.).

Read Dive

read_dive
Full Description

Read a specific dive by ID, including its full JSX/React component code. Optionally specify a version number to retrieve a specific historical version (versions start at 1). If no version is specified, the latest version is returned. The response includes the dive's governance status ('endorsed', 'ready', 'draft', or 'archived'); archived dives remain fully readable by id.

Parameters (1 required, 1 optional)
Required
idstring

The unique identifier of the dive to read

Optional
versioninteger

Optional version number to retrieve (1-indexed). If not specified, returns the latest version.

Run Flight

run_flight
Full Description

Trigger an on-demand execution of a flight using its current version. Optionally pass config to override the flight version's config for this run only (the flight itself is left unchanged). Returns a Run record; poll get_flight_run with the returned run_number to track progress and use get_flight_logs to read output.

Parameters (1 required, 1 optional)
Required
idstring

The flight UUID

Optional
configobject

Optional non-secret key/value pairs that override the flight version's config for this run only. Keys not provided keep the flight version's value; provided keys win.

Save Dive

save_dive
Full Description

Save a new dive to MotherDuck. Returns a URL the user can click to view the dive. Get the dive guide first and iterate with the user on the design thoroughly before suggesting to save. Never save without previous confirmation that iteration is done.

Parameters (2 required, 1 optional)
Required
contentstring

The JSX/React component code for the dive

titlestring

The title of the dive

Optional
descriptionstring

A brief description of the dive

Search Catalog

search_catalog
Full Description

Search the catalog for databases, schemas, tables, columns, and shares using fuzzy matching. Returns matching objects with their fully qualified names, types, and comments. Useful for discovering available data when you don't know exact names. Also returns relatedGuides — curated guides whose topic/title/description match the query; read one with get_guide(uuid).

Parameters (1 required, 1 optional)
Required
querystring

Search term to find in object names (supports partial matching, underscores, dots)

Optional
object_typesarray

Optional filter to limit results to specific object types

Set Guide Access

set_guide_access
Full Description

Set a guide's visibility to 'user' (private to the owner) or 'organization' (visible to the whole org). Identify it by uuid. Org-wide scoping is permission-gated.

Parameters (2 required)
Required
accessstring

'user' (private) or 'organization' (org-wide, permission-gated).

Options:userorganization
uuidstring

The guide's UUID, as returned by list_guides or a previous mutation.

Share Dive Data

share_dive_data
Full Description

Share the data for a dive with your organization. Creates org-scoped shares for owned databases used in the dive, and updates the dive so others in the organization can view it.

Parameters (1 required)
Required
diveIdstring

The unique identifier (UUID) of the dive

Update Dive

update_dive
Full Description

Update an existing dive's title, description, or content. Returns a URL the user can click to view the updated dive. At least one field must be provided.

Parameters (1 required, 3 optional)
Required
idstring

The unique identifier (UUID) of the dive to update

Optional
contentstring

New JSX/React component code

descriptionstring

New description for the dive

titlestring

New title for the dive

Update Flight

update_flight
Full Description

Update a flight. Any subset of name, source_code, requirements_txt, schedule_cron, config, access_token_name, flight_secret_names, max_runtime_sec, or instance_type may be provided. Updates to source_code/requirements_txt/config/flight_secret_names/access_token_name/max_runtime_sec/instance_type create a new FlightVersion; name and schedule_cron are metadata-only. Pass schedule_cron as "" (empty string) to remove the schedule; omit it to leave it unchanged.

Parameters (1 required, 9 optional)
Required
idstring

The flight UUID

Optional
access_token_namestring

New MotherDuck access token label to use at runtime. Omit to leave the current token unchanged.

configobject

Replacement config map (full replace)

flight_secret_namesarray

Replacement list of MotherDuck secret names (full replace)

instance_typestring

New runner size, named after its memory in GB: F4, F16 or F32. Omit to leave it unchanged. Sizes above your plan's cap are rejected.

Options:F4F16F32
max_runtime_secinteger

New per-run timeout in seconds; 0 means no timeout. Omit to leave it unchanged. Requests above your plan's cap are rejected.

namestring

New flight name

requirements_txtstring

New requirements.txt contents

schedule_cronstring

New cron expression (UTC, 5 fields). Empty string clears the schedule.

source_codestring

New Python entrypoint source (single-file)

Update Guide

update_guide
Full Description

Append a new version to an existing guide, identified by uuid. Omit content to keep the current text and just change metadata such as references. A supplied references list replaces the existing one (pass [] to clear them, omit to carry them forward). For small in-place edits use edit_guide_content. Use create_guide to make a new guide, update_guide_metadata to retitle or re-topic.

Parameters (1 required, 4 optional)
Required
uuidstring

The guide's UUID, as returned by list_guides or a previous mutation.

Optional
change_commentstring

Optional note describing this version's change.

contentstring

New full markdown body. Omit to carry the current version's content forward.

external_idstring

Optional caller-provided id for this version (e.g. a git SHA).

referencesarray

Replaces the guide's references. Pass [] to clear; omit to carry them forward.

Update Guide Metadata

update_guide_metadata
Full Description

Change a guide's title, description, or topic without appending a content version. Identify it by uuid. Pass an empty description to clear it; pass an empty topic to remove the topic.

Parameters (1 required, 3 optional)
Required
uuidstring

The guide's UUID, as returned by list_guides or a previous mutation.

Optional
descriptionstring

New one-line summary. Pass an empty string to clear it.

titlestring

New title.

topicstring

New grouping label, e.g. 'revenue-billing' or 'core/metrics' (no leading/trailing slash). Pass an empty string to remove the topic.

View Dive

view_dive
Full Description

Open and render a MotherDuck Dive as a live MCP app with interactive charts. Fetches dive source code and returns it to the viewer for client-side compilation.

Parameters (1 required, 2 optional)
Required
dive_idstring

UUID of the dive to open

Optional
initial_stateobject

Seed the dive's initial UI state for this preview. When supplied, each key is read by the corresponding `useDiveState` call inside the dive. Useful when the user describes a specific view ("show me this filtered to last quarter") — pass that selection as initial_state instead of re-saving the dive. State stays in memory for the preview session; interactive changes do not round-trip back to the MCP host. Example shape: { "region": "us-east-1", "filters": ["alpha"], "count": 5 }. Do not use for ephemeral UI state (input drafts, dialog open/close) — those use plain useState inside the dive and aren't part of the dive-state bag.

required_resourcesarray

Override the dive's declared required resources for this preview. When supplied, the dive viewer attaches this list in place of the dive's source-declared REQUIRED_DATABASES. Useful when the user wants to preview against a specific share or embed configuration ("render this against the customer's analytics database instead of mine"). Example shape: [{ "url": "md:customer_analytics", "alias": "analytics" }]. Do not use as a substitute for fixing the dive's source — if the dive should permanently target different databases, edit the source and update_dive instead.