Remove dead UI tools that can never work in headless MCP mode
ui_get_current_address and ui_get_current_function require Ghidra GUI context to know what the user has selected. Since MCP always runs headless (Docker container), these tools always fail with HEADLESS_MODE error. Removed them to avoid confusion. Alternative: Use explicit addresses with functions_get(address=...) or data_list(addr=...) instead.
This commit is contained in:
parent
c930e7c059
commit
842035ca92
@ -242,41 +242,10 @@ class AnalysisMixin(MCGhidraMixinBase):
|
|||||||
|
|
||||||
return paginated
|
return paginated
|
||||||
|
|
||||||
@mcp_tool()
|
# NOTE: ui_get_current_address and ui_get_current_function were removed
|
||||||
def ui_get_current_address(self, port: Optional[int] = None) -> Dict[str, Any]:
|
# because they require Ghidra GUI context which is never available in
|
||||||
"""Get the address currently selected in Ghidra's UI.
|
# headless MCP mode. Use functions_get(address=...) or data_list(addr=...)
|
||||||
|
# with explicit addresses instead.
|
||||||
Args:
|
|
||||||
port: Ghidra instance port (optional)
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Current address information
|
|
||||||
"""
|
|
||||||
try:
|
|
||||||
port = self.get_instance_port(port)
|
|
||||||
except ValueError as e:
|
|
||||||
return {"success": False, "error": {"code": "NO_INSTANCE", "message": str(e)}}
|
|
||||||
|
|
||||||
response = self.safe_get(port, "address")
|
|
||||||
return self.simplify_response(response)
|
|
||||||
|
|
||||||
@mcp_tool()
|
|
||||||
def ui_get_current_function(self, port: Optional[int] = None) -> Dict[str, Any]:
|
|
||||||
"""Get the function currently selected in Ghidra's UI.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
port: Ghidra instance port (optional)
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Current function information
|
|
||||||
"""
|
|
||||||
try:
|
|
||||||
port = self.get_instance_port(port)
|
|
||||||
except ValueError as e:
|
|
||||||
return {"success": False, "error": {"code": "NO_INSTANCE", "message": str(e)}}
|
|
||||||
|
|
||||||
response = self.safe_get(port, "function")
|
|
||||||
return self.simplify_response(response)
|
|
||||||
|
|
||||||
@mcp_tool()
|
@mcp_tool()
|
||||||
def comments_get(
|
def comments_get(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user