Skip to main content
Glama
cbxss
by cbxss

android_list_methods

List all methods of a Java class in an Android application to analyze its behavior and identify potential hooks for security testing.

Instructions

List methods of a Java class

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
class_nameYesFull class name (e.g., 'javax.crypto.Cipher')

Implementation Reference

  • The actual implementation of android_list_methods. It takes a class_name string, gets the Frida RPC API via get_api(), and calls android_hooking_get_class_methods with a timeout to retrieve the list of methods for the specified Java class.
    def android_list_methods(class_name: str) -> list[str]:
        """List methods of a Java class."""
        api = get_api()
        return with_timeout(lambda: api.android_hooking_get_class_methods(class_name))
  • Tool registration/schema definition for android_list_methods. Defines its name, description ('List methods of a Java class'), and input schema requiring a 'class_name' string parameter (e.g., 'javax.crypto.Cipher').
    Tool(
        name="android_list_methods",
        description="List methods of a Java class",
        inputSchema={
            "type": "object",
            "properties": {
                "class_name": {"type": "string", "description": "Full class name (e.g., 'javax.crypto.Cipher')"},
            },
            "required": ["class_name"],
        },
    ),
  • Dispatch registration in the call_tool function. Routes the 'android_list_methods' tool name to the android.android_list_methods() handler, passing the required 'class_name' argument from the request.
    elif name == "android_list_methods":
        return android.android_list_methods(arguments["class_name"])
  • The get_api() helper function used by android_list_methods. Retrieves the active Frida session's RPC API or raises an error if not connected.
    def get_api():
        """Get the current Frida RPC API or raise error."""
        fs = registry.get_active()
        if fs is None:
            raise RuntimeError("Not connected. Use 'connect' tool first.")
        if not fs.is_alive():
            registry.remove(fs.id)
            raise RuntimeError("Session disconnected unexpectedly. Use 'connect' to reconnect.")
        return fs.api
  • The with_timeout helper function used by android_list_methods. Wraps a function call with a ThreadPoolExecutor timeout to prevent hanging.
    def with_timeout(func, timeout=DEFAULT_API_TIMEOUT):
        """Run a function with a timeout. Raises TimeoutError if exceeded."""
        with ThreadPoolExecutor(max_workers=1) as executor:
            future = executor.submit(func)
            try:
                return future.result(timeout=timeout)
            except FuturesTimeoutError:
                raise TimeoutError(f"Operation timed out after {timeout}s")
Behavior2/5

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

No annotations are provided. The description does not disclose behavioral traits such as whether inherited methods are included, if only public methods are listed, or if the class must be loaded.

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?

The description is a single, concise sentence with no extraneous words. It is appropriately front-loaded but could be slightly expanded without losing conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists, and the description does not explain the return format (e.g., method names, signatures). Given the tool's simplicity, more context about the output would improve completeness.

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

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The parameter 'class_name' is fully described in the schema, and the tool description adds no additional meaning. With 100% schema coverage, baseline score of 3 is appropriate.

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?

The description explicitly states the tool lists methods of a Java class, using a specific verb and resource, and distinguishes itself from siblings like android_list_classes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives, nor any prerequisites or exclusions. The description provides no context for appropriate usage.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/cbxss/frida-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server