Skip to main content
Glama

generate_docx

Create ATS-optimized DOCX resumes from structured CV data. Provides a visual editor for layout customization and alternative format downloads.

Instructions

Generate an ATS-optimized DOCX from CV data.

Takes a complete CV JSON object (same structure as generate_cv template). All required fields (personal, experience, education, skills) must be filled in.

Returns:

  • file: absolute path to the generated DOCX 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 visually, adjust layout/colors, and download alternative formats. The link expires after 5 minutes.

Args: cv_data: Complete CV data dictionary with all sections filled in.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cv_dataYes

Implementation Reference

  • The `generate_docx` tool handler, which takes CV data, sends it to the configured CV Forge backend, saves the returned DOCX file to a temporary location, and returns the file path and editor URL.
    @mcp.tool()
    def generate_docx(cv_data: dict) -> str:
        """Generate an ATS-optimized DOCX from CV data.
    
        Takes a complete CV JSON object (same structure as generate_cv template).
        All required fields (personal, experience, education, skills) must be filled in.
    
        Returns:
        - file: absolute path to the generated DOCX 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 visually, adjust layout/colors,
          and download alternative formats. The link expires after 5 minutes.
    
        Args:
            cv_data: Complete CV data dictionary with all sections filled in.
        """
        base = _get_base_url()
    
        r = httpx.post(
            f"{base}/api/generate/docx",
            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}.docx")
        with open(path, "wb") as f:
            f.write(r.content)
    
        editor_url = _post_load_data(cv_data)
    
        return json.dumps({
            "file": path,
            "editor_url": editor_url,
            "message": f"DOCX saved to {path}. Open {editor_url} to edit visually.",
        })

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