Skip to main content
Glama
smk-h

embedded-mcp-toolkit

by smk-h

serial_uboot_state

Detect whether a serial session is in U-Boot or a system shell, then sync the session mark so command wrapping stays correct. Use set/clear to force the mark when auto-detection is out of sync.

Instructions

Query, detect, or force-set the U-Boot mark of a serial session. The mark decides serial_exec's marker wrapping (U-Boot sessions use plain style without subshell). Actions: 'detect' (default) — classify the live environment in two layers. Passive first (zero side effects): buffer-tail anchors only — U-Boot prompt, login prompt, kernel boot, autoboot countdown. Anything else (e.g. a bare '#' tail, ambiguous between Linux root shell and custom U-Boot prompts) falls through to an active two-step probe: 'printenv' (>=2 U-Boot env verify keys → U-Boot), then 'echo $$' (whole-line numeric PID → system; whole-line '$$' or 'Unknown command' → U-Boot). Conclusive results sync the mark automatically. WARNING: each probe consumes one line of input — do NOT detect while a command may still be running or waiting for interactive input (e.g. Y/N). 'set'/'clear' — force the mark when auto-detection is out of sync; 'status' — read the mark only, no device I/O.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionNodetect (default) = probe live environment and sync mark; set/clear = force mark; status = read mark only
session_idYesThe session ID returned by serial_open

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.3.0

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure, and it succeeds thoroughly. It distinguishes passive detection as zero side effects, discloses that each active probe consumes one line of input, warns about running a command, and notes that conclusive results sync the mark automatically. This is exactly the kind of side-effect transparency an agent needs for a probing tool.

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

Conciseness5/5

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

The description is front-loaded with a one-sentence purpose, then organized by action with the warning placed precisely where the side-effect risk occurs. Though it is long, every clause earns its place by conveying detection logic, side effects, or usage timing. There is no filler or repetition, and the structure makes the complex algorithm easy to follow.

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?

For a tool with no annotations and no output schema, the description is unusually complete: it covers the full detection algorithm, side effects, sync behavior, all four actions, and a safety warning. The only modest gap is that it never explicitly states the return value shape, such as what a detect result or status output looks like. This is minor because the mark concept is clear throughout, but an explicit return contract would make it fully complete.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds substantial meaning to the action parameter by defining each enum value in behavioral terms and explaining the two-step probe logic. The session_id parameter is already adequately described in the schema as the ID returned by serial_open, so no further detail is required. The added action semantics push this above baseline.

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?

The description opens with a specific verb phrase, 'Query, detect, or force-set the U-Boot mark of a serial session', and enumerates four concrete actions that map to the input schema. It clearly differentiates this tool from state-changing siblings like serial_enter_uboot and serial_exec by focusing on the mark state rather than entering or executing in a shell. There is no ambiguity or tautology.

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?

It gives explicit guidance for when to use each action: detect is the default and auto-syncs the mark, set/clear are for when auto-detection is out of sync, and status is read-only with no device I/O. It also provides a strong when-not by warning against detecting while a command may still be running or waiting for interactive input. The reference to serial_exec's marker wrapping gives the agent practical context for ordering calls.

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