Skip to main content
Glama
SWITCHSCIENCE

mcp-micropython-bridge

micropython_read_lines

Read a specific range of lines from a text file on a MicroPython board, enabling partial file inspection without loading the entire file.

Instructions

MicroPython ボード上のテキストファイルを行単位で一部読み出す。

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

Returns: ok: 読み出しに成功したら True path: 対象ファイルパス start_line: 実際に使った開始行番号 line_count: 返した行数 content: 返したテキスト eof: 返却範囲がファイル末尾に達したら True error: エラー時のメッセージ

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
errorsNostrict
timeoutNo
encodingNoutf-8
max_linesNo
start_lineNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
eofYes
pathYes
errorYes
contentYes
line_countYes
start_lineYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It does disclose useful behavior: the timeout covers the entire code-send through Raw REPL return, and decoding is configurable via encoding/errors. It does not state that the operation is read-only, that a connection must be established, or what happens on decode/missing-file failure beyond the generic error field.

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?

The purpose sentence is front-loaded, followed by compact Args and Returns blocks where each line earns its place. The Returns block partially duplicates the existing output schema, which is mild waste but not disruptive.

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 6-parameter tool with no annotations, every input is documented and the return contract is spelled out, including eof semantics for continued reads. The remaining gap is sibling routing — nothing tells the agent why to pick this over head_lines/tail_lines or read_file.

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% and there are 6 parameters, so the description must compensate — and it does, defining each argument's meaning, including the critical detail that start_line is 1-based and that timeout is a total wall-clock budget. It adds real value over bare titles like 'Path' or 'Max Lines', though it omits default values already present in the schema.

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: partial line-based reading of a text file on a MicroPython board. The scope ('行単位で一部') is clearer than a generic file read, but it never names or differentiates itself from siblings like micropython_read_file, micropython_head_lines, or micropython_tail_lines, which overlap heavily.

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 statement of when to choose this over micropython_read_file, head_lines, or tail_lines, and no prerequisites such as an active connection or board-mounted file. The agent must infer the use case from the purpose line alone.

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