Skip to main content
Glama
Teradata

Teradata MCP Server

Official
by Teradata

plot_radar_chart

Generate radar charts from Teradata data to visualize relationships between specified labels and columns for comparative analysis.

Instructions

Function to generate a radar plot for labels and columns. Columns mentioned in labels are used as labels and column is used to plot.

PARAMETERS: table_name: Required Argument. Specifies the name of the table to generate the donut plot. Types: str

labels:
    Required Argument.
    Specifies the labels to be used for the line plot.
    Types: str

columns:
    Required Argument.
    Specifies the column to be used for generating the line plot.
    Types: str

RETURNS: dict

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
table_nameYes
labelsYes
columnsYes

Implementation Reference

  • Main handler function for the 'plot_radar_chart' tool. Validates that 'labels' is a string and delegates to get_radar_plot_json_data helper to generate and return the radar chart JSON data.
    def handle_plot_radar_chart(conn: TeradataConnection, table_name: str, labels: str, columns: str|List[str]):
        """
        Function to generate a radar plot for labels and columns.
        Columns mentioned in labels are used as labels and column is used to plot.
    
        PARAMETERS:
            table_name:
                Required Argument.
                Specifies the name of the table to generate the donut plot.
                Types: str
    
            labels:
                Required Argument.
                Specifies the labels to be used for the line plot.
                Types: str
    
            columns:
                Required Argument.
                Specifies the column to be used for generating the line plot.
                Types: str
    
        RETURNS:
            dict
        """
        if not isinstance(labels, str):
            raise ValueError("labels must be a string representing the column name for x-axis.")
    
        result = get_radar_plot_json_data(conn, table_name, labels, columns)
        return result
  • Supporting helper function that executes SQL query on the specified table, processes the data into Chart.js-compatible radar chart format with predefined colors, and wraps it in a response structure.
    def get_radar_plot_json_data(conn, table_name, labels, columns):
        """
        Helper function to fetch data from a Teradata table and formats it for plotting.
        Right now, designed only to support line plots from chart.js .
        """
        logger.debug(f"Tool: get_json_data_for_plotting")
        # Define the colors first.
        border_colors = [
            'rgb(255, 99, 132)',
            'rgb(54, 162, 235)',
            '#d7d0c4',
            '#fac778',
            '#e46c59',
            '#F9CB99',
            '#280A3E',
            '#F2EDD1',
            '#689B8A'
        ]
        background_colors = [
            'rgba(255, 99, 132, 0.2)',
            'rgba(54, 162, 235, 0.2)',
            'rgb(222, 232, 206, 0.2)',
            'rgb(187, 102, 83, 0.2)',
            'rgb(240, 139, 81, 0.2)',
            'rgb(255, 248, 232, 0.2)'
        ]
        point_background_color = [
            'rgba(255, 99, 132)',
            'rgba(54, 162, 235)',
            'rgb(222, 232, 206)',
            'rgb(187, 102, 83)',
            'rgb(240, 139, 81)',
            'rgb(255, 248, 232)'
        ]
    
        columns = [columns] if isinstance(columns, str) else columns
        sql = "select {labels}, {columns} from {table_name} order by {labels}".format(
              labels=labels, columns=','.join(columns), table_name=table_name)
    
        # Execute the SQL query
    
        # Prepare the statement.
        with conn.cursor() as cur:
            recs = cur.execute(sql).fetchall()
    
        labels = []
        datasets = [[] for _ in range(len(columns))]
        for rec in recs:
            labels.append(rec[0])
            for i_, val in enumerate(rec[1:]):
                datasets[i_].append(val)
    
        # Prepare the datasets for chart.js
        datasets_ = []
        for i, dataset in enumerate(datasets):
            datasets_.append({
                'label': columns[i],
                'data': dataset,
                'fill': True,
                "backgroundColor": background_colors[i % len(background_colors)],
                'borderColor': border_colors[i % len(border_colors)],
                "pointBackgroundColor": point_background_color[i % len(point_background_color)],
                "pointBorderColor": '#fff',
                "pointHoverBackgroundColor": '#fff',
                "pointHoverBorderColor": point_background_color[i % len(point_background_color)]
            })
    
        chart_data = {"labels": [str(l) for l in labels],
                      "datasets": datasets_}
        logger.debug("Chart data: %s", json.dumps(chart_data, indent=2))
    
        return create_response(data=chart_data, metadata={
                "tool_description": "chart js radar plot data",
                "table_name": table_name,
                "labels": labels,
                "columns": columns
            })
Behavior1/5

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

No annotations are provided, so the description carries full burden. It fails to disclose behavioral traits: it doesn't state whether this is a read-only operation, what permissions are needed, how the plot is generated (e.g., as an image file, displayed in UI, returned as data), error conditions, or any side effects. The description only repeats basic parameter info without adding operational context.

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

Conciseness3/5

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

The description is structured with sections for function, parameters, and returns, which is organized. However, it's inefficient: the first sentence is redundant with the name, and parameter descriptions are overly brief without adding value. It could be more concise by merging or eliminating repetitive parts while retaining essential details.

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

Completeness1/5

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

Given 3 parameters with 0% schema coverage, no annotations, and no output schema, the description is highly incomplete. It doesn't explain what the tool does beyond the name, lacks behavioral context, provides minimal parameter guidance, and offers no details on return values (only 'dict' without structure or content). This is inadequate for a plotting tool with multiple parameters.

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

Parameters2/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 compensate. It lists parameters with minimal semantics: 'table_name' specifies the table, 'labels' are for labels, and 'columns' are for plotting. This adds little meaning beyond parameter names, failing to explain what 'labels' and 'columns' represent (e.g., column names in the table, data values), their format, or how they interact. The description doesn't clarify that 'columns' can be a string or array per the schema.

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

Purpose2/5

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

The description states 'generate a radar plot for labels and columns' which is a tautology of the tool name 'plot_radar_chart'. It doesn't specify what data is visualized (e.g., statistical metrics, categories) or how the plot is rendered. While it mentions 'labels and columns', this is vague and doesn't distinguish it from sibling plotting tools like plot_line_chart or plot_pie_chart beyond the chart type name.

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

Usage Guidelines1/5

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

No guidance on when to use this tool versus alternatives. It doesn't mention when a radar chart is appropriate (e.g., for comparing multiple variables across categories) or when to choose other chart types like line or pie charts from the sibling list. There's no context about prerequisites, data requirements, or exclusions.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Teradata/teradata-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server