Skip to main content
Glama

get_call_code_by_id

Retrieve source code for a specific call node using its unique identifier from the loaded CPG, enabling targeted code review and analysis.

Instructions

Get the source code of a specific call node from the loaded CPG by the call id

@param id: The unique identifier of the call node, the id is a Long int string, like '111669149702L' @return: The source code of the specified call

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
code_idYes

Implementation Reference

  • The handler function for 'get_call_code_by_id' tool. It is decorated with @joern_mcp.tool(), which registers it as an MCP tool. The function takes a code_id (str), queries the Joern server using joern_remote, and returns the extracted source code of the call node.
    @joern_mcp.tool() def get_call_code_by_id(code_id:str) -> str: """Get the source code of a specific call node from the loaded CPG by the call id @param id: The unique identifier of the call node, the id is a Long int string, like '111669149702L' @return: The source code of the specified call """ response = joern_remote(f'get_call_code_by_id("{code_id}")') return extract_value(response)
  • The @joern_mcp.tool() decorator registers the get_call_code_by_id function as an MCP tool.
    @joern_mcp.tool()
  • Type hints define the input schema (code_id: str) and output (str), with detailed documentation in the docstring.
    def get_call_code_by_id(code_id:str) -> str:

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