Skip to main content
Glama
LGDiMaggio

Predictive Maintenance MCP Server

load_signal

Load vibration signal files into the repository, then reference them by signal_id for analysis, diagnosis, and reporting.

Instructions

Load one signal — or a batch — into the in-memory repository.

Once loaded, reference the signal by its signal_id in every analysis,
diagnosis, report, and prognostics tool (the load -> analyze ->
diagnose -> report flow uses signal_id as the single handle).

Batch form: pass a LIST of file paths (e.g. for training sets). The
batch is fail-fast and atomic — all paths and derived ids are
validated up front, and on the first problem ONE error names the
offending entries and nothing is loaded. One declared sampling_rate/
signal_unit applies to all files; per-file metadata wins only when
the parameter is omitted. Custom signal_id is not allowed for a
batch (ids derive from each file's relative path).

signal_id default: the path relative to data/signals/ with separators
replaced by underscores — 'real_train/baseline_1.csv' loads as
'real_train_baseline_1', so same-named files in different folders
never collide silently. Re-loading a path whose id already exists is
an explicit error unless overwrite=True.

Signal unit discipline: ISO 20816-3 severity verdicts require a
DECLARED unit — either via this parameter or a 'signal_unit' field in
the companion _metadata.json (explicit parameter wins). Units are
never guessed from signal amplitude; without a declared unit the ISO
severity block is refused with a structured reason and remedy.

Raw binary files (.bin/.raw/.dat): a headerless raw waveform loads
only with a declared decode contract — sample_format AND
sampling_rate are REQUIRED, either as explicit parameters here or as
fields of the companion <stem>_metadata.json next to the file
(explicit parameter wins). The other raw parameters carry documented
defaults, applied by the repository after that merge: byte_order
'little', n_channels 1, channel_index 0, header_offset 0, no
scale_factor. Integer sample formats (int16/int32) decode to raw ADC
counts — declare scale_factor to convert counts into the declared
physical unit (there is no implicit normalization). In a batch the
raw parameters broadcast to ALL files, exactly like sampling_rate.
Declaring raw parameters for a self-describing format (.csv, .npy,
...) is refused as a contradiction. With n_channels > 1 each load
extracts ONE channel and the DERIVED id gains a _ch<channel_index>
suffix; an explicit signal_id is used verbatim — no suffix applies.

Args:
    ctx: MCP context. Unused — see this module's docstring on logging.
    filepath: Filename relative to data/signals/ or absolute path —
        or a list of such paths for an atomic batch load.
    signal_id: Custom ID (single-file loads only; default derives
        from the relative path).
    sampling_rate: Sampling rate in Hz (overrides metadata file).
        Required for raw binary files (here or in the companion).
    signal_unit: Declared signal unit — 'g' or 'm/s2' (acceleration),
        'mm/s' or 'm/s' (velocity). Overrides the metadata file.
    overwrite: Replace existing entries on signal_id collision
        instead of raising.
    sample_format: Raw files only — declared sample dtype ('float32',
        'float64', 'int16', 'int32'). REQUIRED for .bin/.raw/.dat
        (here or in the companion metadata).
    byte_order: Raw files only — declared endianness ('little' or
        'big'); documented default 'little'.
    n_channels: Raw files only — interleaved channel count in the
        file; documented default 1.
    channel_index: Raw files only — 0-based channel to extract;
        documented default 0.
    header_offset: Raw files only — bytes to skip before the first
        sample; documented default 0.
    scale_factor: Raw files only — optional multiplier applied after
        decoding (e.g. ADC counts -> physical unit); default: no
        scaling.

Returns:
    StoredSignalInfo for a single load; a list of StoredSignalInfo
    (input order) for a batch. Raw loads record the effective decode
    parameters under raw_format.

Raises:
    ValueError: If signal_unit is invalid, the signal data cannot be
        loaded, a signal_id collides without overwrite=True, a batch
        contains any invalid entry (nothing is loaded), a raw binary
        file is missing a required declaration (ONE message names
        everything missing plus both remedies), or raw parameters
        are declared for a self-describing format.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filepathYes
overwriteNo
signal_idNo
byte_orderNo
n_channelsNo
signal_unitNo
scale_factorNo
channel_indexNo
header_offsetNo
sample_formatNo
sampling_rateNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed7 schema fields changedv0.13.0
    • addedInput schema / properties / byte_order
      Added value: +{
      +  "anyOf": [
      +    {
      +      "enum": [
      +        "little",
      +        "big"
      +      ],
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Byte Order"
      +}
    • addedInput schema / properties / channel_index
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Channel Index"
      +}
    • addedInput schema / properties / header_offset
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Header Offset"
      +}
    • addedInput schema / properties / n_channels
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "N Channels"
      +}
    • addedInput schema / properties / sample_format
      Added value: +{
      +  "anyOf": [
      +    {
      +      "enum": [
      +        "float32",
      +        "float64",
      +        "int16",
      +        "int32"
      +      ],
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Sample Format"
      +}
    • addedInput schema / properties / scale_factor
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "number"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Scale Factor"
      +}
    • addedOutput schema / $defs / StoredSignalInfo / properties / raw_format
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "EFFECTIVE raw-binary decode parameters (sample_format, byte_order, n_channels, channel_index, header_offset, scale_factor) after the explicit > companion > default merge — recorded as provenance so get_signal_info can answer 'how was this file decoded'. None for self-describing formats.",
      +  "title": "Raw Format"
      +}
  2. Changed18 schema fields changedv0.9.1
    • addedInput schema / properties / filepath / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": "array"
      +  }
      +]
    • removedInput schema / properties / filepath / type
      Removed value: -"string"
    • addedInput schema / properties / overwrite
      Added value: +{
      +  "default": false,
      +  "title": "Overwrite",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / signal_unit
      Added value: +{
      +  "anyOf": [
      +    {
      +      "enum": [
      +        "g",
      +        "m/s2",
      +        "mm/s",
      +        "m/s"
      +      ],
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Signal Unit"
      +}
    • addedOutput schema / $defs
      Added value: +{
      +  "StoredSignalInfo": {
      +    "description": "Metadata for a signal stored in the SignalRepository.",
      +    "properties": {
      +      "duration_s": {
      +        "anyOf": [
      +          {
      +            "type": "number"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Duration in seconds",
      +        "title": "Duration S"
      +      },
      +      "filepath": {
      +        "description": "Original file path",
      +        "title": "Filepath",
      +        "type": "string"
      +      },
      +      "load_timestamp": {
      +        "description": "ISO 8601 timestamp when signal was loaded",
      +        "title": "Load Timestamp",
      +        "type": "string"
      +      },
      +      "num_samples": {
      +        "description": "Number of samples",
      +        "title": "Num Samples",
      +        "type": "integer"
      +      },
      +      "sampling_rate": {
      +        "anyOf": [
      +          {
      +            "exclusiveMinimum": 0,
      +            "type": "number"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Sampling rate in Hz (must be positive when set)",
      +        "title": "Sampling Rate"
      +      },
      +      "shape": {
      +        "description": "Shape of the signal array",
      +        "items": {
      +          "type": "integer"
      +        },
      +        "title": "Shape",
      +        "type": "array"
      +      },
      +      "signal_id": {
      +        "description": "Unique identifier for the stored signal",
      +        "title": "Signal Id",
      +        "type": "string"
      +      },
      +      "signal_unit": {
      +        "anyOf": [
      +          {
      +            "enum": [
      +              "g",
      +              "m/s2",
      +              "mm/s",
      +              "m/s"
      +            ],
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "DECLARED signal unit — from load_signal(signal_unit=...) or the companion _metadata.json ('signal_unit' field). Never guessed. None means undeclared: ISO severity verdicts will be refused until the unit is declared.",
      +        "title": "Signal Unit"
      +      },
      +      "size_bytes": {
      +        "description": "Approximate memory size in bytes",
      +        "title": "Size Bytes",
      +        "type": "integer"
      +      },
      +      "source_metadata": {
      +        "additionalProperties": true,
      +        "description": "Complete companion _metadata.json of the source file (rpm/shaft_speed, reference frequencies, ...). Empty when the file has no companion metadata.",
      +        "title": "Source Metadata",
      +        "type": "object"
      +      }
      +    },
      +    "required": [
      +      "signal_id",
      +      "filepath",
      +      "load_timestamp",
      +      "shape",
      +      "num_samples",
      +      "size_bytes"
      +    ],
      +    "title": "StoredSignalInfo",
      +    "type": "object"
      +  }
      +}
    • removedOutput schema / description
      Removed value: -"Metadata for a signal stored in the SignalRepository."
    • removedOutput schema / properties / duration_s
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "number"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "description": "Duration in seconds",
      -  "title": "Duration S"
      -}
    • removedOutput schema / properties / filepath
      Removed value: -{
      -  "description": "Original file path",
      -  "title": "Filepath",
      -  "type": "string"
      -}
    • removedOutput schema / properties / load_timestamp
      Removed value: -{
      -  "description": "ISO 8601 timestamp when signal was loaded",
      -  "title": "Load Timestamp",
      -  "type": "string"
      -}
    • removedOutput schema / properties / num_samples
      Removed value: -{
      -  "description": "Number of samples",
      -  "title": "Num Samples",
      -  "type": "integer"
      -}
    • addedOutput schema / properties / result
      Added value: +{
      +  "anyOf": [
      +    {
      +      "$ref": "#/$defs/StoredSignalInfo"
      +    },
      +    {
      +      "items": {
      +        "$ref": "#/$defs/StoredSignalInfo"
      +      },
      +      "type": "array"
      +    }
      +  ],
      +  "title": "Result"
      +}
    • removedOutput schema / properties / sampling_rate
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "number"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "description": "Sampling rate in Hz",
      -  "title": "Sampling Rate"
      -}
    • removedOutput schema / properties / shape
      Removed value: -{
      -  "description": "Shape of the signal array",
      -  "items": {
      -    "type": "integer"
      -  },
      -  "title": "Shape",
      -  "type": "array"
      -}
    • removedOutput schema / properties / signal_id
      Removed value: -{
      -  "description": "Unique identifier for the stored signal",
      -  "title": "Signal Id",
      -  "type": "string"
      -}
    • removedOutput schema / properties / signal_unit
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "description": "Signal unit (g, mm/s, m/s², etc.)",
      -  "title": "Signal Unit"
      -}
    • removedOutput schema / properties / size_bytes
      Removed value: -{
      -  "description": "Approximate memory size in bytes",
      -  "title": "Size Bytes",
      -  "type": "integer"
      -}
    • changedOutput schema / required
      Previous value: -[
      -  "signal_id",
      -  "filepath",
      -  "load_timestamp",
      -  "shape",
      -  "num_samples",
      -  "size_bytes"
      -]New value: +[
      +  "result"
      +]
    • changedOutput schema / title
      Previous value: -"StoredSignalInfo"New value: +"load_signalOutput"
  3. First observedv0.8.0

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations, the description fully discloses behavioral traits: atomic batch fail-fast behavior, automatic signal_id derivation, overwrite semantics, raw decode contracts, unit declaration requirements, channel suffix behavior, and explicit refusal of raw params for self-describing formats. It also lists all exception conditions and return formats, providing complete transparency.

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?

The description is lengthy but appropriately so for a tool with 11 parameters, batch behavior, raw decoding, and complex edge cases. It is well-structured with clear paragraphs, an Args list, Returns, and Raises sections. The core purpose is front-loaded, and each sentence contributes meaningful information without redundancy.

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 tool's complexity and the lack of annotations or schema descriptions, the description is remarkably complete. It covers parameter semantics, return values, error scenarios, and the broader load->analyze->diagnose->report flow. The output schema exists but the description still explains StoredSignalInfo for single and batch loads, making it self-sufficient for correct invocation.

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?

Despite 0% schema description coverage, the description extensively documents every parameter: filepath for single or batch, signal_id custom vs derived, sampling_rate and signal_unit overrides, raw file parameters with defaults, and overwrite behavior. It explains relationships between parameters (e.g., raw parameters broadcast in batch) and provides context for each one, fully compensating for the missing schema descriptions.

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 explicitly states the tool's function: 'Load one signal — or a batch — into the in-memory repository.' It clearly distinguishes this from sibling tools like list_signals or get_signal_info by focusing on the loading operation and the subsequent flow of using signal_id. The verb 'load' and resource 'signal' are specific and unambiguous.

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 strong usage context: it explains that once loaded, the signal is referenced by signal_id in every analysis, diagnosis, report, and prognostics tool, positioning this tool as the entry point for data ingestion. It details batch usage, raw file handling, and metadata merging, making the when-to-use clear. However, it does not explicitly name sibling tools as alternatives or state when not to use this tool, which prevents a perfect score.

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

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