Skip to content

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.


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

NameTypeRequiredDescription
bridge_namestringYesName of the bridge to initialize

Workflow

  1. Call connect_bridge to establish communication
  2. Call bus_scan to discover instruments
  3. Note each instrument’s address and identity
  4. 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"
})

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

NameTypeRequiredDescription
bridge_namestringYesName of the bridge
addressintegerYesGPIB address of the problematic instrument

Workflow

  1. Verify bus connectivitybus_scan with identify=false to check if the address appears as a listener
  2. Check identityinstrument_identify to test *IDN? support
  3. Check statusserial_poll to read the status byte (RQS, ESB, MAV bits)
  4. Clear error state — Send *CLS, then loop SYST:ERR? until 0,No error
  5. Reset if neededinstrument_reset followed by re-identification
  6. Bus-level recoveryinterface_clear and bus_clear as 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
})

Guide setup and capture of a specific measurement type. Covers instrument identification, configuration, triggering, reading, and validation.

Parameters

NameTypeRequiredDescription
bridge_namestringYesName of the bridge
addressintegerYesGPIB address of the measurement instrument
measurement_typestringYesType of measurement (e.g., dc_voltage, frequency, resistance, ac_voltage, current_dc, 4wire_resistance)

Workflow

  1. Identify the instrument — determine model and available SCPI commands
  2. Configure the measurement — send CONF:* commands appropriate to the measurement type and instrument model
  3. Trigger and read — either READ? for single-shot or the INIT / FETCH? pattern for triggered measurements
  4. Validate — check the returned value and instrument status byte

Includes a table of common SCPI configuration commands mapped to measurement types:

TypeSCPI Pattern
DC VoltageCONF:VOLT:DC [range],[resolution]
AC VoltageCONF:VOLT:AC [range],[resolution]
FrequencyCONF:FREQ [range],[resolution]
ResistanceCONF:RES [range],[resolution]
4-Wire ResistanceCONF:FRES [range],[resolution]
DC CurrentCONF: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"
})

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

  1. List all bridges — note connected vs. disconnected
  2. For each connected bridge — run bus_scan with identification, check_srq, and serial_poll for all instruments
  3. For each disconnected bridge — attempt connect_bridge and log results
  4. 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", {})

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

NameTypeRequiredDescription
instrument_modelstringYesModel identifier (e.g., HP3478A, Keithley 2000, Agilent 34401A)

Workflow

  1. Measurement commandsCONF:*, SENS:*, TRIG:*, READ?, FETCH?, MEAS:*, range/resolution settings
  2. Status and error handling — status byte bit assignments, SYST:ERR?, event status register
  3. 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"
})