Skip to main content
Glama
sfncat
by sfncat

get_calls_in_method_by_method_full_name

Retrieve all function calls within a specified method to analyze code dependencies and security vulnerabilities during code review.

Instructions

Get the calls info by the method full name which the call is in the method

@param method_full_name: The full name of the method
@return: The calls info of the method

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
method_full_nameYes

Implementation Reference

  • The MCP tool handler for 'get_calls_in_method_by_method_full_name'. It sends a query to the Joern server using joern_remote and processes the response with extract_list to return a list of calls in the specified method.
    @joern_mcp.tool()
    def get_calls_in_method_by_method_full_name(method_full_name:str) -> list[str]:
        """Get the calls info by the method full name which the call is in the method
    
        @param method_full_name: The full name of the method
        @return: The calls info of the method
        """
        response = joern_remote(f'get_calls_in_method_by_method_full_name("{method_full_name}")')
        return extract_list(response)
  • server.py:95-106 (registration)
    Dynamically registers the tool by executing the code in server_tools.py, which applies the @joern_mcp.tool() decorator to the handler function.
    GENERATED_PY = os.path.join(SCRIPT_DIR, "server_tools.py")
    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()
  • Helper function joern_remote that sends the actual query to the Joern server and returns the stdout response, used by the tool handler.
    def joern_remote(query):
        """
        Execute remote query and return results
        
        Parameters:
        query -- The query string to execute
        
        Returns:
        Returns the server response stdout content on success
        Returns None on failure, error message will be output to stderr
        """
        data = {"query": query}
        headers = {'Content-Type': 'application/json'}
    
        try:
            response = requests.post(
                f'http://{server_endpoint}/query-sync',
                data=json.dumps(data),
                headers=headers,
                auth=basic_auth,
                timeout=timeout
            )
            response.raise_for_status()  
            
            result = response.json()
            return remove_ansi_escape_sequences(result.get('stdout', ''))
            
        except requests.exceptions.RequestException as e:
            sys.stderr.write(f"Request Error: {str(e)}\n")
        except json.JSONDecodeError:
            sys.stderr.write("Error: Invalid JSON response\n")
        
        return None
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It describes a read operation ('Get the calls info'), implying it's non-destructive, but doesn't specify aspects like data format, pagination, error handling, or dependencies (e.g., requires CPG to be loaded). For a tool with no annotation coverage, this leaves significant gaps in understanding its behavior and constraints.

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 brief and front-loaded with the main purpose, followed by parameter and return annotations. It avoids unnecessary fluff, but the phrasing 'which the call is in the method' is slightly awkward and could be clearer. Overall, it's efficient but could benefit from minor structural improvements for better readability.

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?

Given the complexity (a query tool with no annotations, no output schema, and 0% schema coverage), the description is incomplete. It doesn't explain what 'calls info' includes (e.g., list of calls, details), return format, or how it relates to sibling tools. For a tool in a server with many similar methods, more context is needed to ensure proper usage without trial and error.

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?

The description adds meaningful context for the single parameter 'method_full_name', explaining it as 'The full name of the method' to retrieve calls info from. Since schema description coverage is 0% (the schema only provides a title 'Method Full Name'), this compensates well by clarifying the parameter's purpose. However, it doesn't detail format (e.g., package.Class.method) or examples, leaving some ambiguity.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool retrieves 'calls info by the method full name which the call is in the method', which clarifies it fetches call information within a specified method. However, it's somewhat vague about what 'calls info' entails (e.g., call details, list of calls) and doesn't differentiate from siblings like 'get_method_callees' or 'get_method_callers', which might have overlapping purposes. The purpose is understandable but lacks specificity and sibling distinction.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, context (e.g., after loading CPG), or compare to sibling tools like 'get_method_callees' or 'get_method_callers', which could retrieve similar data. Without such guidance, an agent might struggle to select the correct tool among multiple options for call-related queries.

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

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