Prompts
mcgpib provides 5 MCP prompts that encode domain knowledge about instrument initialization, troubleshooting, and measurement workflows. Prompts return structured step-by-step instructions that guide the LLM through multi-tool sequences, including fallback strategies for common failure modes.
initialize_bench
Section titled “initialize_bench”Connect to a bridge, scan the bus, and identify all instruments. Use this when setting up a test bench for the first time or after power cycling instruments.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
bridge_name | string | Yes | Name of the bridge to initialize |
Workflow
- Call
connect_bridgeto establish communication - Call
bus_scanto discover instruments - Note each instrument’s address and identity
- Summarize the bench setup (firmware version, instrument count, unidentified addresses)
Includes troubleshooting guidance for:
- Serial transport connection failures (USB cable, port permissions)
- TCP transport connection failures (WiFi, IP address, single-client limit)
- Empty bus scans (cable issues, instrument power, bus reset via
interface_clear)
When to use
At the start of any session, or after instruments have been added, removed, or power cycled.
Example
prompt = await client.get_prompt("initialize_bench", { "bridge_name": "bench-a"})troubleshoot_instrument
Section titled “troubleshoot_instrument”Systematic 6-step diagnostic sequence for a non-responsive instrument. Walks through bus connectivity, identification, status polling, error clearing, reset, and bus-level recovery.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
bridge_name | string | Yes | Name of the bridge |
address | integer | Yes | GPIB address of the problematic instrument |
Workflow
- Verify bus connectivity —
bus_scanwithidentify=falseto check if the address appears as a listener - Check identity —
instrument_identifyto test*IDN?support - Check status —
serial_pollto read the status byte (RQS, ESB, MAV bits) - Clear error state — Send
*CLS, then loopSYST:ERR?until0,No error - Reset if needed —
instrument_resetfollowed by re-identification - Bus-level recovery —
interface_clearandbus_clearas last resort
When to use
When an instrument stops responding to commands, returns unexpected data, or was working previously but has become unreliable.
Example
prompt = await client.get_prompt("troubleshoot_instrument", { "bridge_name": "bench-a", "address": 22})measurement_sequence
Section titled “measurement_sequence”Guide setup and capture of a specific measurement type. Covers instrument identification, configuration, triggering, reading, and validation.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
bridge_name | string | Yes | Name of the bridge |
address | integer | Yes | GPIB address of the measurement instrument |
measurement_type | string | Yes | Type of measurement (e.g., dc_voltage, frequency, resistance, ac_voltage, current_dc, 4wire_resistance) |
Workflow
- Identify the instrument — determine model and available SCPI commands
- Configure the measurement — send
CONF:*commands appropriate to the measurement type and instrument model - Trigger and read — either
READ?for single-shot or theINIT/FETCH?pattern for triggered measurements - Validate — check the returned value and instrument status byte
Includes a table of common SCPI configuration commands mapped to measurement types:
| Type | SCPI Pattern |
|---|---|
| DC Voltage | CONF:VOLT:DC [range],[resolution] |
| AC Voltage | CONF:VOLT:AC [range],[resolution] |
| Frequency | CONF:FREQ [range],[resolution] |
| Resistance | CONF:RES [range],[resolution] |
| 4-Wire Resistance | CONF:FRES [range],[resolution] |
| DC Current | CONF:CURR:DC [range],[resolution] |
When to use
When you need to take a specific measurement and want guidance on the correct command sequence for the instrument at hand.
Example
prompt = await client.get_prompt("measurement_sequence", { "bridge_name": "bench-a", "address": 22, "measurement_type": "dc_voltage"})bus_health_check
Section titled “bus_health_check”Full infrastructure health audit across all configured bridges. Checks every bridge’s connectivity, scans every bus, polls every instrument, and generates a consolidated health report.
Parameters
This prompt takes no parameters.
Workflow
- List all bridges — note connected vs. disconnected
- For each connected bridge — run
bus_scanwith identification,check_srq, andserial_pollfor all instruments - For each disconnected bridge — attempt
connect_bridgeand log results - Generate report — total bridges (configured, connected, failed), total instruments (discovered, identified, responding), SRQ assertions, error status bytes, and recommendations
When to use
Periodic health checks, morning bench setup verification, or after a power event that may have affected multiple instruments.
Example
prompt = await client.get_prompt("bus_health_check", {})scpi_command_help
Section titled “scpi_command_help”Instrument-specific SCPI command reference. Given a model identifier, provides the common measurement commands, status/error handling patterns, and any non-standard behavior notes.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
instrument_model | string | Yes | Model identifier (e.g., HP3478A, Keithley 2000, Agilent 34401A) |
Workflow
- Measurement commands —
CONF:*,SENS:*,TRIG:*,READ?,FETCH?,MEAS:*, range/resolution settings - Status and error handling — status byte bit assignments,
SYST:ERR?, event status register - Important notes — IEEE 488.2 compliance, non-standard GPIB behavior, typical timeout requirements, post-power-on initialization
When to use
When working with an unfamiliar instrument model, or when you need to go beyond basic MEAS:* commands.
Example
prompt = await client.get_prompt("scpi_command_help", { "instrument_model": "HP 34401A"})