Skip to main content
Glama

spi_scan

Scan each SPI chip-select with JEDEC ID 0x9F to detect onboard NOR/NAND flash and decode manufacturer and capacity; other SPI devices need specific commands.

Instructions

逐条 CS 读 JEDEC ID(0x9F),找出板上挂的 SPI flash,并解出厂商与容量。

★ SPI 没有地址概念,所以「扫描」只能是「对每条 CS 发 0x9F」。因此本工具 只对遵守 0x9F 的 SPI NOR/NAND flash 有效;对 SPI 传感器 / ADC / 显示驱动 (各有自己的命令字)扫不出来是正常的,不是故障 —— 那种器件请用 spi_read_reg 给具体命令字。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
busNo
portNo
baudrateNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

No annotations are provided, so the description carries the burden. It discloses a critical behavioral trait not visible in structured data: the scan can only work by blasting 0x9F per CS because SPI has no addressing, so false negatives on non-flash devices are expected. It does not cover timing, baudrate effects, or error behaviour, but the false-negative caveat is unusually valuable.

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-loads the purpose in one line, then a clearly marked caveat block. Slightly verbose with the ★ framing, but every sentence adds actionable meaning and nothing is filler.

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

Completeness4/5

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

An output schema exists, so return values need no explanation. The description covers purpose, valid device class, failure semantics, and the alternative tool, leaving only parameter meaning as a gap.

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

Parameters2/5

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

Schema description coverage is 0% for 3 parameters, and the description never explains bus, port, or baudrate (e.g. what 'port' means for SPI, or how baudrate affects the 0x9F probe). The schema leaves these bare, so the description should have compensated and does not.

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

Purpose5/5

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

States a specific verb+resource+mechanism: it reads JEDEC ID (0x9F) on each CS line to find SPI flash and resolve vendor and capacity. It explicitly distinguishes itself from the sibling spi_read_reg, so an agent can route between them without opening a schema.

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

Usage Guidelines5/5

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

Explicit when-to-use (0x9F-compliant SPI NOR/NAND flash) and when-not (SPI sensors, ADCs, display drivers), including that a miss on those parts is normal rather than a fault, plus the concrete alternative spi_read_reg with its command-word requirement.

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