scope_reset
Reset the oscilloscope to factory defaults, clearing all waveforms, measurements, and settings. Use this to restore a clean baseline for new measurements.
Instructions
Reset the oscilloscope to factory defaults (*RST).
WARNING: This clears all waveforms, measurements and settings.
Transport: SCPI
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- server.py:478-486 (handler)The MCP tool handler for scope_reset. It calls _scope.reset() via the _run helper, sending the *RST SCPI command to reset the oscilloscope to factory defaults.
@mcp.tool() def scope_reset() -> str: """Reset the oscilloscope to factory defaults (*RST). WARNING: This clears all waveforms, measurements and settings. Transport: SCPI """ return _run(_scope.reset) - oscilloscope.py:418-419 (helper)The underlying LeCroyScope.reset() method that sends the '*RST' SCPI write command to the oscilloscope.
def reset(self) -> None: self.write("*RST") - server.py:126-140 (helper)The _run helper used by scope_reset to execute the reset under the VISA lock, catching errors.
def _run(fn): """Execute fn() under the VISA lock, catch errors, return a string Claude can read.""" with _visa_lock: try: result = fn() return str(result) if result is not None else "OK" except InstrumentError as e: return f"ERROR: {e}" except (SystemExit, KeyboardInterrupt): raise except BaseException as e: # Catch asyncio.CancelledError and any other non-fatal BaseException # so they don't propagate out and kill the server process. print(f"_run caught {type(e).__name__}: {e}", file=sys.stderr, flush=True) return f"ERROR ({type(e).__name__}): {e}" - server.py:39-43 (registration)FastMCP instance creation. The @mcp.tool() decorator on scope_reset (line 478) registers it as an MCP tool.
from mcp.server.fastmcp import FastMCP from oscilloscope import LeCroyScope, InstrumentError import docs as _docs mcp = FastMCP("lecroy-scope")