Skip to main content
Glama
systemsomicslab

ms-data-parser

library_load

Idempotent

Loads a reference mass spectral library and builds or reuses its SQLite store for library matching, resolving the source by ion mode or explicit file path.

Instructions

参照ライブラリを読み込み、照合用の SQLite store を構築(または既存キャッシュを 再利用)する。

解決順: file_path の明示 → ion_mode("positive" / "negative")に対応する 設定(環境変数 MSDIAL_MSP_POS / MSDIAL_MSP_NEG → lipidmix.local.toml の [library] msp_positive / msp_negative)→ データディレクトリの *_Loaded.msp2.dbs → 設定済みの極性(両方あれば ion_mode を求める)→ データディレクトリの *.msp。候補が 1 つに決まらなければ code 付きの エラー(MSP_AMBIGUOUS など)を返し、黙って選ばない。一度に保持する ライブラリは 1 つだけ——測定の極性に合わせて ion_mode を指定する。

初回の構築は大きな .msp(1 GB 級)で数分かかる。MCP のタイムアウトに当たる なら、手元で python -m metabolomix.library.store --ion-mode <極性> を 1 度 走らせておけば、以後はキャッシュを開くだけで済む。

library_match_feature の前提。別ライブラリへ切り替えると直近の照合結果 (library_plot_mirror が読む座標)は破棄する——古い照合を新ライブラリの 結果と取り違えないため。

rebuild=True はキャッシュを無視して構築し直す(元ファイルが壊れている 疑いがあるときなど)。通常は不要——store は元ファイルの sha256 をキーに キャッシュされるため、内容が変わらない限り再構築しない。

Input Schema

NameRequiredDescriptionDefault
rebuildNo
ion_modeNo
file_pathNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior1/5

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

Annotations declare `destructiveHint: false`, but the description explicitly says switching libraries discards the latest matching results (the coordinates read by `library_plot_mirror`) and that `rebuild=True` ignores and rebuilds the cache. Those are destructive state changes, contradicting the annotation that the tool performs additive updates.

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 length is justified by the tool's complex resolution logic and side effects, and the purpose is front-loaded. The resolution order and notes on timeout, caching, and `rebuild` are structured into useful, non-redundant blocks.

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

Completeness4/5

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

The description covers resolution behavior, ambiguity errors, timeout workarounds, cache keying, side effects, and its prerequisite relationship to `library_match_feature`. The only notable gap is that it does not describe the success return shape, though no output schema exists to define it either.

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%, so the description must carry parameter meaning. It defines `file_path` as an explicit override, `ion_mode` as selecting positive/negative polarity, and `rebuild` as bypassing the sha256-keyed cache to force reconstruction.

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 first sentence states a specific verb and resource: load a reference library and build or reuse the SQLite store used for matching. It also distinguishes the tool's role as a prerequisite for `library_match_feature`, so an agent can tell what it does without opening the schema.

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

Usage Guidelines5/5

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

The description gives an explicit resolution order across `file_path`, `ion_mode`, environment variables, TOML settings, cached DBs, and `.msp` files. It also explains when ambiguity produces an error, that only one library is held at a time, and when `rebuild=True` is appropriate versus unnecessary.

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