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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

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

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

With no annotations provided, the description carries full responsibility for behavioral disclosure. It reveals the file is saved to 'system temp directory,' describes the interactive editor capabilities including layout/color adjustments, and discloses the critical 5-minute expiration on the URL. This comprehensive coverage includes side effects (temporary file creation) and resource constraints.

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 uses an efficient structure with clear sections for purpose, input requirements, return values, and arguments. While slightly redundant in mentioning cv_data requirements twice (prose and Args section), each sentence conveys specific information without excessive verbosity. The format earns its length by documenting complex output behavior including expiration semantics.

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

Completeness5/5

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

For a file generation tool with nested object inputs, the description provides comprehensive coverage including input validation rules, output file location (temp directory), and interactive features (editor URL with token). It adequately prepares the agent for both successful invocation and handling of returned resources including the time-limited browser interface.

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

Parameters5/5

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

Despite 0% schema description coverage for the cv_data object, the description compensates effectively by documenting required sections (personal, experience, education, skills) and referencing the generate_cv template structure. It clarifies that additionalProperties are accepted through 'Complete CV data dictionary' while emphasizing completeness requirements, successfully bridging the schema documentation gap.

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

Purpose5/5

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

The description opens with 'Generate an ATS-optimized DOCX from CV data,' providing a specific verb, resource format, and optimization criteria. It distinguishes itself from sibling tools by referencing the generate_cv template structure, clarifying data expectations. The scope is precisely bounded to DOCX generation with ATS formatting requirements.

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

Usage Guidelines4/5

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

The description specifies clear prerequisites ('All required fields... must be filled in') and input requirements ('complete CV JSON object'). While it references generate_cv for structural guidance, it lacks explicit guidance on when to select this over generate_pdf or generate_cv. The temporal constraint (5-minute link expiration) adds important usage context.

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