Creating a post that contains a list of other posts like a table of contents

Take a look at the WordPress Codex:

The most appropriate use for get_posts is to create an array of posts based on a set of parameters. It retrieves a list of recent posts or posts matching this criteria.