Skip to main content
Glama

get_method_callers

Identify methods that call a specified method in code by providing its fully qualified name. Useful for code review and security analysis in software development.

Instructions

Retrieves a list of methods that call the specified method

@param method_full_name: The fully qualified name of the source method(e.g., com.android.nfc.NfcService$6.onReceive:void(android.content.Context,android.content.Intent)) @return: List of full name, name, signature and id of methods called by the source method

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
method_full_nameYes

Implementation Reference

  • The handler function for the 'get_method_callers' MCP tool. It takes a method_full_name, sends a query to the Joern server via joern_remote, and returns the extracted list of callers using extract_list.
    @joern_mcp.tool() def get_method_callers(method_full_name: str) -> list[str]: """Retrieves a list of methods that call the specified method @param method_full_name: The fully qualified name of the source method(e.g., com.android.nfc.NfcService$6.onReceive:void(android.content.Context,android.content.Intent)) @return: List of full name, name, signature and id of methods called by the source method """ responses = joern_remote(f'get_method_callers("{method_full_name}")') return extract_list(responses)
  • server.py:96-106 (registration)
    Registers the 'get_method_callers' tool (and others) by dynamically executing the code in server_tools.py after initializing the FastMCP instance 'joern_mcp', allowing the @joern_mcp.tool() decorators to register the tools.
    def generate(): """Generate and execute additional server tools from server_tools.py file. This function reads the content of server_tools.py and executes it to add more functionality to the server. """ with open(GENERATED_PY, "r") as f: code = f.read() exec(compile(code, GENERATED_PY, "exec")) generate()
  • Input schema: method_full_name (str). Output: list[str] as documented in the docstring.
    def get_method_callers(method_full_name: str) -> list[str]: """Retrieves a list of methods that call the specified method @param method_full_name: The fully qualified name of the source method(e.g., com.android.nfc.NfcService$6.onReceive:void(android.content.Context,android.content.Intent)) @return: List of full name, name, signature and id of methods called by the source method """ responses = joern_remote(f'get_method_callers("{method_full_name}")') return extract_list(responses)

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/sfncat/mcp-joern'

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