get_template
Retrieve LaTeX resume templates for creating professional documents with structured formatting options.
Instructions
Get the content of a resume template.
Args:
template_name: Name of the template (modern, classic, minimal)
Returns the full LaTeX template content.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| template_name | Yes |
Implementation Reference
- src/latex_resume_mcp/server.py:443-456 (handler)The handler function for the MCP tool 'get_template'. Decorated with @mcp.tool() for automatic registration and schema inference from types/docstring. Retrieves and returns the LaTeX template content.@mcp.tool() def get_template(template_name: str) -> str: """ Get the content of a resume template. Args: template_name: Name of the template (modern, classic, minimal) Returns the full LaTeX template content. """ if template_name not in LATEX_TEMPLATES: return json.dumps({"error": f"Template '{template_name}' not found. Available: modern, classic, minimal"}) return LATEX_TEMPLATES[template_name]
- Supporting data structure: dictionary of hardcoded LaTeX templates used by get_template and other tools.LATEX_TEMPLATES = { "modern": r"""\documentclass[11pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{geometry} \usepackage{hyperref} \usepackage{titlesec} \usepackage{enumitem} \usepackage{xcolor} \geometry{left=0.75in, right=0.75in, top=0.5in, bottom=0.5in} \pagestyle{empty} % Colors \definecolor{primary}{RGB}{0, 79, 144} \definecolor{secondary}{RGB}{89, 89, 89} % Section formatting \titleformat{\section}{\large\bfseries\color{primary}}{}{0em}{}[\titlerule] \titlespacing{\section}{0pt}{12pt}{6pt} % Custom commands \newcommand{\resumeItem}[1]{\item\small{#1}} \newcommand{\resumeSubheading}[4]{ \item \begin{tabular*}{\textwidth}[t]{l@{\extracolsep{\fill}}r} \textbf{#1} & #2 \\ \textit{\small#3} & \textit{\small#4} \\ \end{tabular*}\vspace{-5pt} } \begin{document} % Header \begin{center} {\LARGE\bfseries YOUR NAME}\\[4pt] \href{mailto:email@example.com}{email@example.com} $|$ (123) 456-7890 $|$ \href{https://linkedin.com/in/yourprofile}{LinkedIn} $|$ \href{https://github.com/yourusername}{GitHub} \end{center} \section{Experience} \begin{itemize}[leftmargin=0.15in, label={}] \resumeSubheading {Company Name}{City, State} {Job Title}{Start Date -- End Date} \begin{itemize}[leftmargin=0.2in] \resumeItem{Accomplishment or responsibility} \resumeItem{Another accomplishment} \end{itemize} \end{itemize} \section{Education} \begin{itemize}[leftmargin=0.15in, label={}] \resumeSubheading {University Name}{City, State} {Degree, Major}{Graduation Date} \end{itemize} \section{Skills} \begin{itemize}[leftmargin=0.15in, label={}] \item \textbf{Programming:} Python, JavaScript, Java, C++ \item \textbf{Tools:} Git, Docker, AWS, Linux \end{itemize} \end{document} """, "classic": r"""\documentclass[11pt,letterpaper]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{geometry} \usepackage{hyperref} \usepackage{enumitem} \geometry{margin=1in} \pagestyle{empty} \begin{document} \begin{center} {\Large\textbf{YOUR NAME}}\\[6pt] Address Line $\bullet$ City, State ZIP\\ Phone: (123) 456-7890 $\bullet$ Email: email@example.com \end{center} \vspace{12pt} \noindent\textbf{\large OBJECTIVE}\\ \rule{\textwidth}{0.4pt}\\[3pt] A brief statement about your career objectives. \vspace{12pt} \noindent\textbf{\large EDUCATION}\\ \rule{\textwidth}{0.4pt}\\[3pt] \textbf{University Name} \hfill City, State\\ Degree, Major \hfill Graduation Date\\ GPA: X.XX \vspace{12pt} \noindent\textbf{\large EXPERIENCE}\\ \rule{\textwidth}{0.4pt}\\[3pt] \textbf{Company Name} \hfill City, State\\ \textit{Job Title} \hfill Start Date -- End Date \begin{itemize}[leftmargin=0.2in, topsep=0pt] \item Accomplishment or responsibility \item Another accomplishment \end{itemize} \vspace{12pt} \noindent\textbf{\large SKILLS}\\ \rule{\textwidth}{0.4pt}\\[3pt] \textbf{Technical:} List of technical skills\\ \textbf{Languages:} Languages you speak \end{document} """, "minimal": r"""\documentclass[11pt]{article} \usepackage[utf8]{inputenc} \usepackage[margin=0.75in]{geometry} \usepackage{hyperref} \usepackage{enumitem} \pagestyle{empty} \setlength{\parindent}{0pt} \begin{document} \textbf{\Large YOUR NAME}\\[4pt] email@example.com $|$ (123) 456-7890 $|$ City, State \vspace{12pt} \textbf{Experience}\hrulefill\\[6pt] \textbf{Job Title}, Company Name \hfill Dates\\ \begin{itemize}[leftmargin=0.15in, topsep=0pt, parsep=0pt] \item Accomplishment \end{itemize} \vspace{8pt} \textbf{Education}\hrulefill\\[6pt] \textbf{Degree}, University Name \hfill Graduation Date \vspace{8pt} \textbf{Skills}\hrulefill\\[6pt] Skill 1, Skill 2, Skill 3 \end{document} """, }
- src/latex_resume_mcp/server.py:443-443 (registration)The @mcp.tool() decorator registers the get_template function as an MCP tool on the FastMCP server instance.@mcp.tool()
- Input schema (template_name: str) and output (str) defined by type annotations and docstring, used by MCP for tool schema.def get_template(template_name: str) -> str: """ Get the content of a resume template. Args: template_name: Name of the template (modern, classic, minimal) Returns the full LaTeX template content. """