Skip to main content
Glama

exec

Run MicroPython code on a connected board and capture its output, including prints and tracebacks. Stops any running program first, with a configurable timeout to prevent hangs.

Instructions

Run MicroPython code on the board and return its output (prints and tracebacks). When Thonny is open, the code appears in its shell highlighted as coming from the AI, exactly like a student typing it. Stops the program currently running first. timeout in seconds (default 10, max 300); on timeout the code is interrupted. For programs that loop forever (robots, sensor streams) use start + monitor.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
timeoutNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A5/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 and does so well: it discloses that it stops the currently running program, describes timeout behavior (interrupts on timeout), and explains how output is surfaced in Thonny. No contradictions.

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 concise and front-loaded with the core action, then adds necessary behavioral details and alternative routing. Every sentence earns its place, and it avoids redundant boilerplate.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool that runs code and returns output, the description covers the return behavior (prints and tracebacks), the interruption and timeout mechanics, the side effect of stopping the current program, and points to alternatives for infinite loops. Nothing essential is missing.

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

Parameters5/5

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

Schema coverage is 0%, but the description compensates fully: it explains `timeout` with default (10), max (300), and its effect (interruption), and `code` is self-explanatory from the context. Both parameters gain meaning beyond the schema.

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 (Run) and resource (MicroPython code on the board), and explicitly differentiates from siblings by noting that for long-running programs the user should use `start` + `monitor`. It also clarifies the output (prints and tracebacks), making the purpose unmistakable.

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?

Gives explicit when-to-use and when-not-to-use guidance: use for code that should run and finish, and for infinite loops route to `start` + `monitor`. It also notes the tool stops the currently running program first, which is a key contextual condition.

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