Data Lineage Summary
This skill guides the agent in investigating and summarizing the Data Lineage
graph for a specific focal asset (Table-Level Lineage) or specific fields
(Column-Level Lineage). It provides an intuitive left-to-right walkthrough of
how data enters and leaves the asset, abstracting away complex node and link
details into plain English.
Prerequisites
This skill relies on the Google Cloud Data Lineage (Knowledge Catalog) MCP
Server for graph traversal. Ensure you can run search_lineage queries in
both upstream and downstream directions. For detailed connection configurations
and tool schemas, refer to MCP Usage.
Workflow Logic
1. Get Lineage
Fetch the lineage graph in both directions from the focal point (both upstream
and downstream) by making two separate calls to the MCP tool: one with
"direction": "UPSTREAM" and another with "direction": "DOWNSTREAM".
Location Strategy: You MUST use the read_url tool to fetch the
comprehensive list of locations dynamically from the provided
Knowledge Catalog Locations
link. To ensure cross-regional lineage is not missed, always verify the
current list of GCP regions using this link before populating the
locations array. You MUST populate the locations array with all
supported physical regions fetched from this link. You may optionally
additionally determine the asset's specific active region (using bq show
or gcloud storage ls).
Search Parameters: Use maxDepth = 10, maxResults = 5000 and
maxProcessPerLink = 10 as robust defaults when calling search_lineage.
For example, a DOWNSTREAM call should be formatted like this (expanding the
locations array as needed):
{
"parent": "projects/project_id/locations/us",
"locations": [
"us",
"us-central1",
"us-east1",
"us-west1",
"europe-west1",
"asia-northeast1"
],
"rootCriteria": {
"entities": {
"entities": [
{
"fullyQualifiedName": "bigquery:project.dataset.table"
}
]
}
},
"direction": "DOWNSTREAM",
"limits": {
"maxDepth": 10,
"maxResults": 5000,
"maxProcessPerLink": 10
}
}
Ensure you make a similar call with "direction": "UPSTREAM" to fetch the
upstream lineage.
Column-Level Lineage (CLL): The search_lineage tool can find all
Column-Level Lineage (CLL) by configuring the field array. If Table-Level
Lineage (TLL) is requested, configure the call to get CLL links along with
the TLL links by exploiting the "*" wildcard. For example:
"rootCriteria": {
"entities": {
"entities": [
{
"fullyQualifiedName": "bigquery:project.dataset.table",
"field": [
"*"
]
}
]
}
}
If evaluating a specific column, replace "*" with the specific column name
(e.g., "efficiency_score").
2. Summarize
Generate the summary using the prompt guidelines below.
- Persona: Act as an expert Data Lineage Analyst generating a concise,
easy-to-understand left-to-right walkthrough of the data flow.
- Structure & Flow: Start immediately with the summary text, structured as
follows:
- Overall Flow Type: State the inferred workflow type and data domain
(e.g., "This appears to be a Feature Engineering workflow...").
- Systems Overview: List the primary systems involved up front. If the
request is for Column-Level Lineage, you MUST explicitly declare that
the scope of the analysis is limited to the specified field up front.
- Upstream Lineage: Use the exact bold header
**Upstream Lineage:**.
Narrative must detail how data arrives at the focal asset, mentioning
key source systems, projects, and processing tasks (e.g., Spark on
Dataproc).
- Downstream Lineage: Use the exact bold header
**Downstream Lineage:**. Detail where data goes from the focal asset to final
consumer systems.
- Analysis Metadata: Display the parameters used for the API call to
provide transparency on the boundaries of the summary. The output must
contain:
- Locations Searched:
{list_of_locations_queried}
- Parent Location:
{parent_path}
- Depth Limit:
{maxDepth}
- Process per Link Limit:
{maxProcessPerLink}
- Tip for User: A prompt suggesting they can ask to rerun with
expanded locations (if not all were used) or depth.
- Granularity Constraints:
- Prioritize flows between Systems, Projects, and Datasets over individual
files/tables.
- You MUST explicitly list specific asset names (e.g., source tables,
intermediate views, consumer tables) if there are fewer than 5. Do not
just summarize counts if there are fewer than 5; name them explicitly.
Otherwise, if 5 or more, aggregate them by count (e.g., "5 GCS
buckets").
- Only mention counts for ultimate sources, final consumers, and
total assets.
- Do not repeat project names redundantly for every dataset if only one
project is involved.
- Tone: Avoid jargon and generic phrases like "There are distinct factual
points." Be direct and clear. The final output is Markdown.
3. Return the Summary
Return the final summarized output back to the user.
External Documentation
1---2name: datalineage-summary3description: Summarizes Google Cloud Data Lineage graphs to help users debug data quality issues and understand data provenance for BQ/GCS. Use when summarizing upstream and downstream data flows, and presenting complex lineage data as an intuitive Markdown report. Don't use for generic BigQuery queries, editing lineage relationships, or downstream deprecation. Don't use for downstream blast-radius impact analysis (use datalineage-bigquery-asset-impact-analysis skill instead).4---56# Data Lineage Summary78This skill guides the agent in investigating and summarizing the Data Lineage9graph for a specific focal asset (Table-Level Lineage) or specific fields10(Column-Level Lineage). It provides an intuitive left-to-right walkthrough of11how data enters and leaves the asset, abstracting away complex node and link12details into plain English.1314## Prerequisites1516This skill relies on the **Google Cloud Data Lineage (Knowledge Catalog) MCP17Server** for graph traversal. Ensure you can run `search_lineage` queries in18both upstream and downstream directions. For detailed connection configurations19and tool schemas, refer to [MCP Usage](references/mcp-usage.md).2021## Workflow Logic2223### 1. Get Lineage2425Fetch the lineage graph in both directions from the focal point (both upstream26and downstream) by making *two separate calls* to the MCP tool: one with27`"direction": "UPSTREAM"` and another with `"direction": "DOWNSTREAM"`.2829* **Location Strategy**: You **MUST** use the `read_url` tool to fetch the30 comprehensive list of locations dynamically from the provided31 [Knowledge Catalog Locations](https://docs.cloud.google.com/dataplex/docs/locations.md.txt)32 link. To ensure cross-regional lineage is not missed, always verify the33 current list of GCP regions using this link before populating the34 `locations` array. You **MUST** populate the `locations` array with all35 supported physical regions fetched from this link. You may optionally36 additionally determine the asset's specific active region (using `bq show`37 or `gcloud storage ls`).38* **Search Parameters**: Use `maxDepth = 10`, `maxResults = 5000` and39 `maxProcessPerLink = 10` as robust defaults when calling `search_lineage`.40 For example, a DOWNSTREAM call should be formatted like this (expanding the41 `locations` array as needed):4243 ```json44 {45 "parent": "projects/project_id/locations/us",46 "locations": [47 "us",48 "us-central1",49 "us-east1",50 "us-west1",51 "europe-west1",52 "asia-northeast1"53 ],54 "rootCriteria": {55 "entities": {56 "entities": [57 {58 "fullyQualifiedName": "bigquery:project.dataset.table"59 }60 ]61 }62 },63 "direction": "DOWNSTREAM",64 "limits": {65 "maxDepth": 10,66 "maxResults": 5000,67 "maxProcessPerLink": 1068 }69 }70 ```7172 Ensure you make a similar call with `"direction": "UPSTREAM"` to fetch the73 upstream lineage.7475* **Column-Level Lineage (CLL)**: The `search_lineage` tool can find all76 Column-Level Lineage (CLL) by configuring the `field` array. If Table-Level77 Lineage (TLL) is requested, configure the call to get CLL links along with78 the TLL links by exploiting the `"*"` wildcard. For example:7980 ```json81 "rootCriteria": {82 "entities": {83 "entities": [84 {85 "fullyQualifiedName": "bigquery:project.dataset.table",86 "field": [87 "*"88 ]89 }90 ]91 }92 }93 ```9495 If evaluating a specific column, replace `"*"` with the specific column name96 (e.g., `"efficiency_score"`).9798### 2. Summarize99100Generate the summary using the prompt guidelines below.101102* **Persona**: Act as an expert Data Lineage Analyst generating a concise,103 easy-to-understand left-to-right walkthrough of the data flow.104* **Structure & Flow**: Start immediately with the summary text, structured as105 follows:106 * **Overall Flow Type**: State the inferred workflow type and data domain107 (e.g., "This appears to be a Feature Engineering workflow...").108 * **Systems Overview**: List the primary systems involved up front. If the109 request is for Column-Level Lineage, you MUST explicitly declare that110 the scope of the analysis is limited to the specified field up front.111 * **Upstream Lineage**: Use the exact bold header `**Upstream Lineage:**`.112 Narrative must detail how data arrives at the focal asset, mentioning113 key source systems, projects, and processing tasks (e.g., Spark on114 Dataproc).115 * **Downstream Lineage**: Use the exact bold header `**Downstream116 Lineage:**`. Detail where data goes from the focal asset to final117 consumer systems.118 * **Analysis Metadata**: Display the parameters used for the API call to119 provide transparency on the boundaries of the summary. The output must120 contain:121 * **Locations Searched**: `{list_of_locations_queried}`122 * **Parent Location**: `{parent_path}`123 * **Depth Limit**: `{maxDepth}`124 * **Process per Link Limit**: `{maxProcessPerLink}`125 * **Tip for User**: A prompt suggesting they can ask to rerun with126 expanded locations (if not all were used) or depth.127* **Granularity Constraints**:128 * Prioritize flows between Systems, Projects, and Datasets over individual129 files/tables.130 * You MUST explicitly list specific asset names (e.g., source tables,131 intermediate views, consumer tables) if there are fewer than 5. Do not132 just summarize counts if there are fewer than 5; name them explicitly.133 Otherwise, if 5 or more, aggregate them by count (e.g., "5 GCS134 buckets").135 * Only mention counts for *ultimate sources*, *final consumers*, and136 *total assets*.137 * Do not repeat project names redundantly for every dataset if only one138 project is involved.139* **Tone**: Avoid jargon and generic phrases like "There are distinct factual140 points." Be direct and clear. The final output is Markdown.141142### 3. Return the Summary143144Return the final summarized output back to the user.145146## External Documentation147148- [Google Cloud Knowledge Catalog Data Lineage Documentation](https://docs.cloud.google.com/dataplex/docs/about-data-lineage.md.txt)149- [Use the Data Lineage MCP server](https://docs.cloud.google.com/dataplex/docs/use-lineage-mcp.md.txt)150- [Knowledge Catalog Data Lineage API Reference](https://docs.cloud.google.com/dataplex/docs/reference/data-lineage/rest.md.txt)