Skip to main content
Glama
Teradata

Teradata MCP Server

Official
by Teradata

Graph Analysedatabase

graph_analyseDatabase
Read-onlyIdempotent

Runs root-object, connected-component, cycle, and BFS wave analyses in one call with a single shared edge fetch, reducing SQL round-trips from four to one for database lineage assessment.

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

TableJSON Schema
NameRequiredDescriptionDefault
top_n_rootsNo
max_depth_upNo
max_depth_downNo
edge_repositoryNo
exclude_objectsNo
container_patternYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.2.1

TDQS

A4.9/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations declare readOnlyHint=true and idempotentHint=true, and the description does not contradict them—it clearly describes a read-only composite analysis. Beyond the annotations, it discloses the internal execution (shared edge fetch, in-memory sharing), the exact return structure, and performance characteristics (1 SQL round-trip vs 4). It also details the critical type requirement for container_pattern (string not array), which is essential behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long but densely packed with essential information: purpose, performance rationale, use cases, parameter documentation, return structure, and examples. It is front-loaded with the composite nature and benefit. Minor redundancy exists in the performance bullet points and the examples, but every section earns its place. The use of headers and bullet lists improves scannability.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (composite of four analyses, 6 parameters, no output schema), the description is exceptionally complete. It explains the return structure with a concrete JSON example, provides three usage examples covering edge cases (exclusions, custom top_n_roots), and explicitly directs the user to graph_edgeContractDDL for the required edge_repository. The annotations cover read-only and idempotent behavior, leaving nothing critical unexplained for an agent to call the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must fully document parameters. It does: for each parameter it gives type, default, purpose, and examples, with explicit syntax guidance for container_pattern (wildcards, CSV format) and edge_repository contract. The description goes well beyond the schema by explaining the semantics of max_depth_up (0 = skip) and the required nature of edge_repository despite schema listing it with a default.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states the composite nature ('runs findRootObjects, connectedComponents, detectCycles, and bfsLevels in a single MCP call') and the key benefit of a shared edge fetch. It clearly identifies the resource (database lineage graph) and the specific analyses performed, distinguishing it from the individual sibling tools. The verb 'runs' and the enumeration of sub-analyses leave no ambiguity about what the tool does.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit 'Use this for' scenarios (migration readiness, pre-migration analysis, dashboard data population) and contrasts with individual tools by explaining the performance benefit of avoiding multiple calls. It implicitly tells the agent to prefer this tool when multiple analyses are needed simultaneously, and refers to sibling tools (e.g., graph_edgeContractDDL) for required edge_repository. This is strong guidance for selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.