Skip to main content
Glama
blitzstermayank

Teradata MCP Server

plot_radar_chart

Generate radar charts to visualize multidimensional data relationships from Teradata tables using 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

  • The handler function implementing the core logic for the 'plot_radar_chart' tool. It validates that 'labels' is a string and calls the helper function to generate radar chart 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
  • Helper utility that executes SQL query on the specified table, processes the data into Chart.js compatible radar chart JSON format with predefined colors, and returns a structured response.
    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
            })
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It mentions the tool 'generates' a plot but doesn't disclose whether this creates a file, displays output, requires specific permissions, or has any side effects. The RETURN statement mentions 'dict' but doesn't explain what the dictionary contains or the format of the output.

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 relatively concise with clear sections (function, parameters, returns). However, the parameter descriptions contain contradictory information (mixing radar, donut, and line plot references) that creates confusion rather than clarity. The structure is organized but the content within sections is problematic.

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

Completeness2/5

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

For a 3-parameter tool with no annotations and no output schema, the description is insufficient. It doesn't explain the data source relationship (how table_name connects to labels/columns), the visualization output format, or any error conditions. The confusion between chart types in parameter descriptions makes the tool's behavior unclear.

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 but does so poorly. Parameter descriptions are confusing (referring to 'donut plot' and 'line plot' instead of radar plot) and don't clarify the relationship between labels and columns. The description doesn't explain how multiple columns (when provided as array) are handled or what data transformations occur.

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 the tool generates a radar plot for labels and columns, but it's vague about the specific action and resource. It mentions 'donut plot' and 'line plot' in parameter descriptions, creating confusion about the actual chart type. The purpose is not clearly distinguished from sibling tools like plot_line_chart or plot_pie_chart.

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 is provided on when to use this tool versus alternatives. The description doesn't mention any context, prerequisites, or comparisons with sibling plotting tools like plot_line_chart or plot_pie_chart. There's no indication of appropriate use cases or limitations.

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/blitzstermayank/MCP'

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