Skip to content

feat: add FMSR and utility catalog MCP tools#431

Open
ShuxinLin wants to merge 7 commits into
mainfrom
fix/catalog-csv-collection
Open

feat: add FMSR and utility catalog MCP tools#431
ShuxinLin wants to merge 7 commits into
mainfrom
fix/catalog-csv-collection

Conversation

@ShuxinLin

@ShuxinLin ShuxinLin commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR updates the FMSR scenario support path by expanding the FMSR MCP tools and adding catalog lookup tools to the utilities MCP server.

The goal is to give FMSR scenarios a catalog-backed tool surface for asset, sensor, and failure-mode context, while keeping generated FMSR reasoning separate from stored catalog/failure-mode reads.

Key changes:

  • Add CouchDB-backed FMSR failure-mode reads for the failure_mode collection.
  • Add FMSR tools to generate and persist failure modes when the stored list is missing or partial.
  • Rename the sensor-mapping flow around generated failure-mode/sensor relevancy while preserving compatibility for the existing mapping tool name.
  • Add utilities MCP catalog tools for sensor, asset, and failure-mode catalog lookups.
  • Add unit coverage for the FMSR tool behavior and utilities catalog queries.
  • Update data documentation for the standardized failure_code collection key.

Type of Change

  • New Benchmark Scenario (Industry/Asset type)
  • Evaluation Metric / Scorer
  • Agentic Orchestration Logic (ReAct, Plan-Execute, etc.)
  • Infrastructure / Tooling Improvement

Industry Relevance

FMSR scenarios depend on reliable failure-mode, sensor, and asset context. Moving those reads into catalog-backed MCP tools lets agents ground FMSR reasoning in benchmark data first, then use LLM generation only when stored failure-mode coverage is absent or explicitly partial.

Related Issues

  • Refs: N/A

Testing & Validation

  • Unit Tests: Not rerun while updating PR metadata. Relevant tests were added under src/servers/fmsr/tests/ and src/servers/utilities/tests/.
  • Scenario Validation: Not run as part of this PR metadata update.
  • Data Integrity: PR uses catalog/failure-mode benchmark data paths and synthetic sample rows; no sensitive industrial data is expected.

Current GitHub checks on the latest PR head are passing for DCO and secret scans (Gitleaks, TruffleHog).

Suggested local validation before merge:

uv run pytest src/servers/fmsr src/servers/utilities -v -k "not integration"
uv run pytest src/ -v -k "not integration"

Checklist

  • My code follows the project's Ruff formatting and linting rules.
  • I have performed a self-review of my code.
  • I have updated the documentation (README or /docs) accordingly.
  • I have signed off my commits (DCO).

@ShuxinLin ShuxinLin requested a review from DhavalRepo18 July 6, 2026 22:33

@DhavalRepo18 DhavalRepo18 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While adding a catalog, we should add

  1. A few sample files in the catalog
  2. Update the manifest file (defaults)
  3. revise the docs
  4. enrich the docs (doc string) for more information

ShuxinLin added 5 commits July 8, 2026 16:01
Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
Add one-row synthetic catalog samples and allowlist the new catalog CSV files.

Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
Add a failure_mode CouchDB collection config and a one-document synthetic FMEA sample. Inline the curated FMSR failure-mode mapping so the obsolete YAML data file can be removed.

Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
@ShuxinLin ShuxinLin force-pushed the fix/catalog-csv-collection branch from 82dbc9f to b6a44da Compare July 8, 2026 20:03
Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
@ShuxinLin ShuxinLin changed the title define catalog collection feat: add FMSR and utility catalog MCP tools Jul 8, 2026
Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>

@DhavalRepo18 DhavalRepo18 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I count not review the FMSR MCP Server need to change its doc string. ideally all tool information we should be getting from their tool so we shpould look how other servers are defined.

instructions="General utilities: read JSON files and get current date/time.",
instructions=(
"General utilities: read JSON files, get current date/time, and query "
"asset, sensor, and failure-mode catalog data from CouchDB."

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not Sure we need to say from CouchDB?

We should avoid referring CouchDB.

def get_sensor_catalog(
sensor: Optional[str] = None,
) -> Union[CatalogResult, ErrorResult]:
"""Return sensor catalog entries. Pass sensor for an exact sensor-name lookup."""

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also say what it will return> a list of all the sensor a machine can have? etc

@DhavalRepo18

Copy link
Copy Markdown
Collaborator

this one

instructions=(
    "Failure mode and sensor reasoning. get_failure_modes READS a class's (possibly partial) "
    "failure modes from CouchDB; generate_failure_modes GENERATES them via the LLM when the DB "
    "is missing or incomplete (exhaustive=false); add_failure_modes WRITES them back; "
    "generate_failure_mode_sensor_mapping GENERATES which sensors can detect each failure. "
    "Use the utilities MCP server for asset, sensor, and failure-mode catalog lookups."
),

@DhavalRepo18

Copy link
Copy Markdown
Collaborator

The docstring needs to be unified across all MCPs. The current docstring gives a hint on what to do. We keep the docstring clean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants