get_function_definition
Extract detailed function definitions by name for binary analysis using Ghidra in headless mode, aiding reverse-engineering tasks with structured data retrieval.
Instructions
Get details of a specific function definition by name.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes |
Implementation Reference
- main.py:126-133 (handler)The handler function that executes the tool logic: retrieves details of a specific function definition from the Ghidra context by name, returning a dict or 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 using the @mcp.tool() decorator from FastMCP.@mcp.tool()