Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
cv_dataYes

Implementation Reference

  • 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.",
        })

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Guid-Lab/cv-forge-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server