Skip to main content
Glama

copy_docx

Copy Microsoft Word documents to new locations for backup, sharing, or version control. Specify source and destination file paths to duplicate DOCX files.

Instructions

Copy a Word document to a new location.

Args: source_filepath: Path to the source document destination_filepath: Path for the copied document

Returns: Dictionary with status

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
source_filepathYes
destination_filepathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The 'copy_docx' tool handler implementation, which copies a Word document to a new location using the docx library.
    def copy_docx(source_filepath: str, destination_filepath: str) -> dict[str, Any]:
        """
        Copy a Word document to a new location.
    
        Args:
            source_filepath: Path to the source document
            destination_filepath: Path for the copied document
    
        Returns:
            Dictionary with status
        """
        logger.info(
            "Copying document",
            extra={"tool": "copy_docx", "source": source_filepath, "destination": destination_filepath},
        )
    
        try:
            source_path = validate_docx_file(source_filepath)
            dest_path = normalize_path(destination_filepath)
            dest_path.parent.mkdir(parents=True, exist_ok=True)
    
            # Read and save as new document (preserves all formatting)
            doc = Document(str(source_path))
            doc.save(str(dest_path))
    
            logger.info("Document copied successfully", extra={"destination": destination_filepath})
    
            return {
                "status": "success",
                "source": str(source_path),
                "destination": str(dest_path),
                "message": "Document copied successfully",
            }
        except DocxMcpError as e:
            logger.warning(e.message, extra={"tool": "copy_docx", "error_code": e.error_code})
            return {"status": "error", "error": e.message, "error_code": e.error_code}
        except Exception as e:
            logger.error(f"Unexpected error copying document: {str(e)}")
            return {"status": "error", "error": str(e)}
  • Registration of the 'copy_docx' tool using the @app.tool() decorator.
    @app.tool()
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states the tool copies a document but lacks details on behavioral traits like whether it overwrites existing files at the destination, requires specific permissions, handles errors (e.g., if source doesn't exist), or has rate limits. This is a significant gap for a mutation tool with no annotation coverage.

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 appropriately sized and front-loaded, with the core purpose stated first. The 'Args' and 'Returns' sections are structured but could be more concise by integrating details into the main text. Overall, it avoids unnecessary fluff, though the formatting is slightly verbose.

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

Completeness3/5

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

Given the tool's moderate complexity (copy operation with 2 parameters), no annotations, and an output schema (which covers return values), the description is minimally adequate. It explains the basic action but lacks context on usage, behavior, and parameter details, making it incomplete for safe and effective tool invocation.

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?

The description adds minimal semantics beyond the input schema, which has 0% description coverage. It names the parameters ('source_filepath' and 'destination_filepath') and implies they are paths, but does not specify format (e.g., absolute/relative), constraints, or examples. With low schema coverage, the description only partially compensates, leaving gaps in parameter understanding.

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's purpose: 'Copy a Word document to a new location.' It specifies the verb ('copy') and resource ('Word document'), but does not explicitly differentiate it from sibling tools like 'create_docx' or 'write_docx', which might involve creating or modifying documents rather than copying existing ones.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It does not mention prerequisites, such as needing an existing document to copy, or compare it to siblings like 'create_docx' for new documents or 'read_docx' for accessing content without copying.

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/Andrew82106/LLM_Docx_Agent_MCP'

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