There are a few locations right on the Royal Mile where you can book a city tour., some underground, some ghost. You can look for a kiosk on the street, and also an office close to the Castle, and also down by the Starbucks. It's pretty obvious to find the tour companies on the Royal Mile.
You might check out Rabbie's tours...they are just over the bridge in New Town, and they offer great tours of surrounding areas.
You an also book from your hotel the night before using TripAdvisor.com ,or look up Rabbie's Tours on line. They show many types of tours with feedback to help you decide.
That's how my daughter and I picked a Rabbies tour of the Highlands for a day when we got stuck an extra day in Edinburgh because of the blizzard on the east coast back in March this year.... We found tours on our ipad, did research, chose what sounded good and booked it on line for the next day.
You don't need a guided tour of the Castle or Holyrood, you get a audio guide free with admission that will take you through the sights at your leisure. Lots of good info, and if something is boring to you, you can skip it.
And here's some good info too: http://edinburgh.org/blog/how-to-complete-your-scottish-bucket-list-without-ever-leaving-edinburgh/