Skip to main content
Glama
SWITCHSCIENCE

mcp-micropython-bridge

micropython_exec

Execute multi-line Python code on MicroPython devices for testing or deployment. Returns stdout, stderr, and errors with a configurable timeout.

Instructions

MicroPython インタープリタで Python コードを実行する。 複数行のコードも実行できる。

Args: code: 実行する Python コード (複数行可) timeout: コード送信から Raw REPL 復帰完了までの全体タイムアウト秒数 (デフォルト 10秒)

Returns: ok: 実行に成功したら True stdout: 標準出力 stderr: 標準エラー出力 error: エラー時のメッセージ。成功時は None

Example: code = "import machine\nprint(machine.freq())"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
timeoutNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
errorYes
stderrYes
stdoutYes

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 bears the full burden, and it does disclose some useful behavior: the timeout spans the whole send-to-Raw-REPL-return cycle, and the return fields (ok/stdout/stderr/error) are spelled out. However, it says nothing about state persistence between calls, side effects on the device, or permission/environment requirements, which are important for an arbitrary-code-execution tool.

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 Args/Returns/Example structure is front-loaded and easy to scan, with each block earning its place. It is slightly verbose in restating return fields that an output schema already covers, but nothing is wasted or confusing.

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?

Given an output schema exists, the explicit Returns section is redundant but harmless; the description is otherwise complete enough to call the tool correctly. The one meaningful gap is the absence of any sibling routing against micropython_eval.

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 carry parameter meaning, and it does: 'code' is described as Python code that may be multi-line, and 'timeout' is precisely defined as the total seconds from send to Raw REPL return with a 10s default. This meaningfully compensates for the empty 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?

The description states a specific verb ('実行する' / execute) and resource ('MicroPython インタープリタで Python コード'), and notes multi-line support. It's clear what the tool does, but it never distinguishes itself from the sibling micropython_eval, which an agent could easily confuse with execution.

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?

There is no explicit when-to-use or when-not-to-use guidance, and no mention of when to prefer this over micropython_eval or micropython_reset. The only hint is a capability note ('multi-line code also supported'), which is not usage routing.

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