Skip to main content
Glama

flipper_run_js

Run JavaScript on a Flipper Zero device and retrieve output. Supports inline code, local files, or existing scripts on the device.

Instructions

Run JavaScript on the device and return its output. Give inline source, a host local_path, or an existing device_path. Scripts use the mJS engine (firmware 1.0+) and reach modules for GPIO, UART, notifications, BadUSB, GUI and storage -- plus subghz, blebeacon, i2c, spi and usbdisk on Momentum. Use print() for output; it is sent to the CLI when run this way. Call flipper_js_probe to see which modules exist.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keepNoLeave the script on the device
nameNoName to store inline source under
portNoSerial port (e.g. COM7, /dev/ttyACM0). Omit when one Flipper is attached.
sourceNoInline JavaScript
timeoutNo
local_pathNoHost path to a .js file
device_pathNoScript already on the device
Behavior4/5

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

The description adds behavioral context beyond annotations by detailing the mJS engine, module availability, and that print() sends output to the CLI. Annotations already indicate non-destructive, but description enriches understanding.

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 (two sentences) and front-loaded with the core action and options, followed by engine/module details. No unnecessary words.

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?

The description explains the output (CLI via print()) and suggests flipper_js_probe for module probing. Without an output schema, it adequately covers return behavior, though error handling is not mentioned.

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?

With 86% schema coverage, the description adds meaning by explaining the three source options and output mechanism (print()), which the schema alone does not convey for timeout and the interaction between params.

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?

The description clearly states the tool runs JavaScript on the device and returns output, specifying three source options (inline, local_path, device_path). This distinguishes it from siblings like flipper_cli or flipper_launch_app.

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

Usage Guidelines4/5

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

The description explains how to provide source code and mentions the mJS engine and available modules, but does not explicitly state when not to use this tool or provide alternatives beyond referencing flipper_js_probe.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ReconGrunt/FlipperTalk'

If you have feedback or need assistance with the MCP directory API, please join our Discord server