Skip to main content
Glama
renef-mcp
by Ahmeth4n

renef_jni

Create, read, and measure Java strings via JNI, and delete global references to manage jstring or ART String pointers during Android instrumentation.

Instructions

Raw JNI string & reference helpers (Jni.* API — distinct from JNI.* return tags).

Actions:

  • new_string: Create a Java String from UTF-8 text -> Jni.newStringUTF(value) (returns ref pointer)

  • get_string: Read UTF-8 text from a jstring or raw ART String* pointer -> Jni.getStringUTF(ref)

  • string_length: Get UTF-16 character length of a jstring / ART String* -> Jni.getStringLength(ref)

  • delete_ref: Delete a JNI global reference -> Jni.deleteGlobalRef(ref)

Args: action: "new_string", "get_string", "string_length", or "delete_ref" value: UTF-8 string value (required for "new_string") ref: JNI reference / ART String* address (required for "get_string", "string_length", "delete_ref")

Returns: JSON object with JNI operation result

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>"
    },
    "name": "renef_jni"
  }
}

Input Schema

NameRequiredDescriptionDefault
refNo
valueNo
actionYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.0

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations at all, the description carries the full disclosure burden. It does add real value by mapping each action to its underlying Jni call, noting that new_string returns a ref pointer, and specifying that delete_ref targets global references. However, for a low-level memory/pointer tool it says nothing about failure modes — passing an invalid or stale pointer, crash risk, or ref lifetime/leak consequences — which is the behavior an agent most needs warned about.

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?

Excellent structure: a disambiguating one-liner, then an action-to-API mapping, then args, then returns. Every line earns its place and the most important information (what it is, and what distinguishes it) is front-loaded. The only near-redundancy is the Returns line, since an output schema already exists.

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?

Given an output schema exists, the description need not detail return values and doesn't over-invest there. It compensates well for 0% schema description coverage by documenting all three parameters and the action vocabulary. The remaining gap is behavioral: no mention of error output, invalid-pointer handling, or ref ownership rules for a tool whose misuse can crash the target process.

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% (fields are bare titles 'Ref', 'Value', 'Action'), so the description is doing all the work and largely succeeds. It enumerates the valid action strings, which the schema does not (no enum present), and states which parameter is required for which action. It loses a point for not specifying the ref format — hex address versus pointer string versus ART String* encoding — which matters for correct invocation.

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 line names the resource precisely (raw JNI string & reference helpers) and explicitly disambiguates it from the `JNI.*` return-tag convention, which is a real source of confusion. Each of the four actions is spelled out with the exact underlying `Jni.*` call, so an agent knows exactly what it is invoking. It stops short of a 5 because it never contrasts itself with adjacent siblings like renef_java_call or renef_native_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?

Usage is conveyed indirectly: each action line states its precondition (value required for new_string, ref required for the other three), which is enough to pick an action. There is no explicit when-to-use versus an alternative, and no guidance on when a raw JNI ref is preferable to the higher-level Java call tools. The boundary with sibling tools is left to inference.

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