Brush the outsides of the bread with olive oil and heat a griddle to medium-low heat.
Smear 2-3 tablespoons of pesto on the inside of one of the slices and then layer tomatoes, caramelized onions, and mozzarella cheese. Cover with remaining piece of oiled bread.
Cook on each side until crusty and cheese has melted.