add_education
Add education entries to LaTeX resumes by specifying institution, degree, dates, and optional details like location or GPA.
Instructions
Add a new education entry to a resume (works with modern template).
Args:
filename: Name of the resume file
institution: School/University name
degree: Degree and major
dates: Dates attended (e.g., 'Sep 2016 -- May 2020')
location: Location - optional
details: Additional details (GPA, honors, coursework) - optional
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | ||
| institution | Yes | ||
| degree | Yes | ||
| dates | Yes | ||
| location | No | ||
| details | No |
Implementation Reference
- src/latex_resume_mcp/server.py:512-563 (handler)The handler function implementing the 'add_education' tool logic. It modifies a LaTeX resume file by inserting a new education entry into the Education section using regex to find the insertion point. The @mcp.tool() decorator registers it with the MCP server.def add_education( filename: str, institution: str, degree: str, dates: str, location: str = "", details: list[str] = None ) -> str: """ Add a new education entry to a resume (works with modern template). Args: filename: Name of the resume file institution: School/University name degree: Degree and major dates: Dates attended (e.g., 'Sep 2016 -- May 2020') location: Location - optional details: Additional details (GPA, honors, coursework) - optional """ ensure_dirs() filepath = get_resumes_dir() / ensure_tex_extension(filename) if not filepath.exists(): return json.dumps({"error": f"Resume '{filename}' not found"}) try: content = filepath.read_text(encoding="utf-8") education_entry = f"""\\resumeSubheading {{{institution}}}{{{location}}} {{{degree}}}{{{dates}}}""" if details: detail_items = "\n".join([f" \\resumeItem{{{d}}}" for d in details]) education_entry += f""" \\begin{{itemize}}[leftmargin=0.2in] {detail_items} \\end{{itemize}}""" import re pattern = r"(\\section\{Education\}[\s\S]*?\\begin\{itemize\}\[leftmargin=0\.15in, label=\{\}\])" match = re.search(pattern, content, re.IGNORECASE) if match: insert_pos = match.end() new_content = content[:insert_pos] + "\n" + education_entry + content[insert_pos:] filepath.write_text(new_content, encoding="utf-8") return json.dumps({"success": True, "message": f"Added education entry for {institution}"}) else: return json.dumps({"error": "Could not find Education section. Make sure the resume uses the modern template format."}) except Exception as e: return json.dumps({"error": f"Error adding education: {str(e)}"})