# motherduck-explore
> Find and understand MotherDuck databases, tables, columns, shares, and sample data, including which tables hold a given kind of data. Use first when a MotherDuck workspace or schema is unfamiliar.
Find and understand MotherDuck databases, tables, columns, shares, and sample data, including which tables hold a given kind of data. Use first when a MotherDuck workspace or schema is unfamiliar.

[Utility skill](/sql-reference/agent-skills/#utility-skills) · [View source on GitHub](https://github.com/motherduckdb/agent-skills/tree/v3.0.0/skills/motherduck-explore)

:::info

This page shows the skill's `SKILL.md`: the instructions a coding agent loads when a task matches the description above. To install every MotherDuck skill in Claude Code, Codex, Cursor, or Gemini CLI, see [Install MotherDuck Skills](/key-tasks/ai-and-motherduck/agent-skills/). To install only this skill with the [Skills CLI](https://github.com/vercel-labs/skills), run:

```bash
npx -y skills add motherduckdb/agent-skills --skill motherduck-explore --yes --global
```

:::

## Prerequisites

- An established MotherDuck connection (or an active MotherDuck MCP server)

## Default posture

- Start at the known catalog object; broaden to databases or shares only when the target is unknown.
- Prefer fully qualified `"database"."schema"."table"` names; they are required once more than one database or share is attached.
- Check shared databases before concluding that data is unavailable. A share with secure views can hide columns and rows: a missing column in an attached share may be policy, not schema drift.
- Use the MotherDuck MCP tools (`list_databases`, `list_tables`, `list_views`, `list_columns`, `list_macros`, `search_catalog`) when available because they return structured results faster than ad hoc SQL. Check `list_macros` before reimplementing logic; table and scalar macros often encode governed definitions.
- When MotherDuck MCP is available and the SQL answers a business question, call `get_query_guide` first, then read only the relevant Guide topics and validate their claims against the live schema. Follow `relatedGuides` returned by catalog tools when they govern the objects in scope.
- Record whether a share is filtered and whether an existing Dive is Draft, Ready, Endorsed, or Archived; these attributes change what downstream agents should trust or expect to see.
- Return a concise schema map with table grain, join keys, date columns, and likely measures before moving into modeling or dashboard work.

## Workflow

1. List databases in scope.
2. Load relevant Guide context, then list tables and views in the target database.
3. Inspect columns, types, nullability, and comments before writing queries.
4. Use targeted profiling or `SUMMARIZE` when ranges, cardinality, or null rates affect the answer; avoid broad scans for a catalog lookup.
5. Preview rows with `SELECT * ... LIMIT n` or `USING SAMPLE`; on wide tables these read only the row groups they need. Capture grain and join assumptions, and only then move into analytical SQL or modeling work.

## References

Read only the reference sections needed for the current task.

- Read [`references/EXPLORATION_PLAYBOOK.md`](https://github.com/motherduckdb/agent-skills/blob/v3.0.0/skills/motherduck-explore/references/EXPLORATION_PLAYBOOK.md) for the full SQL workflow, share discovery patterns, MCP tool guidance, and common exploration mistakes

## Related skills

Load related skills only for missing capabilities; reuse established context.

- [`motherduck-connect`](/sql-reference/agent-skills/motherduck-connect/) for session setup and authentication
- [`motherduck-query`](/sql-reference/agent-skills/motherduck-query/) for analytical SQL after the schema is understood
- [`motherduck-duckdb-sql`](/sql-reference/agent-skills/motherduck-duckdb-sql/) for DuckDB syntax patterns during exploration
- [`motherduck-share-data`](/sql-reference/agent-skills/motherduck-share-data/) for creating and consuming shares once shared datasets become part of the workflow
- [`motherduck-manage-guides`](/sql-reference/agent-skills/motherduck-manage-guides/) for reading or maintaining the context attached to discovered objects

## Files in this skill

The agent reads these files when the instructions above point to them.

- [`references/EXPLORATION_PLAYBOOK.md`](https://github.com/motherduckdb/agent-skills/blob/v3.0.0/skills/motherduck-explore/references/EXPLORATION_PLAYBOOK.md)

## Docs this skill draws on

- [Sharing concepts and overview](https://motherduck.com/docs/key-tasks/sharing-data/sharing-overview/)
- [DuckDB SQL](https://motherduck.com/docs/sql-reference/duckdb-sql-reference/)
- [query_rw](https://motherduck.com/docs/sql-reference/mcp/core/query-rw/)


---

## Docs feedback

MotherDuck accepts optional user-submitted feedback about this page at `GET https://motherduck.com/docs/api/feedback/agent`.
For agents and automated tools, feedback submission should be user-confirmed before sending.

URL-encode query parameter values and send a GET request:

```text
GET https://motherduck.com/docs/api/feedback/agent?page_path=%2Fsql-reference%2Fagent-skills%2Fmotherduck-explore%2F&page_title=motherduck-explore&text=<url-encoded user feedback, max 2000 characters>
```

Optionally append `&source=<url-encoded interface identifier>` such as `claude.ai` or `chatgpt`.

`page_path` and `text` are required; `page_title` and `source` are optional. Responses: `200 {"feedback_id": "<uuid>"}`, `400` for malformed query parameters, and `429` when rate-limited.
