Skip to main content
Glama
marekrost

mcp-server-spreadsheet

copy_workbook

Copy spreadsheet files to new locations while preserving all data. Specify source and destination paths to create duplicate workbooks.

Instructions

Copy an existing spreadsheet file to a new location.

Performs a full file copy preserving all data. The destination must not already exist. Returns the absolute path of the new file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceYesPath to the existing spreadsheet file to copy
destinationYesPath for the new copy. Must not already exist.

Implementation Reference

  • The copy_workbook tool handler executes a file copy using shutil.copy2, validates that the source exists and the destination does not, and returns the absolute path of the new file.
    def copy_workbook(
        source: Annotated[str, Field(description="Path to the existing spreadsheet file to copy")],
        destination: Annotated[str, Field(description="Path for the new copy. Must not already exist.")],
    ) -> str:
        """Copy an existing spreadsheet file to a new location.
    
        Performs a full file copy preserving all data. The destination must
        not already exist. Returns the absolute path of the new file.
        """
        src = Path(source)
        if not src.exists():
            raise ValueError(f"Source not found: {source}")
        dst = Path(destination)
        if dst.exists():
            raise ValueError(f"Destination already exists: {destination}")
        shutil.copy2(src, dst)
        return str(dst.resolve())

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/marekrost/mcp-server-spreadsheet'

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