Skip to main content
Glama
renef-mcp
by Ahmeth4n

renef_exec

Execute Lua 5.4 code inside a target Android process to run hooks, memory reads, and instrumentation. Returns printed output plus exact compile or runtime errors.

Instructions

Execute single-line or multi-line Lua 5.4 code in the target process.

Uses Renef v0.4.0's framed protocol and safe quoting (no 64 KB limit, no temp files, safe with newlines, quotes, //, and ~). Returns printed output and exact Lua compile/runtime error messages.

IMPORTANT: Use Renef Lua API (hook, Interceptor, NativeFunction, Memory, Module, Process, Thread, Java, Jni, Syscall, OS, File, KCov, send), NOT Frida JS syntax. See renef://api-reference.

Args: lua_code: Lua code to execute in the target process timeout: Silence timeout in seconds (default: 30.0)

Returns: JSON object with ok, output, error, and any queued event hint

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": {
      "lua_code": "<lua_code>"
    },
    "name": "renef_exec"
  }
}

Input Schema

NameRequiredDescriptionDefault
timeoutNo
lua_codeYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.0

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does substantial work: it discloses the framed protocol, safe quoting for newlines/quotes/'//'/'~', no 64 KB limit, no temp files, and that errors are returned as exact Lua compile/runtime messages. The 'silence timeout' semantics and queued-event hint are useful behavioral detail. It stops short of stating that code runs with the target process's full privileges or that effects persist.

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?

Front-loaded with purpose, then protocol reliability notes, then the critical API-syntax warning, then compact Args/Returns blocks. No padding; even the protocol details preempt real failure modes (quoting, size limit).

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?

For a high-complexity arbitrary-code-execution tool it covers protocol behavior, error reporting, timeout semantics, and points to renef://api-reference for the API surface; an output schema exists so return values need not be spelled out. The main omission is the session prerequisite linking it to renef_attach.

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, and it does: lua_code is defined as code executed in the target process, and timeout is clarified as a 'silence timeout in seconds (default: 30.0)', which is a non-obvious semantic not visible in the bare number schema. Only two parameters, both addressed.

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?

States a specific verb and resource: execute Lua 5.4 code in the target process, with the key distinction that it runs Renef's Lua API rather than Frida JS. It does not contrast itself with the many specialized siblings (renef_hook_native, renef_mem_read, renef_java_call), so an agent must infer that this is the general-purpose escape hatch.

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?

Usage context is only implied: 'Execute ... in the target process' plus a warning to use Renef Lua API rather than Frida JS syntax. There is no explicit when-to-use-this-vs-a-specialized-tool guidance, no statement of prerequisites such as whether renef_attach must run first, and no exclusions.

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