Skip to main content
Glama

flipper_js_run

Destructive

Run JavaScript programs on a Flipper Zero via the mJS engine and get the script output back, enabling on-device automation of GUI, GPIO, serial, storage, notifications and BadUSB.

Instructions

Run a JavaScript program on the Flipper (mJS engine) and return its output. Full on-device automation: gui, gpio, serial, storage, notify, badusb, etc. The script is written to /ext/.tmp and executed with the js command.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "script": "<script>"
    },
    "name": "flipper_js_run"
  }
}

Input Schema

NameRequiredDescriptionDefault
scriptYes
timeoutNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, openWorldHint=true, and idempotentHint=false, so the risk profile is carried structurally. The description adds genuine context beyond that: the script is persisted to /ext/.tmp and executed via the `js` command, which tells the agent about a filesystem side effect and the execution mechanism. It does not warn that arbitrary JS can touch storage or hardware, nor how timeout expiry is handled.

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?

Three short sentences, front-loaded with purpose, then capability scope, then implementation detail; nothing is padded. 'etc.' at the end of the capability list is the only loose note.

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 need not be described. But for an arbitrary-code-execution tool with destructive/openWorld annotations and 0% schema coverage, the definition omits timeout semantics, whether `script` is source or path, and what failure or timeout looks like — gaps an agent would need filled before calling safely.

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

Parameters2/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 largely does not. 'The script is written to /ext/.tmp' leaves ambiguous whether `script` is inline source code or a path, and the `timeout` parameter (default 60) is never mentioned, leaving its units, bounds, and effect on execution undocumented.

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 and resource ('Run a JavaScript program on the Flipper'), names the engine (mJS) and the underlying `js` command, and scopes capability to on-device automation domains. This clearly distinguishes it from siblings like flipper_run_cli (shell) and flipper_badusb_run (BadUSB payloads).

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 capability list ('gui, gpio, serial, storage, notify, badusb') implies when this tool is appropriate, but there is no explicit when-to-use/when-not guidance and no named alternative such as flipper_run_cli for non-JS tasks. The agent must infer the boundary between this and the CLI tool.

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