feat(discovery): enrich get_lineage with description; remove get_model_parents/children#817
feat(discovery): enrich get_lineage with description; remove get_model_parents/children#817theyostalservice wants to merge 1 commit into
Conversation
…description get_lineage(depth=1) already covers the immediate-parent/child use case. Adding description to lineage nodes preserves the information that was available via the removed tools. Removes ~200 LOC of dead client code. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
4417bdf to
ad7ae8e
Compare
There was a problem hiding this comment.
Pull request overview
This PR reduces Discovery toolset overhead by removing the redundant get_model_parents / get_model_children tools and enriching get_lineage so it continues to provide description parity via the lineage node selection.
Changes:
- Added
descriptionto theGetFullLineageGraphQL selection and documented the new field in theget_lineageprompt. - Removed
get_model_parents/get_model_childrenfrom tool registration, enums/toolsets, GraphQL query constants, and integration tests. - Updated README + README mapping strings and added unit coverage to ensure the lineage query includes/preserves
description.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/discovery/test_lineage_fetcher.py | Adds unit tests asserting the lineage query selects description and that results preserve it. |
| tests/integration/discovery/test_discovery.py | Removes integration tests for the deleted parents/children fetcher methods. |
| src/dbt_mcp/tools/toolsets.py | Removes parents/children tools from the Discovery toolset mapping. |
| src/dbt_mcp/tools/tool_names.py | Removes tool name enum entries for parents/children. |
| src/dbt_mcp/tools/readme_mappings.py | Updates the human description for get_lineage to mention depth=1. |
| src/dbt_mcp/prompts/discovery/get_model_parents.md | Deletes the removed tool prompt. |
| src/dbt_mcp/prompts/discovery/get_model_children.md | Deletes the removed tool prompt. |
| src/dbt_mcp/prompts/discovery/get_lineage.md | Documents the new description field and positions depth=1 as the replacement. |
| src/dbt_mcp/discovery/tools.py | Removes tool definitions/registration for parents/children. |
| src/dbt_mcp/discovery/tools_multiproject.py | Removes multiproject tool definitions/registration for parents/children. |
| src/dbt_mcp/discovery/graphql/get_full_lineage.gql | Adds description to the lineage node selection. |
| src/dbt_mcp/discovery/client.py | Removes the parents/children GraphQL query strings and client fetch methods. |
| README.md | Updates the Discovery tool list to reflect the removal and depth=1 guidance. |
| .changes/unreleased/Enhancement or New Feature-20260622-103011.yaml | Adds a changelog entry describing the tool removal and lineage enrichment. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - `get_exposure_details`: Gets exposure details including owner, parents, and freshness status. | ||
| - `get_exposures`: Gets all exposures (downstream dashboards, apps, or analyses). | ||
| - `get_lineage`: Gets full lineage graph (ancestors and descendants) with type and depth filtering. | ||
| - `get_lineage`: Gets full lineage graph (ancestors and descendants) with type and depth filtering; use depth=1 to get immediate parents or children. |
| ToolName.GET_MODEL_HEALTH: "Gets health signals: run status, test results, and upstream source freshness.", | ||
| ToolName.GET_MODEL_PERFORMANCE: "Gets execution history for a model; option to include test results.", | ||
| ToolName.GET_LINEAGE: "Gets full lineage graph (ancestors and descendants) with type and depth filtering.", | ||
| ToolName.GET_LINEAGE: "Gets full lineage graph (ancestors and descendants) with type and depth filtering; use depth=1 to get immediate parents or children.", |
| - `description`: A description of the resource | ||
| - `parentIds`: List of unique IDs that this resource directly depends on | ||
|
|
||
| **Getting immediate parents or children:** use `depth=1`. This returns the target node plus its direct upstream dependencies and direct downstream dependents. |
There was a problem hiding this comment.
Agree with the above! get_lineage does not return parent or child but does both . Many references may need to be updated to make "or" --> "and". Or maybe we can update get_lineage to return either parents or children to maintain the "or".
| # Get only immediate parents and children (replaces get_model_parents / get_model_children) | ||
| get_lineage(unique_id="model.analytics.customers", depth=1) |
| - `description`: A description of the resource | ||
| - `parentIds`: List of unique IDs that this resource directly depends on | ||
|
|
||
| **Getting immediate parents or children:** use `depth=1`. This returns the target node plus its direct upstream dependencies and direct downstream dependents. |
There was a problem hiding this comment.
Agree with the above! get_lineage does not return parent or child but does both . Many references may need to be updated to make "or" --> "and". Or maybe we can update get_lineage to return either parents or children to maintain the "or".
There was a problem hiding this comment.
I feel this would be considered a breaking change? One of the examples actually (if you Ctrl + F for the deleted tools), actually refers to both get_model_parents and get_model_children in examples/ag2_agent/main_multiagent.py which is a solid case of potentially existing references to these tools that would break
cc @b-per thoughts here?
There was a problem hiding this comment.
Yes. Same as the other PR. This should be a breaking change. We need an approach to
- potentially move dbt-mcp to 2.x
- plan the steps required to keep the openai and anthropic apps working
Why
get_model_parentsandget_model_childrenare redundant withget_lineage(depth=1). Every registered tool name + description ships as context overhead on every turn; removing two tools reduces token cost for any harness using the Discovery toolset.get_lineagelacked thedescriptionfield that the parents/children tools returned per node, so we enrich it first to preserve information parity.What
descriptionto the lineage node selection inget_full_lineage.gqlso callers can read node descriptions without a separate details callget_lineage.mdprompt to document the new field and note thatdepth=1replaces the removed toolsget_model_parentsandget_model_childrentools, prompt files, GraphQL queries, and client methodsRefs
DI-4002
Drafted by Claude Opus 4.8 under the direction of @theyostalservice