Skip to main content
Glama
SWITCHSCIENCE

mcp-micropython-bridge

micropython_head_lines

Read the first lines of a text file on a MicroPython device to quickly check its contents without transferring the whole file.

Instructions

MicroPython ボード上のテキストファイル先頭の数行を返す。

Args: path: 対象ファイルパス lines: 返却する最大行数 timeout: コード送信から Raw REPL 復帰完了までの全体タイムアウト秒数 encoding: テキストデコードに使うエンコーディング errors: テキストデコード時のエラー処理

Returns: ok: 読み出しに成功したら True path: 対象ファイルパス content: 返したテキスト line_count: 返した行数 truncated: 返せなかった残り行があるとき True error: エラー時のメッセージ

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
linesNo
errorsNostrict
timeoutNo
encodingNoutf-8

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
pathYes
errorYes
contentYes
truncatedYes
line_countYes

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 exist, so the description carries the full behavioral burden. It does disclose useful traits like the truncated flag, error reporting, and the precise meaning of timeout (from code send to Raw REPL return), but it omits prerequisites such as needing an established connection to the board and any side effects or rate constraints.

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

Conciseness3/5

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

The Args/Returns structure is front-loaded and readable, but the Returns block largely restates fields already provided by the output schema, adding length without new information.

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?

Parameter coverage is adequate and the output schema exists so return fields needn't be re-described. However, for a board-interaction tool with no annotations, the description should mention connection prerequisites and how it relates to sibling read tools.

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 description coverage is 0%, so the description must compensate, and it largely does: it explains all five parameters, including the default-implied semantics of lines (max returned lines), timeout (whole-operation window ending at Raw REPL recovery), encoding, and errors handling. Only minor format details (e.g. valid encoding names) are missing.

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: returning the first N lines of a text file on a MicroPython board. It is a clear read operation, though it never explicitly distinguishes itself from close siblings such as micropython_read_lines, micropython_read_file, or micropython_tail_lines.

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?

No when-to-use guidance is given. With adjacent siblings like micropython_tail_lines, micropython_read_lines, and micropython_read_file, the description should say when head-of-file is the right choice, but it leaves that entirely to inference.

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