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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

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.",
        })
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden and discloses substantial behavioral context: files are saved to the system temp directory, the editor_url expires after 5 minutes, the ATS PDF is text-based for ATS compatibility, and the Pretty PDF requires browser interaction. It details the return values (absolute path and URL format) that would otherwise be unknown.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections for purpose, input requirements, return values, and Args. The length is justified by the complexity (dual outputs, file locations, expiration timing). Every sentence adds necessary context, though the Args section slightly repeats information provided earlier in the description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the absence of annotations and 0% schema coverage, the description adequately compensates by detailing the return values (ats_pdf path and editor_url), file locations, URL expiration, and the distinction between ATS and visual PDF outputs. It successfully explains what the tool produces without needing to reference an external output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description must compensate entirely. It identifies cv_data as a 'Complete CV data dictionary' and references the generate_cv template structure, listing the four required top-level sections (personal, experience, education, skills). However, it does not detail the nested object schemas or data types within those sections, leaving significant semantic gaps given the freeform nature of the parameter (additionalProperties: true).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool generates an 'ATS-optimized PDF' and provides a visual editor link, using specific verbs and resources. It distinguishes between the ATS PDF (text-based) and Pretty PDF (visually styled) outputs. However, it does not explicitly differentiate from sibling tool generate_docx (which presumably outputs Word documents rather than PDFs).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear prerequisites (complete CV JSON with personal, experience, education, skills fields filled) and references the generate_cv template structure. It explains the workflow (get ATS PDF immediately vs. use editor_url for styled PDF). However, it lacks explicit guidance on when to choose this over generate_docx or the relationship to cv_forge_setup in the broader workflow.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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