Skip to main content
Glama
renef-mcp
by Ahmeth4n

renef_interceptor

Replace or revert native functions in Android ARM64 libraries using Renef's Interceptor API, enabling hooking by symbol or offset and restoring original behavior when needed.

Instructions

Replace or revert a native function using Renef v0.4.0's Interceptor API.

  • action="replace": Replaces (lib_name, target) so the original never runs (unless invoked via NativeFunction inside the replacement callback). replacement can be an integer constant (e.g., "0", "1", "-1"), boolean ("true"/"false"), or a Lua function string ("function(args) return 0 end").

  • action="revert": Restores original bytes / GOT entry and removes the hook/replacement.

Args: action: "replace" or "revert" lib_name: Library name (e.g., "libnative.so", "libc.so") target: Hex offset (e.g., "0x1234") or export symbol name (e.g., "ptrace") replacement: (for "replace") Integer/bool constant or Lua function function(args) ... end caller: Optional caller library name for PLT/GOT replacement (e.g., "libapp.so")

Returns: JSON status

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": {
      "action": "<action>",
      "lib_name": "<lib_name>",
      "target": "<target>"
    },
    "name": "renef_interceptor"
  }
}

Input Schema

NameRequiredDescriptionDefault
actionYes
callerNo
targetYes
lib_nameYes
replacementNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries the full disclosure burden and does well: it states that a replacement suppresses the original unless re-entered through NativeFunction, and that 'revert' restores original bytes / the GOT entry and removes the hook. It omits operational context an agent would want — permission/root requirements, whether other threads are affected mid-execution, and the shape of the 'JSON status' response.

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?

A front-loaded one-line summary followed by per-action bullets and an Args block — exactly the right ordering for a two-mode tool. Some redundancy exists between the conceptual bullets and the Args list (both repeat the replacement formats), but nothing is genuinely wasteful.

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?

Return values need not be explained since an output schema exists, and the description covers modes, all parameters, and mutation side effects. The remaining gap is relational context: how this differs from and composes with the other hooking and native-call siblings, which matters for a five-parameter mutation tool in a crowded family.

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 do the work, and it documents all five parameters with concrete accepted formats: hex offsets like "0x1234" or export symbol names for target, library names for lib_name, and integer/boolean/Lua-function strings for replacement, plus caller's role in PLT/GOT replacement. It falls short by not giving an explicit allowed-value set for action (the schema has no enum) and not stating whether replacement is required or ignored for 'revert'.

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?

The opening sentence states a specific verb pair and resource: 'Replace or revert a native function using Renef v0.4.0's Interceptor API.' The two modes are immediately enumerated. It does not, however, distinguish itself from the sibling hooking tools (renef_hook_native, renef_hook_generate, renef_hook_java), so the agent cannot tell from the text alone which of these to call.

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?

Mode selection guidance is good: the definition explains what 'replace' does versus 'revert', and notes that the original is skipped unless invoked via NativeFunction. However, there is no guidance on when to pick this tool over renef_hook_native or renef_hook_generate, and no stated prerequisites (attach state, permissions, target process) before calling.

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