scope_disconnect
Disconnect from the LeCroy oscilloscope safely, with no errors if already disconnected.
Instructions
Disconnect from the oscilloscope. Safe to call even if not connected.
Transport: local
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- server.py:363-371 (handler)The scope_disconnect MCP tool handler. Calls _scope.disconnect() on the module-level LeCroyScope singleton and returns 'Disconnected.'
@mcp.tool() def scope_disconnect() -> str: """Disconnect from the oscilloscope. Safe to call even if not connected. Transport: local """ _scope.disconnect() return "Disconnected." - server.py:363-371 (registration)Registered as an MCP tool via @mcp.tool() decorator on the scope_disconnect function. Defined in server.py using FastMCP.
@mcp.tool() def scope_disconnect() -> str: """Disconnect from the oscilloscope. Safe to call even if not connected. Transport: local """ _scope.disconnect() return "Disconnected." - oscilloscope.py:239-251 (helper)The underlying LeCroyScope.disconnect() method called by the MCP tool handler. Closes VISA connection gracefully, resets internal state to defaults.
def disconnect(self) -> None: """Close VISA connection gracefully.""" for obj in (self._inst, self._rm): if obj: try: obj.close() except Exception: pass self._inst = None self._rm = None self._idn = None self._model = None self.profile = DEFAULT_PROFILE