graph_analyseDatabase
Run four graph analyses—findRootObjects, connectedComponents, detectCycles, and bfsLevels—in one call with shared edge fetch to avoid multiple round-trips for database migration and dependency analysis.
Instructions
Composite graph analysis — runs findRootObjects, connectedComponents, detectCycles, and bfsLevels in a single MCP call with ONE shared edge fetch.
This tool eliminates the scalability bottleneck of serial MCP round- trips by combining four graph analyses that would otherwise require four separate tool calls, each independently fetching the same edge set from Teradata.
Performance vs individual tools:
1 SQL round-trip instead of 4 (shared edge fetch)
1 MCP response instead of 4 (eliminates stdio serialisation overhead)
Same algorithmic complexity (O(V+E) BFS, O(α·N) Union-Find, O(V+E) DFS)
In-memory edge sharing: all analyses operate on the same Python list
Use this for:
Full database migration readiness assessment
Pre-migration cycle + root + wave analysis in one call
Dashboard data population (all four analyses needed simultaneously)
Any workflow that would otherwise call 3+ individual graph tools
Arguments: container_pattern - str: CSV LIKE patterns for container scope. Supports wildcards (%) and CSV format. Examples: '%SALES%', '%SALES%,%FINANCE%', 'PROD_%'
CRITICAL: STRING type, not array.
CORRECT: container_pattern="%SALES%,%FINANCE%"
WRONG: container_pattern=["%SALES%", "%FINANCE%"]exclude_objects - str: CSV LIKE patterns to exclude. Default: '' (no exclusions)
top_n_roots - int: Number of top root objects (by downstream dependent count) to include in BFS wave analysis. Default: 4
max_depth_down - int: Maximum downstream BFS hops from roots. Default: 10
max_depth_up - int: Maximum upstream BFS hops from roots. 0 = skip upstream analysis. Default: 0
edge_repository - str: Edge repository view/table conforming to the Graph Edge Contract (Src_Container_Name, Src_Object_Name, Src_Kind, Tgt_Container_Name, Tgt_Object_Name, Tgt_Kind columns). Call graph_edgeContractDDL to generate one. Required parameter — no default.
Returns: ResponseType: single response containing all four analyses:
{ "root_objects": { "objects": [...], "summary": {...} }, "components": { "node_details": [...], "summaries": [...], "stats": [...] }, "cycles": { "details": [...], "summaries": [...], "stats": [...] }, "bfs_waves": { "nodes": [...], "cycle_candidates": [...], "summary": {...} }, "edge_stats": { "total_edges": N, "fetch_time_ms": N } }
Example calls:
Full analysis of Sales and Finance databases
handle_graph_analyseDatabase( conn=connection, container_pattern="%SALES%,%FINANCE%", edge_repository="MY_LINEAGE_DB.EdgeRepository" )
Single database family with top 8 roots
handle_graph_analyseDatabase( conn=connection, container_pattern="%FINANCE%", top_n_roots=8, edge_repository="MY_LINEAGE_DB.EdgeRepository" )
Exclude sandbox schemas
handle_graph_analyseDatabase( conn=connection, container_pattern="PROD_%,STAGE_%", exclude_objects="SANDBOX%,%.temp_%", edge_repository="MY_LINEAGE_DB.EdgeRepository" )
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| container_pattern | Yes | ||
| exclude_objects | No | ||
| top_n_roots | No | ||
| max_depth_down | No | ||
| max_depth_up | No | ||
| edge_repository | No |