My goal is to create a fancier agenda page and for this I would like to define e.g. an icon and a color for the section that shall be used to format the table of contents. Maybe finally the ToC is actually formatted through TikZ and not as a simple list, hence I am interested in general how to store more information than just the section name in the *.toc file and re-use it with the \tableofcontents-command or maybe define my own \fancytoc-command.
Here is an MWE that defines a \sectionsymbol and a sectioncolor, as well as a command to set them along with the section title \myfancysection.
\documentclass{beamer}
\usepackage{fontawesome}
\definecolor{sectioncolor}{rgb}{0,0,0}
\newcommand{\sectionsymbol}{\relax}
\newcommand{\sectionstart}{\frame{\textcolor{sectioncolor}{\sectionsymbol\ \secname}}}
\newcommand{\myfancysection}[3]{\colorlet{sectioncolor}{#1}\renewcommand{\sectionsymbol}{#2}\section{#3}}
\begin{document}
\begin{frame}{Agenda}
\tableofcontents
\end{frame}
\myfancysection{red}{\faAmbulance}{My red section}
\sectionstart
\myfancysection{green}{\faAutomobile}{My green section}
\sectionstart
\begin{frame}{Agenda as I wanted to be automatically}
\begin{description}[\faAutomobile]
\item[\color{red}\faAmbulance] \textcolor{red}{My red section}
\item[\color{green}\faAutomobile] \textcolor{green}{My green section}
\end{description}
\end{frame}
\end{document}
The last frame is just an illustration of how one could use the additional information to format the ToC, as mentioned I could also imagine to build the ToC through TikZ and I don't necessarily want to have a solution that only stores a color and a symbol, but maybe a list of key-value pairs, if that is not too advanced.

