edit_resume
Edit LaTeX resume files by replacing entire content or performing targeted text replacements to update professional documents.
Instructions
Edit an existing LaTeX resume file.
Args:
filename: Name of the resume file to edit
content: New complete content for the resume (replaces everything)
find: Text to find for targeted replacement (use with 'replace')
replace: Text to replace the found text with
Either provide 'content' for full replacement, or 'find' and 'replace' for targeted edit.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | ||
| content | No | ||
| find | No | ||
| replace | No |
Implementation Reference
- src/latex_resume_mcp/server.py:301-335 (handler)The @mcp.tool() decorated function that implements the 'edit_resume' tool logic. The decorator also serves as the registration mechanism in FastMCP. The function handles full content replacement or find-replace editing of LaTeX resume files.@mcp.tool() def edit_resume(filename: str, content: str = None, find: str = None, replace: str = None) -> str: """ Edit an existing LaTeX resume file. Args: filename: Name of the resume file to edit content: New complete content for the resume (replaces everything) find: Text to find for targeted replacement (use with 'replace') replace: Text to replace the found text with Either provide 'content' for full replacement, or 'find' and 'replace' for targeted edit. """ ensure_dirs() filepath = get_resumes_dir() / ensure_tex_extension(filename) if not filepath.exists(): return json.dumps({"error": f"Resume '{filename}' not found"}) try: if content: filepath.write_text(content, encoding="utf-8") return json.dumps({"success": True, "path": str(filepath), "edit_type": "full_replacement"}) elif find is not None and replace is not None: current_content = filepath.read_text(encoding="utf-8") if find not in current_content: return json.dumps({"error": f"Could not find the specified text in {filename}"}) new_content = current_content.replace(find, replace) filepath.write_text(new_content, encoding="utf-8") return json.dumps({"success": True, "path": str(filepath), "edit_type": "find_replace"}) else: return json.dumps({"error": "Must provide either 'content' for full replacement or 'find' and 'replace' for targeted edit."}) except Exception as e: return json.dumps({"error": f"Error editing file: {str(e)}"})