Skip to main content
Glama
LGDiMaggio

Predictive Maintenance MCP Server

by LGDiMaggio

generate_pca_visualization_report

Generate a PCA visualization HTML report to compare training and test data in 2D PCA space, highlighting model predictions with option to validate against true labels.

Instructions

    Generate PCA visualization HTML report showing training and test data in 2D PCA space.

    Creates interactive scatter plot with:
    - Training data (blue dots) - healthy baseline
    - Test/prediction data (green = predicted healthy, red = predicted anomaly)
    - PC1 vs PC2 axes with variance explained
    - Hover information showing segment details and prediction status

    **IMPORTANT**: Labels show MODEL PREDICTIONS, not ground truth. Use `true_labels`
    parameter to provide actual labels for validation visualization.

    **Strategy**: Same HTML report approach as FFT/Envelope/ISO reports.
    Saved to reports/ directory for LLM to reference without consuming tokens.

    Args:
        model_name: Name of trained model (e.g., 'bearing_health_model')
        test_signal_files: Optional list of signals to predict and visualize
        true_labels: Optional dict mapping signal filenames to true labels.
                    Format: {"baseline_3.csv": "healthy", "InnerRaceFault_vload_6.csv": "faulty"}
                    When provided, legend shows both true and predicted labels for validation.
        sampling_rate: Sampling rate (auto-detect from metadata if None)
        segment_duration: Segment duration in seconds (default: 0.1s for ML)
        overlap_ratio: Overlap ratio 0-1 (default: 0.5)
        ctx: MCP context

    Returns:
        Dictionary with file path, metadata, and summary (includes validation metrics if true_labels provided)

    Example (predictions only):
        >>> generate_pca_visualization_report(
        ...     model_name="bearing_health_model",
        ...     test_signal_files=["real_test/baseline_3.csv", "real_test/InnerRaceFault_vload_6.csv"]
        ... )

    Example (with validation):
        >>> generate_pca_visualization_report(
        ...     model_name="bearing_health_model",
        ...     test_signal_files=["real_test/baseline_3.csv", "real_test/InnerRaceFault_vload_6.csv"],
        ...     true_labels={"baseline_3.csv": "healthy", "InnerRaceFault_vload_6.csv": "faulty"}
        ... )
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
model_nameYes
test_signal_filesNo
true_labelsNo
sampling_rateNo
segment_durationNo
overlap_ratioNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/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 discloses that the tool creates an interactive scatter plot, saves to reports/ directory, and returns a dictionary with file path and summary (including validation metrics if true_labels provided). It does not mention side effects like overwriting, but it is sufficiently transparent for a report generation tool.

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 well-structured with sections: overview, bullet points, notes, args, returns, and examples. It is front-loaded with the main purpose. While slightly verbose, the organization compensates, and every section adds value.

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 complexity (6 parameters, no annotations, but output schema exists), the description is comprehensive. It explains the role of each parameter, provides usage examples, and describes the return value structure. The output schema reduces the need to detail return values, making the description sufficient for effective use.

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%, but the description fully explains each parameter in the 'Args:' block, including model_name, test_signal_files, true_labels, sampling_rate, segment_duration, and overlap_ratio. Examples illustrate usage, adding significant meaning beyond the empty schema properties.

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 clearly states the tool's purpose: 'Generate PCA visualization HTML report showing training and test data in 2D PCA space.' It specifies the plot components and distinguishes itself from sibling reports (FFT, Envelope, ISO) by noting it follows the same HTML report approach but focuses on PCA.

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

Usage Guidelines4/5

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

The description provides explicit guidance on using true_labels for validation, includes 'IMPORTANT' notes about model predictions, and gives examples. However, it does not explicitly state when to use this tool over other reports, though the context of sibling tools and the PCA-specific description imply its use case.

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/LGDiMaggio/predictive-maintenance-mcp'

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