Thermo Orbitrap (Instrument API)

v0.1.1
io.github.K-Dense-AI/labmcp-thermo-iapi Checked 1 day ago Published 2 months ago

MCP server adapter for Thermo Fisher Orbitrap mass spectrometers via the licensed Instrument API.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

get_connection_info Get Connection Info

Report which instrument is connected (identity, address, simulated or real), whether the server is read-only, and the active safety limits. Call this first.

get_command_log Get Command Log

Return the most recent raw commands sent to / replies received from the instrument (newest last). Useful for debugging and for recording what was done.

ParameterTypeDescription
limitinteger

reconnect Reconnect

Close and re-open the connection to the instrument (e.g. after it was power cycled or a cable was re-plugged).

get_instrument_status Get Instrument Status

Report the instrument model, IAPI service/instrument connection, system mode and state (On/Standby/Off; Running/ReadyToDownload/...), whether an acquisition can be paused or resumed, the IAPI licence where the API exposes it, requested readbacks, the latest scan status log (vacuum, source) and how many scans have arrived.

get_possible_scan_parameters Get Possible Scan Parameters

List the scan parameters this instrument accepts for custom and repeating scans (IScans.PossibleParameters): name, allowed range or choices, default and help. The set depends on the model, licence and Tune version.

ParameterTypeDescription
name_containsCase-insensitive name filter
refreshbooleanRe-read from the instrument instead of the cache

get_recent_scans Get Recent Scans

Return the most recent scans received from the instrument (oldest first), optionally only one MS order or one custom scan's access id: scan number, MS order, precursor m/z, AGC target, injection time and the most intense centroids. Scans only arrive in On mode.

ParameterTypeDescription
access_idOnly scans with this access id (-1 = system scans)
countintegerNumber of most recent matching scans
include_header_trailerbooleanInclude the raw header and trailer
max_centroidsintegerMost intense centroids to return per scan
ms_orderOnly scans of this MS order (1 = MS1)
save_pathOptional .csv path (must not exist yet): write all kept centroids of the returned scans

wait_for_scan Wait For Scan

Wait for the next scan that arrives after this call (optionally of one MS order, or the result of a custom scan by its access id) and return it. For a custom scan placed with submit_custom_scan, a result that arrived since it was placed is returned at once. Returns found=false after timeout_s if nothing matching arrived (e.g. the instrument is in Standby).

ParameterTypeDescription
access_idOnly scans with this access id (-1 = system scans)
include_header_trailerbooleanInclude the raw header and trailer
max_centroidsintegerMost intense centroids to return per scan
ms_orderOnly scans of this MS order (1 = MS1)
timeout_snumberLongest time to wait

start_acquisition Start Acquisition

Start an acquisition with the instrument's current settings (IAPI StartAcquisition), recording to a raw file. This consumes sample. The instrument must be On; an acquisition must not already be running. Stop it with stop_acquisition. scan_count and until_stopped acquisitions are cancelled automatically after max_acquisition_duration_s.

ParameterTypeDescription
mode *stringStop after duration_s, after scan_count scans, or only when stopped
comment
duration_sFor mode=duration
raw_file_pathRaw file to write on the instrument PC, e.g. D:\Data\run1.raw
sample_name
scan_countFor mode=scan_count

pause_acquisition Pause Acquisition

Pause the running acquisition (IAPI Pause). Fails if the instrument reports it cannot pause.

resume_acquisition Resume Acquisition

Resume a paused acquisition (IAPI Resume). Sample consumption continues.

stop_acquisition Stop Acquisition

Stop the running acquisition (IAPI CancelAcquisition), by default also cancelling custom and repeating scans, and optionally switch the instrument to Standby (switch back to On in Tune). Every step is attempted even if an earlier one fails; failures are reported.

ParameterTypeDescription
cancel_scansbooleanAlso cancel pending custom scans and the repeating scan
standbybooleanThen put the instrument in Standby

cancel_custom_scans Cancel Custom Scans

Cancel any pending custom scan and its processing delay (IAPI CancelCustomScan).

cancel_repeating_scan Cancel Repeating Scan

Cancel the repeating scan set with set_repeating_scan (IAPI CancelRepetition).

submit_custom_scan Submit Custom Scan

Place one custom scan to run next (IAPI CreateCustomScan/SetCustomScan); unset values fall back to the instrument's defaults. Every value is checked against PossibleParameters and the safety limits, and calls are rate-limited, before anything is sent. Fetch the result with wait_for_scan(access_id=running_number).

ParameterTypeDescription
activation_typeActivationType, e.g. HCD or CID
agc_targetAGCTarget (charges)
analyzerMass analyzer, e.g. Orbitrap or IonTrap (Tribrid)
collision_energyCollisionEnergy (normalized, %)
extra_parametersOther IAPI scan values by exact name (see get_possible_scan_parameters)
first_mass_mzFirstMass: scan range start (m/z)
isolation_width_mzIsolationWidth (m/z)
last_mass_mzLastMass: scan range end (m/z)
max_injection_time_msMaxIT: maximum injection time (ms)
microscans
orbitrap_resolutionOrbitrapResolution at m/z 200; must be an allowed value
polarityPolarity as the instrument lists it
precursor_mzPrecursorMass (m/z) for MSn/SIM
running_numberReported back as access_id (default: auto)
scan_descriptionScanDescription stored with the scan
scan_typeScanType, e.g. Full, SIM or MSn
single_processing_delay_snumberHold further custom scans this long (ICustomScan.SingleProcessingDelay)

set_repeating_scan Set Repeating Scan

Define or replace the scan the instrument repeats when no method or custom scan is running (IAPI CreateRepeatingScan/SetRepetitionScan). Values are validated like submit_custom_scan. Cancel with cancel_repeating_scan.

ParameterTypeDescription
activation_typeActivationType, e.g. HCD or CID
agc_targetAGCTarget (charges)
analyzerMass analyzer, e.g. Orbitrap or IonTrap (Tribrid)
collision_energyCollisionEnergy (normalized, %)
extra_parametersOther IAPI scan values by exact name (see get_possible_scan_parameters)
first_mass_mzFirstMass: scan range start (m/z)
isolation_width_mzIsolationWidth (m/z)
last_mass_mzLastMass: scan range end (m/z)
max_injection_time_msMaxIT: maximum injection time (ms)
microscans
orbitrap_resolutionOrbitrapResolution at m/z 200; must be an allowed value
polarityPolarity as the instrument lists it
precursor_mzPrecursorMass (m/z) for MSn/SIM
running_numberReported back as access_id (default: auto)
scan_descriptionScanDescription stored with the scan
scan_typeScanType, e.g. Full, SIM or MSn