Skip to main content
Glama
Teradata

Teradata MCP Server

Official
by Teradata

Base Tableaffinity

base_tableAffinity
Read-onlyIdempotent

Find tables that are frequently queried together in SQL, revealing natural JOIN relationships and data affinity patterns for a specified table.

Instructions

Identify which tables in a database tend to co-occur together in the same SQL queries, revealing natural JOIN relationships and data affinity patterns. Use when the user asks which tables are queried together, what tables are related to a specific table, or what tables are commonly used in the same workflows. For access frequency, query counts, or per-user access statistics, use base_tableUsage instead.

Arguments: database_name - Database name table_name - Table or view name persist - If True, materializes result as a volatile table and returns table name

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
persistNoIf True, materializes result as a volatile table and returns table name
table_nameYesTable or view name
database_nameYesDatabase name

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changedv0.2.1
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / database_name / description
      Added value: +"Database name"
    • removedInput schema / properties / database_name / title
      Removed value: -"Database Name"
    • removedInput schema / properties / obj_name
      Removed value: -{
      -  "title": "Obj Name",
      -  "type": "string"
      -}
    • addedInput schema / properties / persist
      Added value: +{
      +  "default": false,
      +  "description": "If True, materializes result as a volatile table and returns table name",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / table_name
      Added value: +{
      +  "description": "Table or view name",
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "database_name",
      -  "obj_name"
      -]New value: +[
      +  "database_name",
      +  "table_name"
      +]
  2. Changed1 schema field changedv1.0.0
    • removedInput schema / title
      Removed value: -"handle_base_tableAffinityArguments"
  3. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already establish read-only and idempotent behavior. The description adds useful context beyond that by explaining the persist option materializes a volatile table and returns its name. It does not contradict the annotations, since a volatile table is transient and does not imply a persistent mutation.

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 purpose, usage guidance, and sibling differentiation are all front-loaded and economically worded. The repeated argument list adds some redundancy with the schema but does not make the description bloated or hard to scan.

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?

For a tool with three parameters, no output schema, and a clear sibling distinction, the description covers what the tool does, when to use it, when not to use it, and the effect of the persist flag. Nothing needed for correct invocation or selection is missing.

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

Parameters3/5

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

Schema description coverage is 100%, so the input schema already fully documents all three parameters. The description's argument list essentially repeats the schema text ('Database name', 'Table or view name', 'If True, materializes result...') without adding new semantic detail, meeting but not exceeding the baseline.

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 opens with a specific verb ('Identify') and a precise resource ('tables that co-occur together in SQL queries'), making the tool's purpose immediately clear. It also distinguishes itself from sibling analysis tools by focusing on affinity/JOIN relationships rather than usage frequency.

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 explicitly states when to use this tool ('when the user asks which tables are queried together, what tables are related...') and names the exact alternative for different needs ('use base_tableUsage instead'). This gives an agent clear routing criteria without requiring schema inspection.

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