Skip to main content
Glama
renef-mcp
by Ahmeth4n

renef_java_call

Call Java static methods, construct objects, or invoke/release instance handles with JNI-style signatures for Android Java instrumentation and reverse engineering.

Instructions

Call a Java static method, construct an instance, or call/release a boxed JavaObject.

Uses Renef v0.4.0's Java.use(class):call(...) / :new(...) and instance handles.

Examples:

  • Static call: class_name="java/lang/System", method_name="currentTimeMillis", signature="()J"

  • Constructor: class_name="java/io/File", constructor=True, signature="(Ljava/lang/String;)V", args=["/data/local/tmp"]

  • Instance call: instance_handle=1, method_name="exists", signature="()Z"

  • Release handle: instance_handle=1, release=True

Args: class_name: Java class name (dots or slashes accepted; required unless instance_handle > 0) method_name: Method name (required unless constructor=True or release=True) signature: JNI method/constructor signature (e.g., "()Ljava/lang/String;", "(Ljava/lang/String;)V") args: Optional argument list (strings, ints, bools, floats, or None) constructor: If True, constructs a new instance via :new(signature, ...) instance_handle: Existing JavaObject handle returned by a previous call/constructor release: If True with instance_handle > 0, releases the target-side JNI reference timeout: RPC timeout in seconds (default: 30.0)

Returns: JSON object with the return value (or {handle, raw_hex} for returned Java objects)

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "renef_java_call"
  }
}

Input Schema

NameRequiredDescriptionDefault
argsNo
releaseNo
timeoutNo
signatureNo()V
class_nameNo
constructorNo
method_nameNo
instance_handleNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.0

TDQS

A4/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 behavioral burden. It does disclose the timeout default (30s), the return shape for object returns ({handle, raw_hex}), and, usefully, that release frees the target-side JNI reference — the one clearly destructive action. It does not say whether unreleased handles leak, whether invoking arbitrary methods can mutate app state, or what authorization/attach state is required, which are meaningful gaps for a mutation-capable tool with zero annotation coverage.

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 one-line purpose, then examples, then a structured Args list and Returns line — easy to scan. There is mild redundancy between the examples and the Args section (e.g. signature and constructor are explained twice), but each part remains useful and nothing is padded.

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 an eight-parameter, unannotated tool this is close to complete: all parameters are explained, the four invocation modes are shown, and return format is stated (with an output schema also present). The remaining gap is lifecycle/error behavior — what happens on signature mismatch, whether handles must be released, and permission or attach prerequisites.

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

Parameters5/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 all parameter meaning — and it does, documenting all eight parameters in the Args block with types, defaults, and conditional requirements (e.g. class_name required unless instance_handle > 0; method_name required unless constructor or release; release requires instance_handle > 0). The signature format is shown with JNI examples, adding information the bare schema string default does not convey.

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 names a specific verb set (call a static method, construct an instance, call/release a boxed JavaObject) and the resource (Java methods/handles), and the four examples make the modes concrete. It stops short of naming a sibling such as renef_native_call or renef_java_method_info, so the Java-vs-native boundary is left implicit.

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 examples effectively give when-to-use guidance for each mode: static call, constructor, instance call, and release, each with the exact parameter combination. What is missing is guidance on prerequisites — e.g. where to obtain signatures (renef_java_method_info) or when to prefer a native call instead — and there are no explicit when-not-to-use statements.

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