get_binary_info
Extract metadata from binary files to analyze structure and properties for security research or reverse engineering purposes.
Instructions
Get binary metadata
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes |
Implementation Reference
- binaryninja_server.py:293-315 (handler)Primary handler for the get_binary_info MCP tool. Retrieves binary file information using BinaryNinjaHTTPClient.get_file_info and formats the response with key metadata like architecture, entry point, size, etc.elif method == "get_binary_info": path = params.get("path") if not path: return {"error": "Path parameter is required"} # We assume the binary is already loaded # Just log the path for debugging logger.info(f"Using binary: {path}") file_info = client.get_file_info(path) # Format the response to match the original API info = { "filename": file_info.get("filename", ""), "architecture": file_info.get("arch", {}).get("name", "unknown"), "platform": file_info.get("platform", {}).get("name", "unknown"), "entry_point": hex(file_info.get("entry_point", 0)), "file_size": file_info.get("file_size", 0), "is_executable": file_info.get("executable", False), "is_relocatable": file_info.get("relocatable", False), "address_size": file_info.get("address_size", 0) } return {"result": info}
- binaryninja_server.py:53-65 (schema)Input schema definition for the get_binary_info tool in the list_tools response.{ "name": "get_binary_info", "description": "Get information about a binary file", "inputSchema": { "type": "object", "properties": { "path": { "type": "string", "description": "Path to the binary file" } }, "required": ["path"] }
- binaryninja_server.py:262-266 (registration)Registration of get_binary_info tool in the call_tool handler, delegating to the method handler.if tool_name == "get_binary_info": return handle_request({ "method": "get_binary_info", "params": tool_args }, client)
- binaryninja_mcp_http_server.py:304-315 (handler)HTTP MCP server handler for get_binary_info, calls client.get_file_info(path) and wraps result.elif method == "get_binary_info": path = params.get("path") if not path: logger.error("Missing 'path' parameter") return self._error_response(request_id, -32602, "Missing 'path' parameter") if not isinstance(path, str): logger.error(f"Invalid path type: {type(path)}") return self._error_response(request_id, -32602, "Parameter 'path' must be a string") logger.debug(f"Getting info for file: {path}") info = self.client.get_file_info(path) return self._wrap_result(request_id, json.dumps(info, indent=2))
- binaryninja_mcp_http_server.py:24-31 (schema)Input schema for get_binary_info in MCP_TOOLS array for HTTP server."name": "get_binary_info", "description": "Get binary metadata", "streaming": False, "inputSchema": { "type": "object", "properties": {"path": {"type": "string"}}, "required": ["path"] }