Skip to main content
Glama
LGDiMaggio

Predictive Maintenance MCP Server

by LGDiMaggio

generate_pca_visualization_report

Creates an interactive PCA scatter plot to visualize vibration model predictions on test signals, highlighting healthy and anomalous segments for diagnostic validation.

Instructions

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

    Creates interactive scatter plot with:
    - 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.

    Requires the test signals loaded via load_signal() first; each
    signal's sampling rate comes from its stored metadata.

    Args:
        model_name: Name of trained model (e.g., 'bearing_health_model')
        test_signal_ids: Optional list of stored signal IDs to predict and visualize
        true_labels: Optional dict mapping signal_ids to true labels.
                    Format: {"real_test_baseline_3": "healthy",
                             "real_test_InnerRaceFault_vload_6": "faulty"}
                    When provided, legend shows both true and predicted labels for validation.
        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)

    Raises:
        FileNotFoundError: If the model does not exist.
        ValueError: If a signal_id is not loaded or has no sampling rate.

    Example (with validation):
        >>> generate_pca_visualization_report(
        ...     model_name="bearing_health_model",
        ...     test_signal_ids=["real_test_baseline_3", "real_test_InnerRaceFault_vload_6"],
        ...     true_labels={"real_test_baseline_3": "healthy",
        ...                  "real_test_InnerRaceFault_vload_6": "faulty"}
        ... )
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
model_nameYes
true_labelsNo
overlap_ratioNo
test_signal_idsNo
segment_durationNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

No annotations provided, but description fully discloses behavior: creates interactive scatter plot with color coding, hover details, and explains that labels are predictions. Lists exceptions and dependencies.

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

Conciseness5/5

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

Well-structured with sections, bullet points, Args/Returns/Raises/Example. Informative without being verbose. Every section earns its place.

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 5 parameters with no schema descriptions, the description covers all aspects: purpose, parameters, outputs, exceptions, dependencies, and example. Complete and actionable.

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 has no descriptions (0% coverage), so description adds high value by explaining each parameter clearly, including format for true_labels, defaults for segment_duration and overlap_ratio.

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?

Clearly states it 'Generate PCA visualization HTML report' and describes the plot content, distinguishing it from other report generation tools like generate_fft_report or generate_envelope_report.

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?

Provides context: requires test signals loaded via load_signal() first, and emphasizes that labels are model predictions. Includes example usage. Lacks explicit when-not-to-use, but still informative.

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