Skip to main content
Glama

i2c_write_reg

Write to I2C slave device registers, supporting hex, comma-separated, or array data, with optional readback verification to avoid false fails on write-only registers.

Instructions

写 I2C 从设备的寄存器。data 支持 "0x01" / "1,2" / [1,2]。

verify=True 会在写完后回读比对。★ 默认关:有些寄存器是只写的 (命令寄存器、软复位寄存器),回读必然拿到别的东西,默认开着会造成大量假 FAIL。

写操作受隔离层写权限门禁:只读档会被拒绝,并给出放开方式。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
busNo
regYes
addrYes
dataYes
portNo
verifyNo
baudrateNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses the verify readback side effect, the rationale for the default-off behavior, and an authorization gate (isolation-layer write permission) including what happens on rejection. It does not cover rate limits or what happens to the device on partial failure, but the mutation's safety profile and auth requirements are clearly surfaced.

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 core action, then data format, then verify semantics, then the permission note — a logical order with little waste. The ★ and bold emphasis markers add minor visual noise but each sentence carries information.

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-value explanation is unnecessary. The description covers the operationally significant behavior (verify, permission gating) for a mutation tool, with the main remaining gap being the undocumented peripheral parameters (bus/port/baudrate).

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 0% across 7 parameters, so the description must compensate. It adds real meaning for two of them — accepted data encodings ('0x01' / '1,2' / [1,2]) and verify's readback behavior — but bus, port, addr, reg, and baudrate remain entirely undocumented in both schema and description.

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 and resource (写 I2C 从设备的寄存器), which an agent can immediately distinguish from the sibling i2c_read_reg. The scope is unambiguous and does not depend on reading the schema.

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

Usage Guidelines4/5

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

Gives concrete guidance on when to enable verify (read-write vs write-only registers like command/soft-reset registers) and the consequence of defaulting it on. It also states the write-permission precondition (read-only profile gets rejected). It stops short of naming i2c_read_reg as the alternative for reads, so it is clear context rather than full when/when-not routing.

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