Onmyoji were specialists in magic and divination. Their court responsibilities ranged from tasks such as keeping track of the calendar, to mystical duties such as divination and protection of the capital from evil spirits.