get_function_definition
Retrieve function details by name to analyze binary code structure and behavior for reverse-engineering tasks.
Instructions
Get details of a specific function definition by name.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"name": "<name>"
},
"name": "get_function_definition"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes |
Implementation Reference
- main.py:126-133 (handler)Handler function that retrieves the details of a specific function definition by name from the loaded Ghidra context JSON. Returns the definition dict or an error.
async def get_function_definition(name: str) -> dict: """Get details of a specific function definition by name.""" if not ctx_ready: return {"error": "Context not ready. Run `setup_context()` first."} for f in ctx.get("data_types", {}).get("function_definitions", []): if f["name"] == name: return f return {"error": f"Function definition '{name}' not found."} - main.py:125-125 (registration)Registers the get_function_definition tool with the MCP server using the @mcp.tool() decorator.
@mcp.tool()