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
| Name | Required | Description | Default |
|---|---|---|---|
| code_id | Yes |
Implementation Reference
- server_tools.py:108-116 (handler)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)
- server_tools.py:108-108 (registration)The @joern_mcp.tool() decorator registers the get_call_code_by_id function as an MCP tool.@joern_mcp.tool()
- server_tools.py:109-109 (schema)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: