Skip to main content
Glama
ESP32 DevOps MCP Server
by JosephR26

esp32_spi_discovery

Probe an SPI device using named read profiles or component-safe probes, with required chip-select control, to identify attached hardware and detect degenerate MISO responses.

Instructions

STAGE 3-5 for SPI. Probes an SPI device using explicit, named profiles only — IDLE_READ (clocks 0xFF), ZERO_READ (clocks 0x00), JEDEC_ID (standard read-only 0x9F identification) — or the safe probes of a named component profile. Arbitrary command sequences are not supported by design. Returns raw bytes, hex, repeated patterns, protocol signatures, timing and confidence. All-0x00/all-0xFF responses are flagged as degenerate (a floating MISO line), not reported as data. A chip-select pin is REQUIRED — this tool never asserts an unspecified CS.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "cs": "<cs>"
    },
    "name": "esp32_spi_discovery"
  }
}

Input Schema

NameRequiredDescriptionDefault
csYesChip-select GPIO (REQUIRED)
txNoArbitrary bytes to clock out. Any values are accepted — this is the general-purpose path and needs no preset and no component profile. Supplying this suppresses the default presets.
misoNoMISO GPIO
modeNoSPI mode 0-3 (default: 0)
mosiNoMOSI GPIO
portNoSerial port (optional)
sclkNoSCLK GPIO
clockHzNoClock in Hz, 10000-40000000 (default: 1000000)
padByteNoFiller byte clocked out during the read phase (default: 0x00)
bitOrderNoBit order (default: MSB_FIRST)MSB_FIRST
profilesNoConvenience presets for common opening moves (default: ["IDLE_READ","ZERO_READ"] when no `tx` is given). These are shortcuts, not a restriction — use `tx` for anything else.
componentNoComponent profile id whose SPI safe probes should also run (optional)
timeoutMsNoRequest timeout in ms (optional)
readLengthNoExtra bytes to clock in after `tx`, filled with `padByte`
transactionSizeNoBytes per transaction, 1-256 (default: 4)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.3.0

TDQS

A3.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations supplied, the description carries the full burden and does real work: it discloses what is returned (raw bytes, hex, repeated patterns, protocol signatures, timing, confidence), how degenerate all-0x00/all-0xFF results are interpreted (floating MISO, not data), and that CS is always explicitly asserted. It omits safety framing such as whether probes are strictly read-only and what happens on timeout/failure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the stage marker and the operating constraint, then return-value and degenerate-response facts, all in a compact paragraph with no filler. The undefined 'STAGE 3-5' opener is the only piece that does not clearly earn its place for a reader without workflow context.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 15-parameter tool with no annotations and no output schema, the description usefully covers return contents, degenerate handling, and CS requirements. But the unresolved conflict between 'arbitrary command sequences are not supported' and the `tx` 'general-purpose path' parameter means an agent cannot confidently determine the supported input modes, which is the single most important thing to know before calling this tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already documents all 15 parameters and the baseline is 3. The description does add genuine meaning for the profile enum by explaining what each preset clocks (0xFF, 0x00, 0x9F read-only) and what the component profile path means, but its claim that arbitrary sequences are unsupported contradicts the schema's `tx` description of a 'general-purpose path' accepting any bytes, muddying rather than clarifying that parameter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Probes an SPI device') and enumerates the concrete probe profiles it supports (IDLE_READ, ZERO_READ, JEDEC_ID), which distinguishes it from the I2C and UART discovery siblings. The leading 'STAGE 3-5 for SPI' is unexplained workflow jargon, but the core purpose is unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives a usable exclusions statement ('Arbitrary command sequences are not supported by design') and a hard precondition ('A chip-select pin is REQUIRED'), which helps an agent decide when the tool applies. However, it names no alternatives (e.g. component_probe vs i2c_scan vs uart_discovery) and the stated restriction on arbitrary sequences directly conflicts with the schema's `tx` parameter, leaving the agent unsure which path is legitimate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.