home / skills / dbt-labs / dbt-agent-skills / fetching-dbt-docs

fetching-dbt-docs skill

/skills/fetching-dbt-docs

This skill helps fetch and summarize dbt documentation by converting URLs to markdown, guiding page searches, and locating relevant topics.

npx playbooks add skill dbt-labs/dbt-agent-skills --skill fetching-dbt-docs

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
2.5 KB
---
name: fetching-dbt-docs
description: Use when fetching dbt documentation, looking up dbt features, or answering questions about dbt Cloud, dbt Core, or the dbt Semantic Layer
user-invocable: false
metadata:
  author: dbt-labs
---

# 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.

## Common Mistakes

| Mistake | Fix |
|---------|-----|
| Fetching HTML URL without `.md` | Always append `.md` to docs URLs |
| Searching llms-full.txt first | Search llms.txt index first, only use full docs if no results |
| Loading llms-full.txt entirely | Use the search script to filter, then fetch individual pages |
| Guessing page paths | Use llms.txt index to find correct paths |

Overview

This skill fetches and locates dbt documentation efficiently for agents and users. It leverages dbt's LLM-friendly markdown URLs and indexed lists to return clean .md pages and pinpoint relevant topics. The skill helps avoid common fetching mistakes and reduces unnecessary downloads of the full docs set.

How this skill works

The skill converts regular docs URLs to LLM-friendly markdown by appending .md, then fetches the page. It uses the llms.txt index to quickly find page titles and descriptions, and provides a search script to scan full docs only when the index has no matches. After locating pages, fetch commands target the .md URLs to retrieve clean markdown content.

When to use it

  • Fetching a specific dbt docs page as markdown
  • Looking up dbt Cloud, dbt Core, or dbt Semantic Layer features
  • Searching for relevant dbt docs topics or command references
  • Automating documentation lookups inside an agent workflow
  • Avoiding HTML scraping when you need clean LLM-friendly text

Best practices

  • Always append .md to any docs.getdbt.com URL before fetching
  • Search llms.txt first — it’s fast and contains titles and descriptions
  • Only search the full docs content when the index has no results
  • Use the provided search script to filter llms-full.txt rather than loading the entire file
  • When using the search script, optionally force a fresh download to bypass a 24-hour cache

Example use cases

  • Retrieve the run command reference: convert the URL to .../reference/commands/run.md and fetch it
  • Find pages about semantic models by searching llms.txt, then fetch matching .md pages
  • Use the search script to locate docs mentioning “incremental strategy” and fetch the relevant pages
  • Automate doc lookups inside an agent: query llms.txt for topic URLs, then fetch each .md page for summarization

FAQ

What if I fetch the HTML URL accidentally?

Always append .md to the path — fetching the HTML will return web markup instead of clean markdown for LLMs.

When should I search llms-full.txt instead of llms.txt?

Start with llms.txt; only use the full docs search when the index returns no relevant results or you need to search page body content.