# Fetching Dbt Docs

Retrieves and searches dbt documentation pages in LLM-friendly markdown format.

- Repository: https://github.com/dbt-labs/dbt-agent-skills (750 stars)
- Category: AI and agents
- License: Apache-2.0
- Last updated: 2026-10-29
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add dbt-labs/dbt-agent-skills --skill fetching-dbt-docs -g -a claude-code -y`
Codex: `npx skills add dbt-labs/dbt-agent-skills --skill fetching-dbt-docs -g -a codex -y`
Cursor: `npx skills add dbt-labs/dbt-agent-skills --skill fetching-dbt-docs -g -a cursor -y`
Gemini CLI: `npx skills add dbt-labs/dbt-agent-skills --skill fetching-dbt-docs -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add dbt-labs/dbt-agent-skills`

## Description

Retrieves and searches dbt documentation pages in LLM-friendly markdown format. Use when fetching dbt documentation, looking up dbt features, or answering questions about dbt Cloud, dbt Core, or the dbt Semantic Layer.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Fetch dbt Docs

## Overview

dbt docs have LLM-friendly URLs. Always append `.md` to get clean markdown instead of HTML.

## URL Pattern

| Browser URL | LLM-friendly URL |
|-------------|------------------|
| `https://docs.getdbt.com/docs/dbt-cloud-apis/service-tokens` | `https://docs.getdbt.com/docs/dbt-cloud-apis/service-tokens.md` |
| `https://docs.getdbt.com/reference/commands/run` | `https://docs.getdbt.com/reference/commands/run.md` |

## Quick Reference

| Resource | URL | Use Case |
|----------|-----|----------|
| Single page | Add `.md` to any docs URL | Fetch specific documentation |
| Page index | `https://docs.getdbt.com/llms.txt` | Find all available pages |
| Full docs | `https://docs.getdbt.com/llms-full.txt` | Search across all docs (filter by keyword first) |

## Fetching a Single Page

```
WebFetch: https://docs.getdbt.com/docs/path/to/page.md
```

Always add `.md` to the URL path.

## Finding Pages

### Step 1: Search the Index First

Use `llms.txt` to search page titles and descriptions:

```
WebFetch: https://docs.getdbt.com/llms.txt
Prompt: "Find pages related to [topic]. Return the URLs."
```

This is fast and usually sufficient.

### Step 2: Search Full Docs (Only if Needed)

If the index doesn't have results, use the script to search full page content:

The search script is located at `scripts/search-dbt-docs.sh` relative to this skill's base directory.

```bash
<SKILL_BASE_DIR>/scripts/search-dbt-docs.sh <keyword>

# Examples
<SKILL_BASE_DIR>/scripts/search-dbt-docs.sh semantic_model
<SKILL_BASE_DIR>/scripts/search-dbt-docs.sh "incremental strategy"
<SKILL_BASE_DIR>/scripts/search-dbt-docs.sh metric dimension  # OR search

# Force fresh download (bypass 24h cache)
<SKILL_BASE_DIR>/scripts/search-dbt-docs.sh metric --fresh
```

**Important:** Replace `<SKILL_BASE_DIR>` with the actual base directory path provided when this skill is loaded.


Then fetch individual pages with `.md` URLs.

## Handling External Content

The rest: https://github.com/dbt-labs/dbt-agent-skills/blob/HEAD/skills/dbt/skills/fetching-dbt-docs/SKILL.md
