generate_pdf
Create ATS-optimized PDF resumes from CV data and access a visual editor for customizing layouts, colors, and downloading styled versions.
Instructions
Generate an ATS-optimized PDF and provide a link to the visual editor.
Takes a complete CV JSON object (same structure as generate_cv template). All required fields (personal, experience, education, skills) must be filled in.
Returns:
ats_pdf: absolute path to the generated ATS PDF file (saved in system temp directory)
editor_url: URL to open in the browser (http://localhost:5000/?load=) where the user can preview their CV with full visual styling, customize colors/layout, and download a Pretty PDF version. The link expires after 5 minutes.
The ATS PDF is a clean, text-based document optimized for applicant tracking systems. For a visually styled PDF with colors, logos, and layout — direct the user to open the editor_url in their browser and click "Download Pretty PDF" there.
Args: cv_data: Complete CV data dictionary with all sections filled in.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cv_data | Yes |
Implementation Reference
- mcp_server.py:339-376 (handler)The 'generate_pdf' tool handler function. It takes CV data, sends it to a backend API to generate an ATS-optimized PDF, saves the PDF to a temporary directory, and returns the path along with an editor URL.
@mcp.tool() def generate_pdf(cv_data: dict) -> str: """Generate an ATS-optimized PDF and provide a link to the visual editor. Takes a complete CV JSON object (same structure as generate_cv template). All required fields (personal, experience, education, skills) must be filled in. Returns: - ats_pdf: absolute path to the generated ATS PDF file (saved in system temp directory) - editor_url: URL to open in the browser (http://localhost:5000/?load=<token>) where the user can preview their CV with full visual styling, customize colors/layout, and download a Pretty PDF version. The link expires after 5 minutes. The ATS PDF is a clean, text-based document optimized for applicant tracking systems. For a visually styled PDF with colors, logos, and layout — direct the user to open the editor_url in their browser and click "Download Pretty PDF" there. Args: cv_data: Complete CV data dictionary with all sections filled in. """ base = _get_base_url() r = httpx.post(f"{base}/api/generate/ats-pdf", json=cv_data, timeout=30) r.raise_for_status() name = cv_data.get("personal", {}).get("name", "CV").replace(" ", "_") path = os.path.join(tempfile.gettempdir(), f"CV_{name}_ATS.pdf") with open(path, "wb") as f: f.write(r.content) editor_url = _post_load_data(cv_data) return json.dumps({ "ats_pdf": path, "editor_url": editor_url, "message": f"ATS PDF saved to {path}. " f"Open {editor_url} in browser to customize the visual layout and download a Pretty PDF.", })