Skip to main content
Glama
bitpirate-mcp
by Indigaz

spi_config

Sets the SPI pin map (MOSI, MISO, SCLK, CS, optional WP/HOLD) and clock frequency from 1–80 MHz, persisting the configuration in NVS.

Instructions

Set the SPI pin map (MOSI/MISO/SCLK/CS GPIO, frequency 1-80 MHz, optional WP/HOLD pins). NVS-persisted by the firmware. [allowed-write] [Duration: fast (~2-4 s).]

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": {
      "mosi": "<mosi>",
      "miso": "<miso>",
      "sclk": "<sclk>",
      "cs": "<cs>",
      "freq_mhz": "<freq_mhz>"
    },
    "name": "spi_config"
  }
}

Input Schema

NameRequiredDescriptionDefault
csYesCS GPIO
wpNoWP GPIO or -1
holdNoHOLD GPIO or -1
misoYesMISO GPIO
mosiYesMOSI GPIO
sclkYesSCLK GPIO
freq_mhzYesSPI clock 1-80 MHz

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.2/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It does add real behavioral context beyond a bare name: the [allowed-write] marker discloses a mutating operation, NVS persistence tells the agent the setting survives reboot, and the duration tag sets latency expectations. However, it omits whether the change applies immediately to an already-open bus, whether open_spi must be re-invoked, and what happens on invalid pin/frequency input.

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?

Two compact sentences with the core purpose front-loaded, followed by the persistence fact, then bracketed operational tags. Every element is relevant and nothing is padded. Minor redundancy in the tag block, but it stays scannable.

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 7-parameter mutation tool with no annotations and no output schema, the description covers purpose, scope, persistence, and latency, which is a reasonable floor. It still leaves gaps about effects on an active SPI session and error conditions, which matter for a configuration write.

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 description coverage is 100%, so every parameter is already self-documenting, making 3 the baseline. The description reinforces key semantics (frequency is 1-80 MHz, WP/HOLD are optional) but adds no format details, pin-validity constraints, or default behavior for the optional pins beyond what the schema states.

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?

The description gives a specific verb and resource ("Set the SPI pin map") and enumerates exactly what is configured: MOSI/MISO/SCLK/CS GPIO, frequency range, and optional WP/HOLD. An agent can distinguish it from data-path siblings like spi_transfer or spi_read. It does not name the sibling it complements (open_spi/close_spi), so sibling differentiation is implicit rather than stated.

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

Usage Guidelines2/5

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

There is no explicit when-to-use guidance, no prerequisites, and no named alternative. "NVS-persisted by the firmware" hints that this is a one-time persistent configuration that likely precedes open_spi, but the agent must infer that sequencing entirely. No when-not-to-use condition is given.

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