Skip to main content
Glama

run_custom_code

Execute arbitrary MicroPython code directly in ESP32 RAM over the CDC0 Raw REPL, with an optional timeout to abort long-running scripts.

Instructions

Execute arbitrary MicroPython code directly in ESP32 RAM via CDC0 Raw REPL.

Args: code: MicroPython source code string to execute. timeout: Maximum execution time in seconds before aborting (default: 10.0s).

Input Schema

NameRequiredDescriptionDefault
codeYes
timeoutNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/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 discloses that code runs directly in RAM and that timeout aborts execution, which is useful. However, it doesn't state whether execution is destructive, whether it can brick the device, what happens to existing state, or what the return format is (output schema exists but isn't referenced).

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?

Front-loaded with the key action and mechanism; the parameter notes are given in a compact docstring style. It is appropriately sized, though the 'Args:' section is slightly verbose for a two-parameter tool.

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?

An output schema exists, so return values needn't be explained. However, for a tool that executes arbitrary code on embedded hardware, the description omits important context: error behavior, security implications, or interaction with sibling console tools. It is adequate but missing safety-relevant completeness.

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. It documents both parameters: code as 'MicroPython source code string to execute' and timeout as 'Maximum execution time in seconds before aborting (default: 10.0s)'. This adds meaningful semantics beyond the bare schema titles.

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 (Execute) and resource (arbitrary MicroPython code) with a precise mechanism (ESP32 RAM via CDC0 Raw REPL), clearly distinguishing it from sibling tools like send_target_command or read_target_console.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains the 'how' but doesn't specify when to use this tool versus alternatives like send_target_command; no exclusions or prerequisites are stated. Usage context is implied but not explicit.

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