Skip to content

Conversation

@Muizzkolapo
Copy link
Contributor

@Muizzkolapo Muizzkolapo commented Nov 27, 2025

What are you changing in this pull request and why?

This pr adds descriptions for a new mcp tools, get_lineage. The change is related to hhttps://github.com/dbt-labs/dbt-mcp/pull/484

To learn more about the writing conventions used in the dbt Labs docs, see the Content style guide.
-->

Checklist

@Muizzkolapo Muizzkolapo requested a review from a team as a code owner November 27, 2025 21:40
@vercel
Copy link

vercel bot commented Nov 27, 2025

@Muizzkolapo is attempting to deploy a commit to the dbt-labs Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added the content Improvements or additions to content label Nov 27, 2025
@Muizzkolapo Muizzkolapo changed the title add-get-lineage-desc Add description for get_lineage Too Nov 27, 2025
@Muizzkolapo Muizzkolapo marked this pull request as draft November 27, 2025 21:44
@Muizzkolapo Muizzkolapo reopened this Nov 28, 2025
@Muizzkolapo Muizzkolapo marked this pull request as ready for review November 28, 2025 21:40
@mirnawong1
Copy link
Contributor

hey @Muizzkolapo , thanks for opening this up! i'll close this pr up since i notice the pr dbt-labs/dbt-mcp#484 is closed. please let us know if we need to reopen it or if it was a mistake!

@mirnawong1 mirnawong1 closed this Jan 8, 2026
@Muizzkolapo
Copy link
Contributor Author

hey @Muizzkolapo , thanks for opening this up! i'll close this pr up since i notice the pr dbt-labs/dbt-mcp#484 is closed. please let us know if we need to reopen it or if it was a mistake!

@mirnawong1 no worries! new one is here dbt-labs/dbt-mcp#502, Just waiting for Devon's approval. I will raise a new pr on merge.

DevonFulcher added a commit to dbt-labs/dbt-mcp that referenced this pull request Jan 8, 2026
…502)

## Summary

A User building a catalog-like experience with dbt and Snowflake via
Claude Desktop requested full lineage capabilities
#110:

> "Get the full lineage of a model, not only its children/parents. To
parse the full lineage with the official MCP it would require quite a
few calls to the tool to parse through all layers, which would be nice
to get the server doing async instead providing the full list as a
return."

---


## What Changed

Added a new `get_lineage` tool that enables efficient lineage traversal
across all dbt resource types using the Discovery API's `lineage()`
endpoint.

### Key Implementation Details

**Query Approach:**
- Uses Discovery API's `lineage()` endpoint to fetch the entire lineage
graph in a single API call
- Requests minimal fields: `name`, `uniqueId`, `resourceType`, and
`parentIds`
- Pre-builds a children adjacency map for  descendant lookups

**Why Not Use Selector Syntax?**

The selector parameters (`select: "model+"`, `exclude: "test_*"`) does
not seem to be available in the public API:

## Test Case
<img width="1264" height="783" alt="image"
src="https://github.com/user-attachments/assets/ee045546-9979-48e2-b31a-7780f85c81e1"
/>


Search for any exposures:
<img width="1264" height="833" alt="image"
src="https://github.com/user-attachments/assets/8ba63f3d-cc99-4e7f-a63a-811881a6f847"
/>


## Why

Implementing to close #110

## Related Issues
<!-- Link any related issues using #issue_number -->
Closes ##110
Related to ##110


## Checklist
- [x] I have performed a self-review of my code
- [x] I have made corresponding changes to the documentation (in
https://github.com/dbt-labs/docs.getdbt.com) if required -- Mention it
here dbt-labs/docs.getdbt.com#8233
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] New and existing unit tests pass locally with my changes

## Additional Notes
<!-- Any additional information that would be helpful for reviewers -->






## Related Issues
<!-- Link any related issues using #issue_number -->
Closes #
Related to #


## Checklist
- [x] I have performed a self-review of my code
- [x] I have made corresponding changes to the documentation (in
https://github.com/dbt-labs/docs.getdbt.com) if required -- Mention it
here dbt-labs/docs.getdbt.com#8233
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] New and existing unit tests pass locally with my changes

## Additional Notes
<!-- Any additional information that would be helpful for reviewers -->

---------

Co-authored-by: Devon Fulcher <[email protected]>
@Muizzkolapo
Copy link
Contributor Author

Muizzkolapo commented Jan 8, 2026

#8403 @mirnawong1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

content Improvements or additions to content

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants